Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How many bits are in a byte?

Bits byte
0
Posted

How many bits are in a byte?

0

Although it’s common that the number of bits in a byte is 8, this is not so for every system. That’s right, a byte is not always 8 bits. A byte is one of those terms which has an interesting history and ends up meaning different things to different people. For instance, there are some computers where it is 6, 7, 8, 9, 32-bits, and so on. In C (or C++) you can tell what it is for your system by looking at limits.h (known as climits in C++) where the macro CHAR_BIT is defined. It represents the “number of bits for the smallest object that is not a bit-field”, in other words, a byte. Note that it must be at least 8 (which mean that strictly speaking, a CPU that supports a 6 bit byte has a problem with C or C++). Also note that sizeof(char) is defined as 1 by C++ and C (ditto for the sizeof unsigned char, signed char, and their const and volatile permutations). It might be helpful to show a quote from Standard C: • byte: “addressable unit of data storage large enough to hold any member of

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.