-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7485_tb.vhdl
141 lines (117 loc) · 2.2 KB
/
7485_tb.vhdl
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
library IEEE;
use IEEE.Std_logic_1164.all;
use IEEE.Numeric_Std.all;
entity ic7485_tb is
end;
architecture ic7485_tb of ic7485_tb is
component ic7485 is
port
(
a,b: in std_logic_vector(3 downto 0);
igreater,iless,iequal: in std_logic;
ogreater,oless,oequal: out std_logic
);
end component;
signal a,b: std_logic_vector(3 downto 0);
signal igreater,iless,iequal: std_logic;
signal ogreater,oless,oequal: std_logic;
begin
u: ic7485 port map(
a => a,
b => b,
igreater => igreater,
iless => iless,
iequal => iequal,
ogreater => ogreater,
oless => oless,
oequal => oequal
);
process begin
igreater <= '0';
iequal <= '1';
iless <= '0';
a(0) <= '0';
a(1) <= '0';
a(2) <= '0';
a(3) <= '0';
b(0) <= '0';
b(1) <= '0';
b(2) <= '0';
b(3) <= '0';
wait for 1 ns;
igreater <= '0';
iequal <= '1';
iless <= '0';
a(0) <= '1';
a(1) <= '1';
a(2) <= '0';
a(3) <= '0';
b(0) <= '1';
b(1) <= '0';
b(2) <= '0';
b(3) <= '0';
wait for 1 ns;
igreater <= '0';
iequal <= '1';
iless <= '0';
a(0) <= '1';
a(1) <= '0';
a(2) <= '0';
a(3) <= '0';
b(0) <= '1';
b(1) <= '1';
b(2) <= '0';
b(3) <= '0';
wait for 1 ns;
igreater <= '0';
iequal <= '1';
iless <= '0';
a(0) <= '1';
a(1) <= '0';
a(2) <= '1';
a(3) <= '1';
b(0) <= '1';
b(1) <= '0';
b(2) <= '1';
b(3) <= '1';
wait for 1 ns;
igreater <= '0';
iequal <= '1';
iless <= '0';
a(0) <= '1';
a(1) <= '0';
a(2) <= '1';
a(3) <= '1';
b(0) <= '1';
b(1) <= '1';
b(2) <= '0';
b(3) <= '0';
wait for 1 ns;
igreater <= '0';
iequal <= '1';
iless <= '0';
a(0) <= '1';
a(1) <= '1';
a(2) <= '0';
a(3) <= '0';
b(0) <= '1';
b(1) <= '0';
b(2) <= '1';
b(3) <= '1';
wait for 1 ns;
igreater <= '0';
iequal <= '1';
iless <= '0';
a(0) <= '1';
a(1) <= '0';
a(2) <= '0';
a(3) <= '0';
b(0) <= '0';
b(1) <= '0';
b(2) <= '0';
b(3) <= '1';
wait for 1 ns;
assert false report "Reached end of test";
wait;
end process;
end ic7485_tb;