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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user