CIS3355:
Business Data Structures |
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:
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:
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 characters. This 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?
2. How many characters did the early computer engineers want to represent?
3. If the standard ASCII character set consists of 7 bits, why does a byte consist of 8 bits?
4. How many characters are in the standard ASCII Character set?
a. 64 d.
512 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 Answer: e (Given 8-bits, there are 28 = 256 characters available) Some Useful References on the topic:
|