-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestBench_Mux_4x1.vhd
63 lines (54 loc) · 1.32 KB
/
TestBench_Mux_4x1.vhd
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
library ieee;
use ieee.numeric_std.all;
use ieee.std_logic_1164.all;
entity TestBench_Mux_4x1 is
end TestBench_Mux_4x1;
architecture ARC of TestBench_Mux_4x1 is
component Mux_4x1
port(
Input : in std_logic_vector(3 downto 0);
Sel : in std_logic_vector(1 downto 0);
Output : out std_logic);
end component;
signal Input : std_logic_vector(3 downto 0);
signal Sel : std_logic_vector(1 downto 0);
signal Output : std_logic;
begin
dev : Mux_4x1
port map
(Input => Input,
Sel => Sel,
Output => Output);
stim : process
begin
Sel(0) <= '0';
Sel(1) <= '0';
Input(0) <= '1';
Input(1) <= '0';
Input(2) <= '0';
Input(3) <= '0';
wait for 20ns;
Sel(0) <= '0';
Sel(1) <= '1';
Input(0) <= '0';
Input(1) <= '1';
Input(2) <= '0';
Input(3) <= '0';
wait for 20ns;
Sel(0) <= '1';
Sel(1) <= '0';
Input(0) <= '0';
Input(1) <= '0';
Input(2) <= '1';
Input(3) <= '0';
wait for 20ns;
Sel(0) <= '1';
Sel(1) <= '1';
Input(0) <= '0';
Input(1) <= '0';
Input(2) <= '0';
Input(3) <= '1';
wait for 20ns;
wait;
end process;
end ARC;