-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTB_Decoder_2_to_4.vhd
98 lines (71 loc) · 1.75 KB
/
TB_Decoder_2_to_4.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 02/20/2024 02:32:31 PM
-- Design Name:
-- Module Name: TB_Decoder_2_to_4 - Behavioral
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity TB_Decoder_2_to_4 is
-- Port ( );
end TB_Decoder_2_to_4;
architecture Behavioral of TB_Decoder_2_to_4 is
COMPONENT Decoder_2_to_4
PORT ( I : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
EN : IN STD_LOGIC;
Y : OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END COMPONENT;
SIGNAL I : STD_LOGIC_VECTOR(1 DOWNTO 0);
SIGNAL EN : STD_LOGIC;
SIGNAL Y : STD_LOGIC_VECTOR(3 DOWNTO 0);
begin
UUT: Decoder_2_to_4 PORT MAP(
Y => Y,
EN => EN,
I => I );
PROCESS
BEGIN
EN <= '0';
I(0) <= '0';
I(1) <= '0';
WAIT FOR 100ns;
I(0) <= '1';
WAIT FOR 100ns;
I(0) <= '0';
I(1) <= '1';
WAIT FOR 100ns;
I(0) <= '1';
WAIT FOR 100ns;
EN <= '1';
I(0) <= '0';
I(1) <= '0';
WAIT FOR 100ns;
I(0) <= '1';
WAIT FOR 100ns;
I(0) <= '0';
I(1) <= '1';
WAIT FOR 100ns;
I(0) <= '1';
WAIT;
END PROCESS;
end Behavioral;