Computer Science I / Machine-Level Debugging Logic
Practice question · Select all that apply

An 8-bit register holds the pattern 11111111. Select every statement that is true.

Hints
  1. Convert the pattern under both interpretations before judging any option.
  2. For the signed reading, invert the bits and add 1; then compare the two numbers.
Show the answer
  • A. Read as two's-complement signed, its value is -1
  • C. The unsigned and signed readings differ by 256
  • D. Adding 1 to it as an 8-bit unsigned value gives 0
  • E. Read as unsigned, its value is 255
Why

11111111 is 255 unsigned; inverting gives 00000000, plus 1 is 1, so signed it is -1, and 255 minus -1 is 256, the size of the range. Adding 1 unsigned overflows to 0. Option 3 is the trap: 127 is the largest positive 8-bit signed value, not the reading of this pattern.

Read the lesson: Machine-Level Debugging Logic →

Practise Machine-Level Debugging Logic

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 Machine-Level Debugging Logic