Discussion
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.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development