Skip to content

Commit 62ca2c6

Browse files
committed
added manually abstracted model of 32 bit adder
1 parent 87f16ed commit 62ca2c6

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Manual_Abstraction/32_bit_adder.v

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module adder32(
2+
result,
3+
a, b
4+
);
5+
6+
input[31:0] a;
7+
input[31:0] b;
8+
output [31:0] result;
9+
wire [32:0] sum = {1'b0,a} + {1'b0,b};
10+
assign result = sum[32] ? sum[32:1]: sum[31:0];
11+
endmodule
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module adder32_abstracted(
2+
result,
3+
a, b
4+
);
5+
6+
input[15:0] a;
7+
input[15:0] b;
8+
output [15:0] result;
9+
wire [16:0] sum = {1'b0,a} + {1'b0,b};
10+
assign result = sum[16] ? sum[16:1]: sum[15:0];
11+
endmodule

0 commit comments

Comments
 (0)