Question: How would i go about adding decimal numbers 23 and -23 in 16 bit signed (twos compliment) hex format. 23 (base 10) = 0x0017 -23

How would i go about adding decimal numbers 23 and -23 in 16 bit signed (twos compliment) hex format.

23 (base 10) = 0x0017

-23 (base 10) = 0xFFE9

So:

0x0017 + 0xFFE9

7+9 = 16 (carry a 1, leave a 1)

1+1+14 = 16 (carry a 1, leave a 1)

1+0+15 = 16 (carry a 1, leave a 1)

1+0+15 = 16 (carry a 1, leave a 1)

So the result would be:

0x1111, with a (1) as a overflow bit

and this would represent 1*(16^3) + 1*(16^2)+1*(16^1)+1*(16^0) = 4369 (base 10)

Is this the correct way to approach this problem? It seems like the addition is incorrect it should be 0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!