-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmux8.vhd
More file actions
executable file
·32 lines (26 loc) · 1.18 KB
/
mux8.vhd
File metadata and controls
executable file
·32 lines (26 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
----------------------------------------------------------------------------------
-- mux 8 to 1 (16 bits)
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity mux8 is
Port (
in0, in1, in2, in3, in4, in5, in6, in7, in8: in std_logic_vector (15 downto 0);
s0, s1 ,s2, s3: in std_logic;
Z: out std_logic_vector (15 downto 0));
end mux8;
architecture behavioural of mux8 is
begin
Z <=
in0 after 1 ns when s0 = '0' and s1 = '0' and s2 = '0' and s3='0' else
in1 after 1 ns when s0 = '0' and s1 = '0' and s2 = '0' and s3='1' else
in2 after 1 ns when s0 = '0' and s1 = '0' and s2 = '1' and s3='0' else
in3 after 1 ns when s0 = '0' and s1 = '0' and s2 = '1' and s3='1' else
in4 after 1 ns when s0 = '0' and s1 = '1' and s2 = '0' and s3='0' else
in5 after 1 ns when s0 = '0' and s1 = '1' and s2 = '0' and s3='1' else
in6 after 1 ns when s0 = '0' and s1 = '1' and s2 = '1' and s3='0' else
in7 after 1 ns when s0 = '0' and s1 = '1' and s2 = '1' and s3='1' else
in8 after 1 ns when s0 = '1' and s1 = '0' and s2 = '0' and s3='0' else
X"0000" after 5ns;
end behavioural;