What is the maximum decimal value that can be stored in 8 bits, unsigned?
Answer: C
Correct answer: 255
With \( n \) bits there are \( 2^{n} \) distinct patterns, so eight bits give 256 of them - but they represent the values 0 to 255, since one pattern is used for zero. Hence the maximum is \[ 2^{8} - 1 = 255. \] The off-by-one is the whole point of the question, and 256 is the classic wrong answer: it is the count of values, not the largest of them. That is unsigned. If the eight bits hold a signed value in 2’s complement, the range becomes −128 to +127 - which is where the other two distractors come from. The asymmetry arises because 2’s complement has a single representation of zero, leaving one more pattern for the negatives than for the positives. The pattern 11111111 is therefore 255 when read as unsigned and −1 when read as signed. Nothing in the bits themselves says which is meant; it is the instruction operating on them that decides.
Please log in or register to report this question.