Title: Chapter 10.3: Logic Gates
1Chapter 10.3 Logic Gates
- Based on Slides from
- Discrete Mathematical Structures
- Theory and Applications
- and by Aaron Bloomfield
2Learning Objectives
- Explore the application of Boolean algebra in the
design of electronic circuits. The basic elements
of circuits are gates. Each type of gate
implements a Boolean operation. - We will study combinational circuits - the
circuits whose output depends only on the input
and not on the current state of the circuit (no
memory).
3Logical Gates and Combinatorial Circuits
4Logical Gates and Combinatorial Circuits
5Logical Gates and Combinatorial Circuits
6Logical Gates and Combinatorial Circuits
- In circuitry theory, NOT, AND, and OR gates are
the basic gates. Any circuit can be designed
using these gates. The circuits designed depend
only on the inputs, not on the output. In other
words, these circuits have no memory. Also these
circuits are called combinatorial circuits. - The symbols NOT gate, AND gate, and OR gate are
also considered as basic circuit symbols, which
are used to build general circuits.
7Logical Gates and Combinatorial Circuits
8(No Transcript)
9(No Transcript)
10(No Transcript)
11(No Transcript)
12(No Transcript)
13(No Transcript)
14(No Transcript)
15(No Transcript)
16Draw a circuit diagram for ? (xy' x'y)z.
17(No Transcript)
18(No Transcript)
19(No Transcript)
20A circuit for two light switches
- EXAMPLE 3, p. 714
- F(x,y)1 when the light is on
- F(x,y)0 when the light is off
- When both switches are closed, the light is
onF(1,1)1, this implies - When we open one switch, the light is
offF(1,0)F(0,1)0 - When the other switch is also open, the light is
onF(0,0)1
21Thus, we get
x y F(x,y)
1 1 1
1 0 0
0 1 0
0 0 1
Which Boolean expression is given by F?
F(x,y) xy x'y'
Draw a circuit for F, i.e., a circuit to control
two light switches.
22(No Transcript)
23(No Transcript)
24(No Transcript)
25(No Transcript)
26(No Transcript)
27(No Transcript)
28(No Transcript)
29(No Transcript)
30(No Transcript)
31Logical Gates and Combinatorial Circuits
- A NOT gate can be implemented using a NAND gate
(a). - An AND gate can be implemented using NAND gates
(b). - An OR gate can be implemented using NAND gates
(c).
32Logical Gates and Combinatorial Circuits
- Any circuit which is designed by using NOT, AND,
and OR gates can also be designed using only NAND
gates. - Any circuit which is designed by using NOT, AND,
and OR gates can also be designed using only NOR
gates.
33Adders Logical gates to add two numbers
- We need to use a circuit with more than one
output, which clearly more powerful than a
Boolean expression.
34How to add binary numbers
- Consider adding two 1-bit binary numbers x and y
- 00 0
- 01 1
- 10 1
- 11 10
- Carry is x AND y
- Sum is x XOR y
- The circuit to compute this is called a half-adder
x y Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
35 s (sum)
c (carry)
x y s c
1 1 0 1
1 0 1 0
0 1 1 0
0 0 0 0
36A full adder is a circuit that accepts as input
thee bits x, y, and c, and produces as output the
binary sum cs of a, b, and c.
x 1 1 1 1 0 0 0 0
y 1 1 0 0 1 1 0 0
c 1 0 1 0 1 0 1 0
s (sum) 1 0 0 1 0 1 1 0
c (carry) 1 1 1 0 1 0 0 0
37The full adder
- The full circuitry of the full adder
38Adding bigger binary numbers
- We can use a half-adder and full adders to
compute the sum of two Boolean numbers
0
0
1
1 1 0 0 1 1 1 0
0
1
0
?
39Adding bigger binary numbers
- Just chain one half adder and full adders
together, e.g., to add xx3x2x1x0 and yy3y2y1y0
we need
40Adding bigger binary numbers
- A half adder has 4 logic gates
- A full adder has two half adders plus a OR gate
- Total of 9 logic gates
- To add n bit binary numbers, you need 1 HA and
n-1 FAs - To add 32 bit binary numbers, you need 1 HA and
31 FAs - Total of 4931 283 logic gates
- To add 64 bit binary numbers, you need 1 HA and
63 FAs - Total of 4963 571 logic gates
41More 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!
42Flip-flops
- Consider the following circuit
- What does it do?
R S Function
1 0 Reset
0 1 Set
1 1 Hold
0 0 1/1
R
Q
Q
S
It holds a single bit of memory.
43Memory
- A flip-flop holds a single bit of memory
- The bit flip-flops between the two NAND gates
- In reality, flip-flops are a bit more complicated
- Have 5 (or so) logic gates (transistors) per
flip-flop - Consider a 1 Gb memory chip
- 1 Gb 8,589,934,592 bits of memory
- Thats about 43 million transistors!
- In reality, those transistors are split into 9
ICs of about 5 million transistors each