The simplest definition of a computer is a machine that manipulates data based on predefined instructions. A user inputs data, the computer processes data, the solution is then presented back to the user. In order for a digital processor to process data, logic gates are used. Logic gates preform a logical operation on one or more inputs and produces a logical single output.
If you have ever written a program or script, you may be more familiar with logic gates than you think. A common logic used in programming is to use ‘if then’ statements. An example you may do is if something=true and somethingelse=true then answer=true else answer=false. In this example, the two values ‘something’ and ‘somethingelse’ is passed to an ‘AND’ logic gate. The logic gate processes both inputs and determines whether or not the answer should be true.
When computers (digital processors) process code and instructions, they do not process the information using words like ‘if then else.’ Instead, they read the data as bits or electrical charges. Electrical current is fed to each of the inputs on the gate and the gate will either produce an electrical charge or will not do anything at its output. 1s are represented as a current while 0s represent as no current. 1s are ‘true,’ 0s are false.
AND Gate
As the name applies, the ‘AND’ gate produces a true only if both inputs are true. Else, the output is false.
| Input1 | Input2 | Output |
| False | False | False |
| False | True | False |
| True | False | False |
| True | True | True |
OR Gate
In an ‘OR’ gate, if any input is true, the output is also true.
| Input1 | Input2 | Output |
| False | False | False |
| False | True | True |
| True | False | True |
| True | True | True |
NOT Gate
I like to think of the ‘NOT’ gate as the inverse. Unlike the other gates, it only has one input. If the input is true, the output answer is false. If the input is false, the output answer is true. This gate is usually used in conjunction other gates in order to inverse their output.
| Input | Output |
| True | False |
| False | True |
NAND Gate
The ‘NAND’ (Not AND) gate is an ‘AND’ gate with a ‘NOT’ gate attached to its output. This produces the exact opposite of the ‘AND’ gate: the output is false only if both inputs are true.
| Input1 | Input2 | Output |
| False | False | True |
| False | True | True |
| True | False | True |
| True | True | False |
NOR Gate
Just like the ‘NAND’ gate, the ‘NOR’ (Not OR) gate is an ‘OR’ gate with a ‘NOT’ gate attached to its output. The output is true if both answers are false.
| Input1 | Input2 | Output |
| False | False | True |
| False | True | False |
| True | False | False |
| True | True | False |
EX-OR Gate
In the EX-OR (Exclusive-OR) gate, the output is true when either of the answers are true, but not both of them.
| Input1 | Input2 | Output |
| False | False | False |
| False | True | True |
| True | False | True |
| True | True | False |
EX-NOR Gate
Just like both the ‘NAND’ and ‘NOR’ gates, the EX-NOR (Exclusive Not OR) is an ‘EX-OR’ gate with a ‘NOT’ gate attached to its output. This produces inverted results of an ‘EX-OR’ gate.
| Input1 | Input2 | Output |
| False | False | True |
| False | True | False |
| True | False | False |
| True | True | True |
Resources:
http://www.google.com/search?hl=en&defl=en&q=define:computer&ei=tYPXS-TsGMT48AankMHWBQ&sa=X&oi=glossary_definition&ct=title&ved=0CAkQkAE
http://www.google.com/search?hl=en&defl=en&q=define:Logic+gates&ei=5YTXS6O6G4OC8gaytI3MBQ&sa=X&oi=glossary_definition&ct=title&ved=0CAkQkAE
http://www.explainthatstuff.com/logicgates.html
http://www.kpsec.freeuk.com/gates.htm#nand
Join the forum discussion on this post
