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

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).

PH
Answered by Pete H. Electronics tutor

16350 Views

See similar Electronics A Level tutors

Related Electronics A Level answers

All answers ▸

Explain the concept of bandwidth with regard to a real op-amp and how this differs from the ideal op-amp.


How do you apply Kirchhoff's current law?


What is the Ohm Law?


Can you explain what bitmasking is, and how it works and what it's used for?


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2026 by IXL Learning