Make your own free website on Tripod.com
 Search: Lycos Tripod      Gear Factor
share this page Share This Page  report abuse Report Abuse  build a page Edit your Site  show site directory Browse Sites  hosted by tripod
    Previous | Top 100 | Next hosted by tripod

Chapter 1 - Logic Gates

Digital electronics is the sort of electronics that is used in computers and similar pieces of equipment, such as mobile phones, that does complicated processing on information. It is different from the sort of electronics that one gets in old radios or the old-style telephones or televisions, which is often called analogue electronics.

Digital vs. Analogue

The term digital refers to the fact that the signal is limited to only a few possible values. In general, digits signals are represented by only two possible voltages on a wire - 0 volts (which we called "binary 0", or just "0") and 5 volts (which we call "binary 1", or just "1"). We sometimes call these values "high" and "low", or "true" and "false".
The analogy that is often used is that of a light switch. It can be in just two positions - "on" or "off"

More complicated signals can be constructed from 1s and 0s by stringing them end-to-end, like a necklace. If we put three binary digits end-to-end, we have eight possible combinations: 000, 001, 010, 011, 100, 101, 110 and 111. In principle, there is no limit to how many binary digits we can use in a signal, so signals can be as complicated as you like. The diagram below shows a typical digital signal, firstly represented as a series of voltage levels that change as time goes on, and then as a series of 1s and 0s.

