Hi, in my project I have to design a subtractor. In this design i can only use these ones : AND Gate, XOR Gate, an Adder and a Circular Left Shifter. Like in the image below.
How can i design this with these givens (I don't have to use all of them) ?
Hi, as I mentioned above i need to design a subtractor. I designed ALU and a register block. But, I didn't create the Control Unit. My top module is like in the image below. I also add my RB and ALU codes if they're true can someone help me to write a CU code for verilog ?
The calculation processor must do is :
(When start is "1" CU starts calculating and during this busy out is "1").
------------------------------------------- ALU code(This may be wrong)
module ALU(
input [1:0] InsSel,
input [7:0] ALUinA,
input [7:0] ALUinB,
reg [7:0] ALUOut,
output CO,
output Z
);
always@(*) begin
case(InsSel)
2'b00 : begin ALUOut <= ALUinA & ALUinB; end
2'b01 : begin ALUOut <= ALUinA ^ ALUinB; end
2'b10 : begin ALUOut <= ALUinA + ALUinB; end
2'b11 : begin ALUOut <= ALUinA << ALUinB; end
default ALUOut = 8'b0;
endcase
end
endmodule
------------------------------------------------- RB code(this must be true)