Perform the 8-bit two's complement binary sum 17 - 24

  • Google+ icon
  • LinkedIn icon
  • 3251 views

The first step is to view the sum as an addition of a positive and a negative number, rather than a subtraction:

17 + (-24)

 

From there we can work out the binary equivalents of the 2 numbers:

          b7   b6   b6   b4   b3   b2   b1   b0

17      0     0     0     1     0     0     0     1

24      0     0     0     1     1     0     0     0

 

24 then has to be converted into it's equivalent negative number in two's complement. This is done in 2 steps:

1. Flip all the bits in the number

2. Peform binary addition of new number and 1.

 

So first we flip all the bits:

b7   b6   b6   b4   b3   b2   b1   b0

1     1     1     0     0     1     1     1

 

Then we add 1:

b7   b6   b6   b4   b3   b2   b1   b0

1     1     1     0     0     1     1     1

0     0     0     0     0     0     0     1

1     1     1     0     1     0     0     0

This gives us the two's complement representation of -24.

 

Then we simply perform the additon of 17 and -24 in binary:

b7   b6   b6   b4   b3   b2   b1   b0

0     0     0     1     0     0     0     1

1     1     1     0     1     0     0     0

1     1     1     1     1     0     0     1

 

Which, as expected, is the binary representation of -7 (you can check this by performing the same 2 stage method to convert the number back to positive 7, then back into decimal from there).

Pete H. A Level Maths tutor, A Level Electronics tutor, GCSE Maths tu...

About the author

is an online A Level Electronics tutor with MyTutor studying at Southampton University

Still stuck? Get one-to-one help from a personally interviewed subject specialist.

95% of our customers rate us

Browse tutors

We use cookies to improve your site experience. By continuing to use this website, we'll assume that you're OK with this. Dismiss

mtw:mercury1:status:ok