Advertisement
Oleguer

mux_unidades

Dec 7th, 2021
976
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_0 is
  5.     port (
  6.         bcd0 : in std_logic_vector(3 downto 0);
  7.         SW9  : in std_logic_vector(1 downto 0);
  8.         UD   : out std_logic_vector(3 downto 0)
  9.     );
  10. end mux_0;
  11.  
  12. architecture dataflow of mux_0 is
  13.  
  14. begin
  15.  
  16.     process (SW9, bcd0) is
  17.        
  18.     begin
  19.        
  20.         case SW9 is
  21.             when "00" => UD <= "0010";
  22.             when "01" => UD <= bcd0;
  23.             when others => UD <= (others => '0');
  24.         end case;
  25.        
  26.     end process;
  27.  
  28. end dataflow;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement