Computer Science 101 Logic Gates: A Brief History Logic Gates: A

Logic Gates: A Brief History
Water metaphor: Open and close a “gate” to let
the “water” (current) run through.
Computer Science 101
Logic Gates and Simple Circuits
Logic Gates: A Brief History
Relay: Electromagnetic switch that physically
opens and closes (1930's – 1940's)
Logic Gates: A Brief History
Vacuum Tube (“valve”): Electronic switch; i.e.,
no moving parts (1940's – 1950's)
“bug”
Transistor – Electronic Switch
Collector
Base
Switch
1950's – present
Base High (+5v or 1)
Makes connection
Base Low (0v or 0)
Disconnects
NOT Gate
+5v
Output
Input
Input High (+5v or 1)
Output Low (0v or 0)
Input Low (0v or 0)
Output High (+5v or 1)
Output is opposite of
Input
Emitter
NOT Gate
Ground
_
A
A
AND Gate
+5v
OR Gate
Output is 1 only if
Output is 1 if either
Input-1 is 1 and
Input-2 is 1
Input-1 is 1 or
Input-2 is 1
+5v
Output
= Input1 AND Input2
Input-1
Output
= Input1 OR Input2
A
B
OR Gate
AND Gate
A
A
Input-2
B
Output
AB
Output
B
A+B
Boolean Exp → Logic Circuit
To draw a circuit from a Boolean expression:
From the left, make an input line for each
variable.
Next, put a NOT gate in for each variable that
appears negated in the expression.
Still working from left to right, build up circuits
for the subexpressions, from simple to complex.
Logic Circuit: _ ____
AB+(A+B)B
NOT Gate for B
Logic Circuit: _ ____
AB+(A+B)B
Input Lines for Variables
A
B
Logic Circuit: _ ____
AB+(A+B)B
_
Subexpression AB
_
AB
A
A
B
B
_
B
_
B
Logic Circuit: _ ____
AB+(A+B)B
___
Subexpression A+B
Subexpression A+B
_
AB
A
Logic Circuit: _ ____
AB+(A+B)B
___
Subexpression (A+B)B
Entire Expression
_
AB
A+B
_
B
____
A+B
_
B
Logic Circuit: _ ____
AB+(A+B)B
B
A+B
B
_
B
A
_
AB
A
A+B
B
Logic Circuit: _ ____
AB+(A+B)B
_
AB
A
____
A+B
A+B
B
____
(A+B)B
_
B
____
A+B
____
(A+B)B
Logic Circuit →Boolean Exp
In the opposite direction, given a logic
circuit, we can write a Boolean expression
for the circuit.
First we label each input line as a variable.
Then we move from the inputs labeling the
outputs from the gates.
As soon as the input lines to a gate are
labeled, we can label the output line.
The label on the circuit output is the result.
Simplifying Boolean Expressions
Once we have the BE for the circuit, perhaps
we can simplify.
Use high-school algebra, plus rules of Boolean
algebra:
A=A
AA=0
A+A=1
1+1=1
AA=A
(A + B) = A B
AB = (A + B)
} De Morgan's Laws
Logic Circuit Ô Boolean Exp
_
_ _
AB AB+AB
A
_
A
B
_
B
_
AB
______
_ _
AB+AB
A+B
Entire Expression
______
_ _
(AB+AB)(A+B)
Simplification: Example
(AB + AB)(A + B)
= ABAB(A+B)
= (A+B)(A+B)(A+B)
= (A+B)(AA+AB + BA + BB)
= (A+B)(A +AB +AB + BB)
= (A+B)(A(1 + B + B) + BB)
= (A+B)(A(1) + BB)
= (A+B)A
= AA + AB
= AB
Logic Circuit Ô Boolean Exp
The Boolean Triangle
Boolean
Expression
Logic
Circuit
Reduces to:
The Boolean Triangle
Boolean
Expression
Logic
Circuit
Truth
Table
Truth
Table