Practice question · Select all that apply
An 8-bit register holds the pattern 11111111. Select every statement that is true.
Hints
- Convert the pattern under both interpretations before judging any option.
- 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.
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
- Order the steps of narrowing down a machine-level bug by binary search in time.
- Sort each debugging move by whether it reasons from evidence or merely guesses.
- A program is made to run on eight cores instead of one and gets four times faster, not eight. What sets the…
- Moore's law described transistor counts doubling roughly every two years, and single-core clock speeds…