ConceptStep · learning platform for computer science

Two's complement

Number systems · Lesson

← ConceptStep

Two's complement

Why it is needed

With 8 signed bits you can represent values from -128 to 127. For a negative number: write its positive magnitude on 8 bits, invert every bit and add 1.

Example

Positive magnitude: 00000101

Invert every bit: 11111010

Now add 1, always aligning the least significant bit on the right:

11111010+1=11111011

Therefore -5 = 11111011 in two's complement on 8 bit.

Practice with 8 bits

Progress: 0 / 5 — correct: 0

Represent 82 in 8-bit two's complement.

Non-negative value: write 82 in binary on 8 bits: 01010010.

Next: subtraction with two's complement →

Your competency map

What you need to know for Two's complement

ConceptStep separates what is required from what is recommended or useful as reinforcement. Only required prerequisites block your progress.

Current topic Strong skill Review due Needs reinforcement To be mastered Optional support

Relationships: solid line = required · dashed line = recommended · dotted line = reinforcement.

GUIDED LEARNING PATHS

Want to choose the next skill to develop?