wpe41.gif (23084 bytes)CIS3355: Business Data Structures
Fall, 2008
 

What is a byte, and why does it contain 8 bits?

The simple definition of a byte is that it is a grouping of 8-bits. It is also the basic grouping of bits that are transfered (together) from the CPU to RAM, RAM to secondary storage, etc. 

What does that mean??

We already know that the circuitry in a computer sets the microswitches to either an on (or '1' bit) or off (or '0' bit) position (See the tutorial on What does a BIT stand for? ), 

If we have one lightswitch, we know that we could represent 2 pieces of information (since 21 = 2).  For example, we could represent someone's gender (male or female):

↓  Male      Female

If we start adding more lightswitches, we can represent more information. As we saw in a previous tutorial on How many messages we could transmit for a given number of bits?,  we calculate the number of pieces of information we can represent as:

Number of Digits Value (number Messages) Exponential Representation
1 2 (0 .. 12) 21
2 4 (0 .. 112) 22
3 8 (0 .. 1112) 23
4 16 (0 ..11112) 24
5 32 (0 .. 111112) 25

If we have 8 lightswitches, we can represent 28 or 256 characters. These 'lightswitches' are grouped together and interpreted according to some agreed upon scheme (Generally, the ASCII coding scheme which we will discuss later). Any character, or symbol, can be represented using a unique pattern of 'on' switches (or '1' bits) and 'off' switches (or '0' bits).  If we have 8 lightswitches, we can represent 28 or 256 characters.

What do you mean by pattern of bits??

Using the previous notation of representing an on switch as 1 and an off switch as 0, let's look at some of the combinations available:

Bit Pattern (Possible) Bit Pattern Interpretation
0 0 0 0 0 0 0 0 The Character 'A'
0 0 0 0 0 0 0 1 The Character 'B'
0 0 0 0 0 0 1 0 The Character '+'
0 0 0 0 0 0 1 1 The Character '&'
0 0 0 0 0 0 0 0 The Character '$'
º º º º º º º º

As long as we agree that whenever we see the grouping (pattern) of bits

0 0 0 0 0 0 0 1

We will interpret it to represent the Character B,  we can communicate with each other.

Does the pattern 00000001 really represent the Character B??

NO -- we will discuss that later

But, why eight bits??

When early computer engineers were developing their machines, they considered all of the characters and symbols they wanted to represent (They really wanted to represent all possible symbols, but they were limited because RAM was very expensive).  They basically decided that they wanted to be able to represent about 100 characters.

Why about 100 characters??

We went over that in the How many bits do we need to group together and why?? tutorial.

At any rate, this meant that they needed 7 bits were needed to represent a character (since 27 = 128 characters.  This became the Standard ASCII Character set.

Once again, why eight bits??

Once again, early computers were prone to breakdowns and hardware failure. There had to be some way of determining if the pattern of bits set in the CPU was the same sequence of bits send to RAM for storage (and vice versa). The 8th bit was used to help detect transmission errors using a procedure called Parity (the 8th bit being the Parity Bit). (The use of Parity will be discussed in detail later)

Once the reliability of computers improved, parity checking became less necessary (today's transmissions have much more sophisticated techniques for detecting and correcting errors)That meant that all 8-bits could be utilized, meaning that we could represent 28 or 256 charactersThis became the Extended ASCII Character Set.

Why is it called a byte??

Basically, there had to be a term associated with this grouping. IBM was (by far) the dominating factor in computer design and architecture, and that was the term they came up.

A quick Aside: There is something called a 'nibble' which is half a byte (4-bits), but the concept is seldom applied.

 

Questions you should be able to answer after reading this tutorial:

1.   How many bits do we need to represent a character?

Answer: That depends on how many characters we wish to represent. For any given number of bits (n), we can represent 2n characters. So if we have 2 bits, we can represent 22 = 4 characters. If we have 9 bits, we can represent 29 = 512 characters.

2.   How many characters did the early computer engineers want to represent?

Answer:  Early computer architects decided they needed about 100 characters. Since 6 bits were too few (26 = 64), they decided on 7 bits (since 26 = 64),

3.   If the standard ASCII character set consists of 7 bits, why does a byte consist of 8 bits?

Answer: Early computers were prone to breakdowns and hardware failure. There had to be some way of determining if the pattern of bits set in the CPU was the same sequence of bits send to RAM for storage (and vice versa). The 8th bit was used to help detect transmission errors using a procedure called Parity (the 8th bit being the Parity Bit)

4.   How many characters are in the standard ASCII Character set?

      a.    64          d.   512
      b.  128          e.  None of the above
      c.  264

      Answer: b (Given 7-bits, there are 27 = 128 characters available)

5.   How many characters are available in the Extended ASCII character set?

      a.    64          d.   512
      b.  128          e.  None of the above
      c.  264

      Answer: e (Given 8-bits, there are 28 = 256 characters available)

Some Useful References on the topic:

How Bits and Bytes Work
Binary Information (Bits and Bytes)
Binary Number System (by A. Calleja)

This page was last updated on 01/07/05