Added Two's Compliment module
This commit is contained in:
@@ -423,4 +423,22 @@ module register(input wire clk, reset,
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
||||
module twos_compliment_9bit(
|
||||
input wire [8:0] A,
|
||||
output wire [8:0] C);
|
||||
|
||||
wire [8:0] B;
|
||||
|
||||
not_9bit not0(
|
||||
.A(A),
|
||||
.B(B));
|
||||
|
||||
adder_9bit adder0(
|
||||
.A(B),
|
||||
.B(9'b000000000),
|
||||
.Cin(1'b1),
|
||||
.Sum(C));
|
||||
|
||||
endmodule
|
||||
Reference in New Issue
Block a user