Binary Basics and Bandwidth

Bipolar Devices

Digital computers are constructed from very tiny transistors and capacitors and other electronic components. These are bipolar devices - they are either on or off, not halfway or a little bit or mostly, but simply on or off. Other bipolar devices include light switches, lamps, on/off power switches, LEDs (light emitting diodes).

Data is stored in the transistors and capacitors as electrical charges. A transistor is either conducting a charge or not conducting - the capacitor is either charged or empty. This is similar to a light bulb, which is either on or off.

Binary Numbers

Imagine a massive computer monitoring all the lights in a large city - millions of lights. The computer is going to control a power plant. As soon as the number of lights which are on exceeds 2 million, the computer signals the power plant to start another generator to provide more electricity. At 3 million another generator goes into action. The state of each light in the city could be stored in a single transistor. Then the computer can constantly scan its memory - all the transistors - counting to see how many transistors are on at any one time. It would need to contain several million transistors - no problem for a modern PC.

Imagine a different computer which doesn't simply count the lights, but measures the power consumption (Watts) of each light bulb. For example, a 100 Watt bulb in the kitchen is consuming more energy than a 25 Watt bulb next to a bed. Adding up all the Watts gives a much better measure of the total energy requirements of the city. But how can the numbers 100, 25, etc. be stored in the computer's memory?

One possibility is to turn on a single bit (transistor) for each Watt. Then if there are 2 million lights on, with an average of 60 Watts per light, the computer would need to contain 120 million transistors, and if more lights go on it would need even more. This system is called unary:

1111111111 --> 10 watts
1111111111111111111111111 --> 25 Watts

A better system is called binary. The bits are grouped together - 8 bits grouped together is called a byte. To make it easier to write down the bits, we use a 1 to represent a bit which is set (on), and 0 for a bit which is clear (off). Then a byte could look like this:

11110000

In unary, this looks like it represents 4 Watts. But in binary, the first 1 counts for 128 Watts, the next 1 counts 64, the next counts 32, and the next counts 16. So this represents 240 Watts (a very bright light bulb).

Using binary requires fewer transistors than unary. To represent all the Watts of 2 milliion light bulbs, the computer only needs 2 million bytes - one byte for each bulb (assuming that no bulbs use more than 255 Watts). That is only 16 million transistors, instead of 120 million.

The use of binary to store numbers was one of the original ideas which made computers practical l for calculations. Back in 1950, when the very first digital computers were being built, computers contained vacuum tubes instead of transistors. Tubes are expensive, use a lot of electricity, create a lot of heat, and burn out quickly (perhaps 100 hours). Early computers contained no more than a few thousand tubes (one tube for each bit), so saving bits was very important back then. These original computers were use only for calculations - they contained less memory and could do much less than a pocket calculator today.

In modern PCs, a byte can store any number between 0 and 255:

00000000 binary = 0 decimal
00001101 binary = 8 + 4 + 1 = 13 decimal
10101010 binary = 128 + 32 + 8 + 2 = 170 decimal
11111111 binary = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 decimal

In a 16-bit computer, 16 bits are grouped together to form a word, which can store any number between 0 and 65535:

1111111111111111 binary
     =32768+16384+8192+4096+2048+1024+512+256+128+64+32+16+8+4+2+1=

     = 65535 decimal

In a 32-bit computer, 32 bits are grouped together to form a double-word, which can store any number between 0 and 4294967295, which can be calculated more simply:

32 binary bits = 2^32 - 1 = 4294967295 decimal

In the next couple years, 64-bit computers will support quad-words, which can represent any number between 0 and 2^64-1.

More complex coding systems allow all computers to represent much larger numbers, but bytes and words are the simplest packages for storing and transmitting data.

Representing Other Data

In a digital computer, everything is represented by bits. If a pixel on the screen is glowing white, it is because there is a bit (or byte) in the memory which is on. If you see the letter A, it is because a byte in the memory contains 01000001. This is the ASCII code for the letter A.

Anything stored in a computer follows a coding system to decide which bits represent what. Here are coding systems for several different kinds of data:

4-bit Colors

ASCII Character Codes

Dates in BCD
(Binary Coded Decimal)

0000 = Black

01000001 bin = A = 65 dec

0001 0010 0000 0011 1001 1000
=12.03.98

0001 = Blue

01000010 bin = B = 66 dec

 

0010 = Green

01000011 bin = C = 67 dec

Music

0011 = Aqua

01100001 bin = a = 97 dec

00000001 1011100 = Middle A

0100 = Red

01111010 bin = z = 122 dec

 

0101 = Purple

11100001 bin = ß = 225 dec

Fractions

0110 = Orange

00001100 bin = form feed

0001100110011001100.... = 1/10

0111 = Grey

00100000 bin = blank space

 



Early computers (the 1950s) were used only for calculations. So traditionally, everything inside computers is still based on numbers. Colors are numbers, shapes are numbers, music is numbers, letters are numbers, etc. This won't change in the near future, either.

Standard Code Systems

Back around 1960, there were not very many computers in the world, but it was obvious that moving data from one computer to another would be a good thing. Unfortunately, there was no standard system for storing data in computers. Some computers used 65 to represent A, but others used the code 33 for A, and others used other numbers. If a data file containing names were copied from one computer to another, the second computer could not properly display the names. The numbers would be the same in both computers, but the interpretation (decoding) would be different.

A bunch of American engineers got together and agreed on the 7-bit ASCII system of codes - the American Standard Code for Information Interchange. They used the numbers from 0 to 127 (1111111 bin) to represent capital and small letters, digits, punctuation marks, and printer control codes. The system became popular - not because it was particularly good, but simply because it was standard. This standard became almost universal, until the 1980s, when word-processors brought the desire for a variety of fonts. The massive variety of fonts meant that no standard set of codes would cover all the needs. Now we have many different codes for different letters in different font sets, and everything is a mess again. Fortunately, the "normal" letters and characters do stick to the ASCII standard. But "foreign" letters like ü, é, â, etc don't have standard codes. A new standard is emerging - Unicode. Unicode will use 16 bits for each character, and represent 65536 (2^16) different symbols, including Persian, Russian, Hebrew, Chinese (Kanji), American, etc. However, the change to Unicode is quite slow to get started, because there is lots and lots of software around which does not support it.

Transmitting Data

Once data has been digitized (turned into binary numbers), it is fairly easy to transmit and store copies of the data. The Internet is a massive system of computers connected by telephone lines which allows data to be transmitted from one computer to another. Thanks to standard codes like ASCII, the data can be used in many different computers.

A modem is used to connect a computer to a telephone line. It converts the digital data (bits) from the computer into analog signals (sounds waves) which can be transmitted over existing telephone lines. At the other end, another modem converts the sounds back into bits for the other computer to receive.

The telephone lines were never designed to carry computer data - they were designed in the early 1900's to carry people's voices, and later improved so they could even carry music (badly). The bandwidth of POTS (Plain Old Telephone Service) is very low, so modems can only manage to transmit about 56000 bits per second - this is the maximum speed, which can only be used when there is no interference from radio waves, lightning, etc.

POTS wires are slowly being replaced by fiber optic cables which contain thousands of tiny strands of glass. Each glass strand already has a higher bandwidth than a normal telephone line, and the glass fibers are much thinner than telephone wires, and require a lot less power to carry the light signal from one end to the other. By bundling many thousands of fibers in a single cable, the bandwidth of a single cable can be thousands of times greater than a POTS line.

One very clever idea to improve bandwidth is the use of cable modems. These modems attach to TV cables to receive data. TV cable has a much higher bandwidth than a telephone (several million bits per second) and TV cable already exists, unlike optical fiber. But you cannot transmit back across the TV cable. So your computer would use a normal telephone connection to send its requests to a web-site, but then download the data through the cable modem. This assymetric arrangement is very sensible, as there is normally a lot more data coming from the Web-site to your PC than in the other direction.

Local Bandwidth - Inside your PC

Inside your PC there are lots of components - hard-disk, floppy disk, graphics card, microprocessor, RAM, sound-card, CD-ROM, etc. The computer spends a lot of time transmitting data from one component to another. This is not instantaneous. Many of the specifications you read in a computer advertisement are measures of transmission speed. One way to speed up a computer is by increasing band-width.

The major pathway for moving data in a computer is the data bus. This is a group of circuits on the motherboard which carry electrical signals from one component to another. Most modern PCs have at least a 32-bit data bus, and many contain a 64-bit bus. A 32-bit data-bus can transmit 4 bytes (4x8 bits) at once. If the board is running at 66 MegaHertz, then it can change the signals 66 million times per second. This means it can transmit a total of 32 bits x 66 million = 2 Giga (billion) bits per second (Gbps). Divide it by 8 to get 250 million bytes per second (250 MB/sec). This is the bandwidth of the data bus. If the manufacturer spends more money and redesigns the board, they can double the size of the data-bus to 64 bits, which doubles the bandwidth. But this is more expensive, and only makes sense if the disk-drives, graphics cards, and microprocessors can be attached to a 64-bit bus.

The other obvious way to increase bandwidth is to increase the frequency - e.g. run the board at 100 MegaHertz instead of 66 MHz. This is certainly possible, and is actually not a big problem for the motherboard. Again, it only makes sense if the components also run at a faster speed.

A typical Pentium chip runs at 266 MHz. This means it runs 4 times faster than the 66 MHz motherboard. So it can certainly keep up with the increased speed. However, the design assumes that the Pentium chip will be running at a specific multiple of the bus speed (clock-quadrupled). If the bus speeds up to 100 MHz, this expected relationship will be changed, which may cause unpredictable behaviour.

What about simply speeding up the Pentium chip? To maintain the 4-to-1 speed ration, we would speed up the Pentium chip to 400 MHz. But the transistors might not be able to switch from 1 to 0 at that speed. This is a similar problem to switching a light on and off - you might be able to do it 2 or 3 times per second, but you won't be able to do it 50% faster. So the chip will make errors in its calculations.

Hardware engineers work hard to find ways to design faster transistors and other circuit elements. Unfortunately, even if they get the transistors to switch at faster speeds, the increased activity causes more heat to be produced. Excess heat must be removed immediately - otherwise, the chip will expand and shrink too much and the tiny circuits in the chip will crack and stop working. To avoid excessive heat and still increase frequency, new chips use lower voltages (2.5 Volts instead of 3.3 Volts) and even smaller circuits (0.25 microns) which carry less current and thus produce less heat. But etching smaller circuits requires higher precision in the production process, which requires better, more expensive equipment. And lowering voltages requires the circuitry to perform more accurately, which also requires more precise and careful production techniques. Even if it is possible to create a 500 MHz Pentium, it might be so expensive that noone will buy it. A 333 MHz Pentium chip already costs 1500 DM (that's just the chip, without the computer).