forked from AndrewMcClelland/RISC_Computer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCLA_tb.vhd
More file actions
63 lines (43 loc) · 1.09 KB
/
Copy pathCLA_tb.vhd
File metadata and controls
63 lines (43 loc) · 1.09 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY CLA_tb IS
END;
ARCHITECTURE CLA_tb_arch OF CLA_tb IS
SIGNAL ina_tb : std_logic_vector (15 downto 0);
SIGNAL inb_tb : std_logic_vector (15 downto 0);
SIGNAL cin_tb : std_logic;
SIGNAL sum_out_tb : std_logic_vector (15 downto 0);
SIGNAL cout_tb : std_logic;
COMPONENT carry_lookahead_adder
PORT (
A : IN std_logic_vector(15 downto 0);
B : IN std_logic_vector(15 downto 0);
Cin : IN std_logic;
S : OUT std_logic_vector(15 downto 0);
Cout : OUT std_logic);
END COMPONENT carry_lookahead_adder;
BEGIN
DUT1 : carry_lookahead_adder
PORT MAP (
A => ina_tb,
B => inb_tb,
Cin => cin_tb,
Cout => cout_tb,
S => sum_out_tb);
sim_process: process
begin
wait for 0 ns;
ina_tb <= b"0000_0000_0000_0001";
inb_tb <= b"0000_0000_0000_0001";
cin_tb <= '0';
wait for 50 ns;
ina_tb <= b"0000_0000_0000_1000";
inb_tb <= b"0000_0000_0000_0001";
cin_tb <= '0';
wait for 50 ns;
ina_tb <= b"0001_0010_0010_0001";
inb_tb <= b"0010_0000_1111_0001";
cin_tb <= '0';
wait;
end process sim_process;
end;