Computer Science I / Arithmetic at Machine Level
Practice question · Multiple choice

An 8-bit signed integer holds −128 to +127, one more negative value than positive. Where does the asymmetry come from?

Hints
  1. Count the patterns: 256 total. How many are spent on zero?
  2. Sign-magnitude has +0 and −0. Ask what two's complement does with the freed pattern.
Show the answer

D. From two's complement having only one zero, leaving one spare negative

Why

256 patterns, one zero, and the spare goes to the negatives. Sign-magnitude wastes a pattern on −0 and gets a symmetric range; two's complement spends it on −128 instead. The consequence is real: negating −128 overflows, which is a genuine edge case in production code.

Read the lesson: Arithmetic at Machine Level →

Practise Arithmetic at Machine Level

The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Arithmetic at Machine Level