-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSA_tb.v
67 lines (51 loc) · 907 Bytes
/
CSA_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
module CSA_tb();
reg[15:0] a,b ;
wire [15:0]sum;
wire Cout;
CSA carryadder1(a,b,Cout,sum);
initial begin
$display("\t\ta\t\tb\t\tsum\t carry");
$monitor ("%b %b %b %b" ,a ,b ,sum , Cout);
//first case
a = 16'b1111000000000000;
b = 16'b0000000000000000;
//second case
#10
a = 16'b1111111100000000;
b = 16'b0000000000000000;
//third case
#10
a = 16'b1111000000000000;
b = 16'b0000000000000001;
//fourth case
#10
a = 16'b1111111100000000;
b = 16'b0000000000000001;
//fifth case
#10
a= 16'b0000000000000000;
b= 16'b0000000000000000;
//sixth case
#10
a= 16'b1111111111111111;
b= 16'b1111111111111111;
//seventh case
#10
a=16'b1111111111111111;
b=16'b1111111111111001;
//eighth case
#10
a=16'b0101010101100000;
b=16'b1111111101111111;
//ninth case
#10
a=16'b0000000000000000;
b=16'b1110010100111100;
//tenth case
#10
a=16'b1111000011110000;
b=16'b1111000011110000;
#10
$finish;
end
endmodule