Analogue electronics uses voltages that can be any value (within limits, of course - it's difficult to imagine a radio with voltages of a million volts!) The votlages often change smoothly from one value to the next, like gradually turning a light dimmer switch up or down. The diagram below shows an analogue signal that changes with time.

Devices exist which convert from analogue signals to digital signals and vice-versa. Although most signals that we can perceive in the real world are analogue (sound levels in speech, light levels in vision etc.) more and more signals are being stored in digital format (audio CDs, DVDs, digital audio cassettes etc.) because of one major advantages it offers: Digital signals are potentially immortal!

The problem with all signals is that they acquire noise - that horrible crackling that seems to appear from nowhere - as they get older. Noise isn't just something that you can hear - the fuzz that appears on old video recordings also qualifies as noise. In general, noise is any unwanted change to a signal that tends to corrupt it. The diagram below shows the digital and analogue signals that you have seen with added noise:

      

Digital signals can easily be recognised even among all that noise. They can be put through an electronic device that "cleans them up" and restores the original digital signal in perfect condition. It takes a great deal of noise to be added to a digital signal for a 0 to be mistaken for a 1 or vice-versa!

Although it is possible for an analogue signal to be cleaned up to a certain extent, you can never get back a perfect copy of the original signal. Because of this, analogue signals inevitably build up noise as they get older, and this is the reason that old records sound scratchy and that old video recordings are unwatchable.

One example that is often quoted in the war between analogue and digital is the cleaning of the Sistine Chapel in Venice. During the 1980s the famous painting by Michaelangelo on the ceiling of the Sistine Chapel was cleaned and centuries of grime was removed. However, the restorers could not be certain that they were putting the colours back to exactly what Michaelangelo had intended. If the ceiling had been copied into the form of a digital signal in the early sixteenth century when it was created, the restorers would have known exactly what the original colours should have been.

The AND Gate

There are about half a dozen different types of basic components (called logic gates) used in digital electronics and the first one that you will meet is the AND gate. The symbol for the AND gate is shown in the diagram.

The AND gate doesn't look like this in real life, of course. Computer chips contain millions of AND gates (as well as millions of the other types), all squeezed on to a tiny silicon chip. However, we usually draw AND gates using the symbol shown. Sometimes you may see a & symbol written inside the half-moon shape.

The AND gate has two inputs, the lines on the left, and one output, the line on the right. If both the inputs are 1 ("high"), then the output of the AND gate is also 1. Otherwise it is 0 ("low"). We summarise this in a table, called a truthtable:

Input A
Input B
Output
0
0
0
0
1
0
1
0
0
1
1
1

You can see from the truthtable that the output is only 1 when both A and B are 1.

Of course, there is nothing to stop you using the output of the AND gate as an input to another gate. Since we have only met the AND gate so far, we had better make it an AND gate:

Input A
Input B
X
Input C
Output
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
1
1
1
0
0
0
0
0
1
0
0
1
0
1
0
1
0
0
1
0
1
1
1
1
1

I have included a column that shows what X is, although, since X is neither a true input nor a true output, we would probably not include it in the truthtable:

Input A
Input B
Input C
Output
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
0
1
1
1
1

Note that the order of the rows has been changed so that the inputs A, B and C are quoted in a logical order, going from 000 to 111. This is the usual order in which the rows are quoted. Does it remind you of anything?

Effectively, the circuit shown above only produces a 1 if all three of the inputs is 1. It is equivalent to an AND gate with three inputs.

The OR Gate

This is similar to the AND gate except that the output goes to 1 if either or both of the inputs is/are 1, i.e. as long as at least one input is high:

Input A
Input B
Output
0
0
0
0
1
1
1
0
1
1
1
1

Note that the symbol for an OR gate is similar to that for an AND gate except that it has a curved line where the AND gate had a straight line. You can see from the truthtable that the OR gate is a lot less "fussy" than the AND gate - it only produces a 0 if neither input is 1. Below you will see the same circuit that you saw above except with one of the gates replaced by an OR gate:

You don't have to work out all the lines from scratch. Here is the easy way of calculating the output values:

Input C feeds the OR gate directly. This means that whenever C is 1, the output of the whole circuit is 1, whatever the values of A and B are:

Input A
Input B
Input C
Output
0
0
0
 
0
0
1
1
0
1
0
 
0
1
1
1
1
0
0
 
1
0
1
1
1
1
0
 
1
1
1
1

When input C is 0, then output of the circuit depends on the output from the AND gate - if, and only if, it is 1, then the final output will be 1. The AND gate produces 1 only if both A and B are 1:

Input A
Input B
Input C
Output
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
1
1
0
0
0
1
0
1
1
1
1
0
1
1
1
1
1

Compare this truthtable to that produced by the version of this circuit that had two AND gates in it. What a difference changing one gate makes! The output now has more 1s in it than 0s!

The Inverter (NOT gate)

This is a simple gate, with only one input and only one output. Its output is always the opposite of the input, i.e. if the input is 0, the output is not 0 (i.e. 1). If the input is 1, the output is not 1 (i.e. 0).

What, you want a truthtable? Oh, all right then ...

Input
Output
0
1
1
0

Let's try adding the inverter to some other gates to make some more complicated circuits. The following two circuits combine an AND and an OR gate with some inverters. I have produced a truthtable for each of the two circuits. Check all four combinations of each circuit in turn to make sure you know why each one produces the output that it does.

Input A
Input B
Output
0
0
0
0
1
1
1
0
0
1
1
0

Input A
Input B
Output
0
0
0
0
1
1
1
0
0
1
1
0

You will notice, in fact, that the two circuits produce exactly the same truthtable. We say that the two circuits are equivalent.

Two circuits are equivalent if each produces an identical output to the other for every possible combination of inputs.

To see if two circuits are identical, work out their truthtables for all possible values of the input. If they are identical, then the two circuits are equivalent.

So what do these things really look like?

If you take the cover off a computer, or any other piece of digital electronics such as a DVD player, you will find that it contains flat circuit boards with integrated circuits fixed to it. These integrated circuits are the "silicon chips" that you hear about, and they look like small black plastic rectangles with metal legs sticking out like some sort of insect.

The silicon chip itself is embedded inside the plastic and is about the size of a fingernail. In complicated integrated circuits used in computers, each of the silicon chips may contain hundreds or thousands of logic gates, each "etched" with chemicals onto the silicon. You can, however, buy integrated circuits that only contain a few logic gates, typically four or five.


Go back
Questions
Go on