Tuesday, 16 November 2010

Logic Gates

Logic gates are used within the digital circuits in computers, and conventional electrical circuits for many uses.  Millions of them will be in a processor, used to add binary digits (1s and 0s).  Their primary function involves one or two inputs and an output, and the output produced is dependent on the input and the nature of the gate.  The inputs and output will be either true or false (i.e. a 1 or 0), which may be transmitted through the wire as a high/low voltage or as ons and offs.  These combinations of different values of inputs and the corresponding outputs are represented in truth tables.  Each type of logic gate has its own truth table.
  What are known as Half-Adders and Full-Adders contain logic gates, and these are what are found in processors to add binary digits.  A Half-Adder uses two inputs, an XOR gate and an AND gate, and is used two add two digits, and carry over that number two the next adder.  On the other hand, a Full-Adder adds three bits, and is comprised of three inputs, two XOR gates, two AND gates and an OR gate.  They also produce a sum and a carry.  In processors many of these adders will be used to perform simple calculations.


AND gate
Both inputs must be true for the output to be true.
Input
Output
A
B
C
0
0
0
0
1
0
1
0
0
1
1
1
OR gate
Used to express that either input or both being true will give an output that is true.
Input
Output
A
B
C
0
0
0
0
1
1
1
0
1
1
1
1
NOT gate
The input must be false for the output to be true.  These logic gates will only have one output.
Input
Output
A
C
0
1
1
0
XOR gate (extended OR)
Used to express that either output but not both being true will give an output that is true.
Input
Output
A
B
C
0
0
0
1
0
1
0
1
1
1
1
0
NAND gate (not AND)
As long as both of the inputs aren’t true then the outputs won’t be true.
Input
Output
A
B
C
0
0
1
1
0
1
0
1
1
1
1
0
NOR gate (not OR)
Only if both inputs are false will the output be true.
Input
Output
A
B
C
0
0
1
1
0
0
0
1
0
1
1
0
XNOR gate (extended NOR)
If neither or both of the inputs are true, then the output will be true.  Therefore, if one input is true and the other is false then the output will be false.
Input
Output
A
B
C
0
0
1
1
0
0
0
1
0
1
1
1

2 comments:

  1. Sorry about the diagrams not being there! I created diagrams out of auto-shapes which I then print-screened and pasted in, though for some reason they do not appear here!

    ReplyDelete
  2. Great summary - liked the half adders/full adders bit. Don't worry about the pictures - so long as you are happy. Maybe add in a bit on how you would represent AND, OR and NOT algebraically

    ReplyDelete