-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmux_tb.vhd
More file actions
44 lines (38 loc) · 1 KB
/
mux_tb.vhd
File metadata and controls
44 lines (38 loc) · 1 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
32
33
34
35
36
37
38
39
40
41
42
43
44
library IEEE;
use IEEE.std_logic_1164.all;
entity t_mux is
end t_mux;
architecture behavior of t_mux is
component mux2 is
port(
a1: in STD_LOGIC_VECTOR(15 downto 0);
a2: in STD_LOGIC_VECTOR(15 downto 0);
sel: in STD_LOGIC;
b: out STD_LOGIC_VECTOR(15 downto 0)
);
end component mux2;
signal I1_t: STD_LOGIC_VECTOR(15 downto 0);
signal I2_t: STD_LOGIC_VECTOR(15 downto 0);
signal S_t: STD_LOGIC;
signal Y_t: STD_LOGIC_VECTOR(15 downto 0);
begin
Mux: mux2
port map(
a1 => I1_t,
a2 => I2_t,
sel => S_t,
b => Y_t
);
process
begin
I1_t <= "0000000000000000";
I2_t <= "1111111111111111";
S_t <= '0';
wait for 1 ms;
assert Y_t = I1_t;
S_t <= '1';
wait for 1 ms;
assert Y_t = I2_t;
wait;
end process;
end behavior;