Added SLT

There is a testbench but when I try to run it on my computer it brings up some regFile simulation even though SLT is set to top. Not sure if its my pc or the code
This commit is contained in:
Johannes
2019-03-12 19:49:46 -04:00
parent 4a462752e9
commit 3f01492398
19 changed files with 306 additions and 61 deletions

View File

@@ -884,6 +884,52 @@ module shift_right_arithmetic_tb();
end
endmodule
module slt (
input wire en,
input wire [8:0] inA, inB,
output reg outA);
always @(inA, inB)begin
if (inA < inB) begin
outA = 1;
end
else begin
outA = 0;
end
end
endmodule
//testbench
module slt_tb();
reg enable;
reg [8:0] indexA;
reg [8:0] indexB;
wire outputA;
slt slt0(
.en(enable),
.inA(indexA),
.inB(indexB),
.outA(outputA));
initial begin
enable = 0;
#5
enable = 1;
#5
indexA = 9'b000000000;
indexB = 9'b000000000;
#10
indexA = 9'b000000000;
indexB = 9'b111100000;
#10
indexA = 9'b000001111;
indexB = 9'b000000000;
#10
$finish;
end
endmodule
module sub_9bit(
input wire [8:0] A,
input wire [8:0] B,