This commit is contained in:
Ahmet Kaan GÜMÜŞ 2024-12-20 21:04:06 +03:00
parent cba979bf0f
commit b407d22c78
2 changed files with 63 additions and 0 deletions

29
06-alu/alu_tb.v Normal file
View file

@ -0,0 +1,29 @@
module alu_tb;
parameter N = 32;
reg [N-1:0] op_a;
reg [N-1:0] op_b;
reg [3:0] opcode;
wire [N-1:0] result;
initial begin
opcode = 3'd0;
op_a = 2;
op_b = 3;
#2 opcode = 4'd1;
#2 opcode = 4'd2;
#2 opcode = 4'd3;
#2 opcode = 4'd4;
#2 opcode = 4'd5;
#2 opcode = 4'd6;
#2 opcode = 4'd7;
#2 opcode = 4'd8;
#2 opcode = 4'd8;
end
ALU c1 (opcode, op_a, op_b, result);
initial
$monitor("Opcode = %h | Op A = %h | Op B = %h | Result = %h", opcode, op_a, op_b,result);
endmodule