module Adder5bit (OutC, InA, InB, nAdd_Sub);
output [4:0] OutC;
input [4:0] InA;
input [4:0] InB;
input nAdd_Sub;
reg [4:0] OutC;
parameter ALUDelay=15;
always @(InA or InB or nAdd_Sub)
begin
#ALUDelay
case (nAdd_Sub)
1'b0: //Add operation
OutC=InA+InB;
1'b1: //Subtract operation
OutC=InA-InB;
endcase
end
endmodule
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees