This document provides an overview of logic gates. It discusses how logic gates perform logical operations on inputs to produce outputs, and are commonly implemented electronically using transistors. The document then explains various logic gates like NOT, AND, OR, NAND, NOR, and XOR. It provides truth tables to illustrate the functionality of each gate. It also discusses how more complex logic can be achieved by combining simple gates. Finally, the document touches on how logic gates are used to build basic memory circuits like flip-flops, and their role in modern computer components.
2. Logic
• Formal logic is a branch of
mathematics that deals with
true and false values
instead of numbers.
• In 1840’s, George Boole
developed many Logic ideas.
•A logic gate performs a
logical operation on one or
more logic inputs and produces
a single logic output.
2
Page 2
3. The logic normally performed is
Boolean logic and is most commonly found
in digital circuits.
Logic gates are primarily implemented
electronically using diodes or transistors, but
can also be constructed using
electromagnetic relays (relay logic),
fluidic logic, pneumatic logic, optics,
molecules, or even mechanical elements.
In electronic logic, a logic level is
represented by a voltage or current,
depending on the type of electronic logic in
use.
Page 3
4. Logic Signals
There are a number of different systems for representing
binary information in physical systems. Here are a few.
A voltage signal with zero (0) corresponding to 0 volts and
one (1) corresponding to five or three volts.
A sinusoidal signal with zero corresponding to some
frequency, and one corresponding to some other
frequency.
A current signal with zero corresponding to 4 milliamps
and one corresponding to 20 milliamps.
And one last way is to use switches, OPEN for "0" and
CLOSED for "1".
(And there are more ways!)
Page 4
5. Boolean algebra is the algebra of two values. These are usually
taken to be 0 and 1, as we shall do here, although F and T, false
and true, etc. are also in common use.
Whereas elementary algebra is based on numeric operations
multiplication xy, addition x + y, and negation −x, Boolean
algebra is customarily based on logical counterparts to those
operations, namely :
(1) conjunction x∧y (AND)
(2) disjunction x∨y (OR)
(3) complement or negation ¬x (NOT).
In electronics:
AND is represented as a multiplication
OR is represented as an addition
NOT is represented with an overbar
Page 5
7. Truth Table
A truth table is a good way to
show the function of a logic gate.
It shows the output states for
every possible combination of
input states. The symbols 0
(false) and 1 (true) are usually
used in truth tables.
Page 7
8. NOT
The output A is true when the input a is NOT true, the output is the inverse of
the input: a = NOT A
A NOT gate can only have one input. A NOT gate is also called an inverter.
Truth Table:
A
A
a
0
A
1
1
0
Page 8
9. AND
"If A AND B are both 1, then Q should be 1.“
(All or nothing.)
Logic Gate:
A
A*B
B
Truth Table:
A
0
A
Series Circuit:
A*B
0
0
1
1
0
0
0
1
B
B
0
1
1
A*B
Page 9
10. Three Input AND Gate
A
B
C
ABC
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
Page 10
11. OR
"If A is 1 OR B is 1 (or both are 1), then Q is 1."
Logic Gate:
A
A+B
B
Truth Table:
A
0
B
1
0
1
1
1
Parallel Circuit:
A+B
0
0
1
A
B
0
1
1
A+B
Page 11
12. • Because + and * are binary operations, they
can be cascaded together to OR or AND
multiple inputs.
A
B
A
B
C
C
A+B+C
A+B+C
A
B
A
B
C
ABC
ABC
Page 12
13. NAND and NOR Gates
• NAND and NOR gates can greatly simplify circuit diagrams.
NAND inverts the output of AND.
• NOR inverts the output of OR.
A
0
0
1
1
0
1
1
1
0
A
NOR
0
A↑ B
1
1
NAND
B
B
0
0
A↓ B
1
0
1
0
1
0
0
1
1
0
Page 13
14. XOR and XNOR Gates
XOR (exclusive OR) :"If either A OR B is 1, but NOT both, Q is 1."
A
0
0
A⊕ B
0
0
1
1
1
0
1
1
XOR
B
1
0
XNOR (exclusive NOR) : invert output of XOR
A
XNOR
B
A
B
0
0
1
0
1
0
1
0
0
1
1
1
Page 14
15. • Find the output of the following circuit
x+y
(x+y)y
y
__
• Answer: (x+y)y
15
Page 15
16. • Find the output of the following circuit
x
xy
xy
y
___
__
• Answer: xy
Page 16
17. Give the Boolean expression of the given circuit
x+y
(x+y)(xy)
xy
Answer:
xy
(x+y)(xy)
17
Page 17
18. •
Write the circuits for the following
Boolean algebraic expressions
__
a) x+y
x
x+y
18
Page 18
19. •
Write the circuits for the following
Boolean algebraic expressions
_______
b) (x+y)x
x+y
x+y
(x+y)x
19
Page 19
20. More about logic gates
• To implement a logic gate in hardware,
you use a transistor
• Transistors are all enclosed in an “IC”, or
integrated circuit
• The current Intel Pentium IV processors
have 55 million transistors!
20
Page 20
22. If you arrange the gates correctly, they will remember an input value. MEMORY
This simple concept is the basis of RAM (random access memory) in computers,
and also makes it possible to create a wide variety of other useful circuits.
Memory relies on a concept called feedback. That is, the output of a gate is fed back into the input.
• A flip-flop holds a single bit of memory
• In reality, flip-flops are a bit more
complicated
– Have 5 (or so) logic gates (transistors) per flipflop
• Consider a 1 Gb memory chip
– 1 Gb = 8,589,934,592 bits of memory
– That’s about 43 million transistors!
• In reality, those transistors are split into 9
ICs of about 5 million transistors each
22
Page 22
23. Exercises:
1.Give the Boolean expression of the given gate.
Answer: (A + B)C
2.Give the Boolean expression of the given gate.
Answer: A + BC + D
3.Draw a logic circuit for AB + AC.
Page 23
24. Exercises:
4.Draw a logic circuit for (A + B)(C + D) C.
5. Give the truth table for a 3-input (A,B & C) OR gate.
6. What type of logic gate's behavior does this truth table represent?
7.Give the Boolean expression of the given gate.
Page 24