www.pudn.com > codeofvhdl2006.rar > BCD_MUX.VHD


 
 
--bcd_mux.vhd multiplexer of bcd-selection 
library ieee ; 
use ieee.std_logic_1164.all; 
 
entity bcd_mux is 
port( 
  com_clk : in std_logic_vector(1 downto 0);--input count 
  bcd_data : in std_logic_vector(15 downto 0);--input display data 
  bcd_led : out std_logic_vector(3 downto 0));--output to 7 segment 
end bcd_mux; 
architecture behavior of bcd_mux is  
begin  
  bcd_led<=bcd_data(3 downto 0) when com_clk="00" else 
           bcd_data(7 downto 4) when com_clk="01" else 
           bcd_data(11 downto 8) when com_clk="10" else 
           bcd_data(15 downto 12); 
end behavior;