Skip to content
GK24
Computer AwarenessMedium

What is the largest unsigned decimal number that can be stored in one byte?

  1. A.127
  2. B.128
  3. C.255
  4. D.256

Correct answer

C. 255

Explanation

The correct answer is C, 255. One byte holds eight bits, and each bit can be either 0 or 1, so the number of different patterns is 2 raised to the power 8, that is 256. Those 256 patterns represent the numbers from 0 to 255 when the byte is unsigned, because counting starts at zero. The largest pattern, 11111111, adds up to 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, which equals 255. Option A is wrong because 127 is the largest positive value of a signed byte, where the leftmost bit is kept as the sign bit and only seven bits remain for the value. Option B is wrong because 128 is the place value of the leftmost bit alone. Option D is wrong because 256 is the count of patterns, not the largest value, a distinction examiners test often.

Read the full article: Number Systems and Data Representation in Computers

View all