Add two signed numbers
examples below.
EX1: +7, +6 : Two negative numbers.
+7 +6
Step 1: Convert to 2's complement
for negative numbers.
+7 (in Binary 4’b0111)
+6 (in Binary 4’b0110).
Step 2
Add and store the result in sum register of 5 bits wide.
0 111
0 110
-
0 1 101
-
Step 3
Carry into signed bit but no carry out of signed bit. In this scenario keep MSB as sign and lower 4 bits represent sum.
Result: 5’b0 1101 = 0x0D = 13