Question:

Why can a byte have a maximum value of 127, as opposed to 255?

by  |  earlier

0 LIKES UnLike

A byte is 8 bits, which allows it to have a maximum value of 11111111, which in denary is 255. Can someone explain? Is it because the first value indicates positive or negative?

Thanks

 Tags:

   Report

3 ANSWERS


  1. Well, a byte can have 256 different states. This is either from 0 to 255 (an unisigned byte) or -127 to 127 (a signed byte). Either way, there are 255 states. This is true for all architectures that use an 8-bit byte ,which is nearly all of them, excluding some ancient ones.


  2. A byte representing an unsigned integer can store a value between 0 and 255. A byte represending a signed integer can store a value between -127 and 127.

    In short - yes

  3. its -128 to 127

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.