forked from AndrewMcClelland/RISC_Computer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbooth_32_bitPairRecoding_algorithm_tb.vhd
More file actions
67 lines (49 loc) · 1.78 KB
/
Copy pathbooth_32_bitPairRecoding_algorithm_tb.vhd
File metadata and controls
67 lines (49 loc) · 1.78 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
64
65
66
67
library IEEE;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
ENTITY booth_32_bitPairRecoding_algorithm_tb IS
END;
ARCHITECTURE booth_32_bitPairRecoding_algorithm_tb_arch of booth_32_bitPairRecoding_algorithm_tb IS
SIGNAL multiplier_tb : signed(31 downto 0);
SIGNAL multiplicand_tb : signed(31 downto 0);
SIGNAL out_product_tb : signed(63 downto 0);
SIGNAL multiplicand_dec_tb : integer;
SIGNAL multiplier_dec_tb : integer;
SIGNAL out_product_dec_tb : integer;
COMPONENT booth_32_bitPairRecoding_algorithm
PORT (
multiplier : IN signed(31 downto 0);
multiplicand : IN signed(31 downto 0);
out_product : OUT signed(63 downto 0);
multiplicand_dec : OUT integer;
multiplier_dec : OUT integer;
out_product_dec : OUT integer
);
END COMPONENT booth_32_bitPairRecoding_algorithm;
BEGIN
DUT1 : booth_32_bitPairRecoding_algorithm
PORT MAP (
multiplier => multiplier_tb,
multiplicand => multiplicand_tb,
out_product => out_product_tb,
multiplicand_dec => multiplicand_dec_tb,
multiplier_dec => multiplier_dec_tb,
out_product_dec => out_product_dec_tb
);
sim_process: process
begin
wait for 0 ns;
multiplier_tb <= b"0000_0000_0000_0000_0000_0000_0000_0000"; -- 0
multiplicand_tb <= b"0000_0000_0000_0000_0000_0000_0000_0000"; -- 0
wait for 20 ns;
multiplier_tb <= b"0000_0000_0000_0000_0000_0000_0000_1000"; -- 8
multiplicand_tb <= b"0000_0000_0000_0000_0000_0000_0000_0100"; -- 4
wait for 40 ns;
multiplier_tb <= b"0000_0000_0000_0000_0000_0000_0001_0100"; -- 20
multiplicand_tb <= b"0000_0000_0000_0000_0000_0000_0000_1000"; -- 8
wait for 60 ns;
multiplier_tb <= b"1111_1111_1111_1111_1111_1111_1111_1110"; -- -2
multiplicand_tb <= b"0000_0000_0000_0000_0000_0000_0000_0101"; -- 5
wait;
end process sim_process;
end;