-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddertop_tb.v
73 lines (61 loc) · 1.11 KB
/
addertop_tb.v
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 26.08.2024 21:52:02
// Design Name:
// Module Name: addertop_tb
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module addertop_tb( );
reg CLK;
reg [7:0] A, B;
reg RESET;
wire [7:0] O;
addertop dut(O, A, B, CLK, RESET);
// Clock generation
initial begin
RESET = 1;
#10;
RESET = 0;
CLK = 1;
forever #5 CLK = ~CLK; // 10ns period
end
initial begin
A = 8'd0;
B = 8'd0;
#10;
A = 8'b0_010_0000; //0.25
B = 8'b0_010_0000; //0.25
#10;
A = 8'b0_010_0000; //0.25
B = 8'd0;
#10;
A = 8'd0;
B = 8'b0_010_0000;
#10;
A = 8'hE0; //-0.25
B = 8'hE0;// -0.25
#10;
A = 8'hE0; //-0.25
B = 8'h20; //0.25
#10;
A = 8'hA0; //-0.25
B = 8'hA0; //-0.25
#50 $finish;
end
initial begin
$monitor("At time %t: A = %d, B = %d, O = %d", $time, A, B, O);
end
endmodule