-
Notifications
You must be signed in to change notification settings - Fork 6
/
four_to_one_mux_test.v
59 lines (49 loc) · 1021 Bytes
/
four_to_one_mux_test.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
`timescale 1ns / 1ps
// GroupID-73(15116003_15116066) - Abhimanyu Bambhaniya & Utkarsh Gupta
// Date: October 27, 2016
module four_to_one_mux_test;
// Inputs
reg [1:0] opcode;
reg [7:0] add_answer;
reg [15:0] mul_answer;
reg [7:0] and_answer;
reg [7:0] xor_answer;
// Outputs
wire [15:0] final_answer;
// Instantiate the Unit Under Test (UUT)
four_to_one_mux uut (
.opcode(opcode),
.add_answer(add_answer),
.mul_answer(mul_answer),
.and_answer(and_answer),
.xor_answer(xor_answer),
.final_answer(final_answer)
);
initial begin
// Initialize Inputs
opcode = 00;
add_answer = 10;
mul_answer = 11;
and_answer = 12;
xor_answer = 13;
#100;
opcode = 01;
add_answer = 10;
mul_answer = 11;
and_answer = 12;
xor_answer = 13;
#100;
opcode = 10;
add_answer = 10;
mul_answer = 11;
and_answer = 12;
xor_answer = 13;
#100;
opcode = 11;
add_answer = 10;
mul_answer = 11;
and_answer = 12;
xor_answer = 13;
#100;
end
endmodule