Digital Logic Primer

Introduction

All digital computers are built with the basic components shown on this page. All other circuits, including the Xor Gate shown below, can be constructed with Inverter Gates, Or Gates, and And Gates.

What makes computers so complicated is that they are composed of millions of these basic gates, interconnected in very intricate ways.

When you have finished studying these concepts, you can cement your comprehension with a companion page, Digital Logic Primer Exam, an on-line, interactive test of this material.

Contents

Definitions

As you study this page, here are some things to consider:

You are invited to experiment with the switches on this page. Clicking them will change their state -- that is, from a "Down / 0" to a "Up / 1", and vise versa. Then watch what happens to the LED's in the same box.

The circuits below are the most basic found in a Binary Digital Computer. .
Basic Circuits
NameSchematic SymbolTruth TableDescription
Switch and LED
SwitchLED
Down / 0Dark / 0
Up / 1Lit / 1
The most basic of all circuits. The switch on the left will turn the LED (Light Emitting Diode) on the right on. Click it and see.
Inverter Gate
SwitchLED
0Lit / 1
1Dark / 0
The most basic gate. It changes its input from a "1" to a "0", and vise versa.
And Gate
SwitchesLED
00Dark / 0
01Dark / 0
10Dark / 0
11Lit / 1
This gate will output a "1" only if both its inputs are a "1"
Or Gate
SwitchesLED
00Dark / 0
01Lit / 1
10Lit / 1
11Lit / 1
The output of this gate is a "1" if either of its inputs is a "1"

The circuits below are built out of the Basic Circuits shown above. . .
Combinational Gates
NameSchematic SymbolTruth TableDescription
Xor Gate
SwitchesLED
00Dark / 0
01Lit / 1
10Lit / 1
11Dark / 0
Xor is short for Exclusive Or. This gate can be implemented with Inverter Gates, And Gates, and Or Gates (See below). The output of this gate is a "1" only if one of its inputs is a "1"
Xor Circuit
Nand Gate
SwitchesLED
00Lit / 1
01Lit / 1
10Lit / 1
11Dark / 0
Nand is ahort for Negative And. This gate combines an And Gate with its output connected through an Inverter Gate in one device. It will output a "0" only if both its inputs are a "1"
Nor Gate
SwitchesLED
00Lit / 1
01Dark / 0
10Dark / 0
11Dark / 0
Nor is short for Negative Or. This gate combines an Or Gate with its output connected through an Inverter Gate in one device. It will output a "0" if either its inputs are a "1"
Xnor Gate
SwitchesLED
00Lit / 1
01Dark / 0
10Dark / 0
11Lit / 1
Xnor is short for Exclusive Nor. This gate combines an Xor Gate with its output connected through an Inverter Gate in one device. The output of this gate is a "0" only if one of its inputs is a "1"

The circuits below are built out of the Basic Circuits shown above. . . .
Triple Input Gates
NameSchematic SymbolTruth TableDescription
3-Input And Gate
SwitchesLED
000Dark / 0
001Dark / 0
010Dark / 0
011Dark / 0
100Dark / 0
101Dark / 0
110Dark / 0
111Lit / 1
This gate will output a "1" only if all of its inputs are a "1"
3-Input Or Gate
SwitchesLED
000Dark / 0
001Lit / 1
010Lit / 1
011Lit / 1
100Lit / 1
101Lit / 1
110Lit / 1
111Lit / 1
This gate will output a "1" if any of its inputs are a "1"
3-Input Xor Gate
SwitchesLED
000Dark / 0
001Lit / 1
010Lit / 1
011Dark / 0
100Lit / 1
101Dark / 0
110Dark / 0
111Lit / 1
Xor is short for Exclusive Or. This gate will output a "1" if only one or all of its inputs are a "1"

The circuits below are built out of the Tripple Input Gates shown above. . . .
Negative Triple Input Gates
NameSchematic SymbolTruth TableDescription
3-Input Nand Gate
SwitchesLED
000Lit / 1
001Lit / 1
010Lit / 1
011Lit / 1
100Lit / 1
101Lit / 1
110Lit / 1
111Dark / 0
This gate will output a "0" only if all of its inputs are a "1"
3-Input Nor Gate
SwitchesLED
000Lit / 1
001Dark / 0
010Dark / 0
011Dark / 0
100Dark / 0
101Dark / 0
110Dark / 0
111Dark / 0
This gate will output a "0" if any of its inputs are a "1"
3-Input Xnor Gate
SwitchesLED
000Lit / 1
001Dark / 0
010Dark / 0
011Lit / 1
100Dark / 0
101Lit / 1
110Lit / 1
111Dark / 0
Xnor is short for Exclusive Nor. This gate will output a "0" if only one or all of its inputs are a "1"

Examination Link

Now that you have familiarized yourself with these concepts, you can cement your comprehension with a companion page, Digital Logic Primer Exam, an on-line, interactive test of this material.

More Detail Link

Here is a link to a much more thorough treatment of logic gates and other more complex devices: http://www.play-hookey.com/digital/

Credits

These gates, plus many other devices, are part of a software package called Multimedia Logic, a free program which simulates digital logic circuits. It will run under Microsoft Windows '95 and up.



Visitor #
This primer has been written and distributed by

James Larson
Programmer/Analyst Consultant
http://www.dst-corp.com/james
E-mail address
In God We Trust...