Advertisement
Oleguer

mux_decenas

Dec 7th, 2021
964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.46 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity mux_1 is
  5.     port (
  6.         bcd1 : in std_logic_vector(3 downto 0);
  7.         SW9  : in std_logic_vector(1 downto 0);
  8.         DC   : out std_logic_vector(3 downto 0)
  9.     );
  10. end mux_1;
  11.  
  12. architecture dataflow of mux_1 is
  13.  
  14. begin
  15.  
  16.     process (SW9, bcd1) is
  17.        
  18.     begin
  19.        
  20.         case SW9 is
  21.             when "00" => DC <= "1001";
  22.             when "01" => DC <= bcd1;
  23.             when others => DC <= (others => '0');
  24.         end case;
  25.        
  26.     end process;
  27.  
  28. end dataflow;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement