Computers Blow - Lesson 1

Bits and Transistors

As you may or may not know, the basic unit of all modern electronic computers and all of the magic that you see on your fancy modern computer screen is the bit.

A bit is simply a single unit of information, really it is the smallest amount of information that humans or computers can consider. On or off, yes or no, true or false. Take it for granted that all the pretty on your screen comes from bits for now and let's just talk about these bits.

You've probably heard all sorts of talk about transistor counts in modern computer processors and all of that foolishness, so it should be pretty clear that transistors are important to modern computers.

In computers, the transistor acts as a small electronic switch. I'm going to avoid getting into the detailed physics of how it works and stick to how we use it. The transistor has three connections, Gate, Source and Drain, and when a voltage is applied to the Gate, current can flow from the Source to the Drain. With this simple device, we can represent a single bit of information. In the most basic case, when the transistor is on, it represents 1 or true, and when it's off, it represents 0 or false.

In computers, however, this simple transistor definition doesn't give us the information processing ability that we need, because the changing state of the transistor doesn't directly act on the next part of the circuit. Instead, the computer makes the following definition: High voltage is 1 or true and low or zero voltage is 0 or false.

Using this definition, we can use the transistor in a slightly different way to transform an input signal into a new output signal. The simplest case of this is to use the transistor to invert the input signal.

Here's how that would look:

            __ Output
          _|   Source
Input __||
Gate    ||_
           |
           |  Drain
          --- Ground (0/false)
           -  

In the diagram, the transistor is represented by the two parallel vertical lines. The Input, Output and Ground connections are clearly marked. Let's assume, for now, that the Output will be high voltage, 1 or true when the circuit is at rest (I'll touch more on this 'default' state shortly). With that assumption, when a low voltage, 0 or false is applied to the input, the Output remains in its default state of 1/true and the signal is inverted. Similarly, if we apply a 1/true to the Input, the transistor switches on and allows the default 1/true to connect to the powerful 0/false at the ground. This connection makes the output 0/false as well. We've successfully done our first simple computation by changing a 0 into a 1 and a 1 into a 0.

If you're curious about the default state of the output, here's how that works. A constant source of high voltage (1/true) is connected to the Output by a weak connection (high resistance). With this weak connection, as soon as the transistor switches on and makes a fairly strong (low resistance) connection to the Ground (0/false), the weak connection is overpowered and the default state is replaced with the correct new state. This is called a pull-up resistor, because it gently pulls the Output up when nothing else is connected. I will continue to omit this part of the circuit from the diagrams for simplicity.

You can proceed directly to Lesson 2 on Logic and Gates, or continue reading for the advanced topic on CMOS.

If you came into this with some knowledge of circuits and power, you may be asking "Doesn't that pull-up system result in a ton of wasted energy flowing through the processor?". Yes. It does. Well, it would if that simple circuit is how an inverter would be implemented in a modern processor. You may have heard the term CMOS thrown around and CMOS (Complementary Metal On Semiconductor) is how we eliminate that constant waste of energy.

Before we get into the specifics of this circuit, I must introduce another type of transistor. In the original circuit, we used what's called an "N" type transistor. This type of transistor is active when a high voltage is applied to its gate. There is also a transistor called the "P" type, which is active when a low/zero voltage is applied to its gate.

Here's a circuit that does the same thing, using CMOS:

          Vcc (1/true)
            _| Source
Gate    _o||
       |  ||_
       |     |   Drain
Input--|     |-- Output
       |    _|   Source
       |__||
Gate      ||_
             |
             |  Drain
            --- Ground (0/false)
             -  

The P type transistor in this diagram is indicated by the small circle at its gate, this symbolizes the fact that it is 0 active rather than the N type 1 active. For this CMOS inverter, we now have two transistors which are both connected to the same input, but only one of which will be active for any given input value. When the input is 0/false the top P type transistor is active, which conects a 1/true to the output. When the the input is 1/true the bottom N type transistor is active, which connects 0/false to the output. No more waste by always having the Output weakly connected to 1/true.

In the interests of keeping my diagrams simple, I will stick to using only N type circuits for future lessons, but for those who read this far, know that it is possible to create a matching P type circuit to turn any one of them into a CMOS design.


Course Index

Introduction
Lesson 1: Bits and Transistors (plus CMOS)
Lesson 2: Logic and Gates

Planned:
Lesson 3: Adding and Subtracting
Lesson 4: Memory
Lesson 5: Sequences
Lesson 6: A Calculator

Ideas:
The internet, protocols
Website types and languages
"You give me Governor Ventura, myself and eight more of my fellow Navy SEALS -- and we could paralyze the entire country of the United States of America" --Richard Marcinko
Google
 
© 2002-2008 Brandon Low 591 hits since April 21, 2007