Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How many bytes would be needed to store 8 possible values?

My phone has 8 possible values (0-7), how many bytes is needed to store this entity?

1 Answer

Relevance
  • 8 years ago
    Favorite Answer

    I'm not sure if this is what you are asking (some extra detail and an example or two might help with that) but 3 bits are enough to represent a single value ranging from 0 to 7. 8 such values would take 3*8 = 24 bits, and there are 8 bits per byte in most every modern system, so that's 24/8 = 3 bytes will be enough.

    Most applications would use either 8 bits per value (8 bytes total) for ease of programming and for runtime speed, or 4 bits per value (4 bytes total) if library routines for BCD conversion and formatting were available.

Still have questions? Get your answers by asking now.