Bits and bytes
A computer operates using binary digits, commonly known as bits. These bits hold only two possible values: 0 or 1, representing the states of on or off in electrical circuit terms. While bits are tiny and don’t have much use on their own except for indicating true/false (Boolean) flags, they become useful when we group them together into sets of 4, 8, 16, 32, or 64 to create data that computers can understand.
In computer terminology, a byte comprises 8 bits. An example of a byte with the value of 42 is depicted as follows, with the least significant bit positioned to the right and the most significant bit to the left:

Figure 16.1: The number 42 represented in bits
In Figure 16.1, the top row illustrates the state of each bit, whether it’s off (0) or on (1), within an 8-bit byte. The second row depicts the numerical value assigned to each bit within the byte. In this instance, the bits associated with the values 32, 8, and 2 are set, giving...