-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_1bit_ALU.v
More file actions
80 lines (62 loc) · 1.12 KB
/
test_1bit_ALU.v
File metadata and controls
80 lines (62 loc) · 1.12 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
68
69
70
71
72
73
74
75
76
77
78
79
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Assignment 7
//
//Group No.42
//Members: Seemant Guruprasad Achari 19CS10055
// Chappidi Yoga Satwik 19CS30013
//
// This is the testbench for the 1-bit ALU
//
//////////////////////////////////////////////////////////////////////////////////
module test_1bit_ALU;
// Inputs
reg a;
reg b;
reg sh_result;
reg c_in_add;
reg c_in_comp;
reg [2:0] op;
// Outputs
wire result;
wire c_out_add;
wire c_out_comp;
// Instantiate the Unit Under Test (UUT)
One_Bit_ALU uut (
.result(result),
.c_out_add(c_out_add),
.c_out_comp(c_out_comp),
.a(a),
.b(b),
.sh_result(sh_result),
.c_in_add(c_in_add),
.c_in_comp(c_in_comp),
.op(op)
);
initial begin
// Initialize Inputs
a = 0;
b = 1;
sh_result = 1;
c_in_add = 0;
c_in_comp = 0;
op = 0;
// Wait 100 ns for global reset to finish
#100;
op = 1;
#100;
op = 2;
#100;
op = 3;
#100;
op = 4;
#100;
op = 5;
#100;
op = 6;
#100;
a = 1;
#100;
c_in_add = 1;
end
endmodule