Advertisement
salla

mux_4_to_1

Jul 25th, 2019
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.81 KB | None | 0 0
  1. -- mux 4x1 em VHDL
  2. -- entradas A0,A1,A2 e A3
  3. -- saída s
  4. -- entradas de selação Sel0 e sel1
  5. --
  6. -- selo sel 1   s=Ai,  i variando de 0 a 3
  7. -- ---------------
  8. --  0   0       A(0)
  9. --  0   1       A(1)
  10. --  1   0       A(2)
  11. --  1   1       A(3)
  12.  
  13. --Autor: Marcos Meira
  14.  
  15. --data :09 de agosto de 2016
  16.  
  17.  
  18.  Library IEEE;
  19.  use IEEE.std_logic_1164.all;
  20.  
  21.  entity mux_4_to_1 is
  22.  port (
  23.        sel : in std_logic_vector (1 downto 0);
  24.        A   : in std_logic_vector (3 downto 0);
  25.        s   : out std_logic
  26.  
  27.       );
  28.  end mux_4_to_1;
  29.  
  30.  architecture hardware of mux_4_to_1 is
  31.  begin
  32.      
  33.           with sel select
  34.                  
  35.                      s <= A(0) when "00",
  36.                           A(1) when "01",
  37.                           A(2) when "10",
  38.                           A(3) when "11",
  39.                           '0'  when others;
  40. end hardware;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement