chapter 10.3: logic gates
DESCRIPTION
Chapter 10.3: Logic Gates. Based on Slides from Discrete Mathematical Structures: Theory and Applications and by Aaron Bloomfield. Learning Objectives. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/1.jpg)
Chapter 10.3: Logic Gates
Based on Slides from
Discrete Mathematical Structures:
Theory and Applications
and by Aaron Bloomfield
![Page 2: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/2.jpg)
2
Learning 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).
![Page 3: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/3.jpg)
3
Logical Gates and Combinatorial Circuits
![Page 4: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/4.jpg)
4
Logical Gates and Combinatorial Circuits
![Page 5: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/5.jpg)
5
Logical Gates and Combinatorial Circuits
![Page 6: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/6.jpg)
6
Logical 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.
![Page 7: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/7.jpg)
7
Logical Gates and Combinatorial Circuits
![Page 8: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/8.jpg)
8
![Page 9: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/9.jpg)
9
![Page 10: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/10.jpg)
10
![Page 11: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/11.jpg)
11
![Page 12: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/12.jpg)
12
![Page 13: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/13.jpg)
13
![Page 14: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/14.jpg)
14
![Page 15: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/15.jpg)
15
![Page 16: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/16.jpg)
16
![Page 17: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/17.jpg)
17
![Page 18: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/18.jpg)
18
![Page 19: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/19.jpg)
19
![Page 20: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/20.jpg)
20
A 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 on:F(1,1)=1, this implies
When we open one switch, the light is off:F(1,0)=F(0,1)=0
When the other switch is also open, the light is on:F(0,0)=1
![Page 21: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/21.jpg)
21
Thus, 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?
Draw a circuit for F,i.e., a circuit to control two light switches.
F(x,y) = xy + x’y’
![Page 22: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/22.jpg)
22
![Page 23: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/23.jpg)
23
![Page 24: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/24.jpg)
24
![Page 25: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/25.jpg)
25
![Page 26: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/26.jpg)
26
![Page 27: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/27.jpg)
27
![Page 28: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/28.jpg)
28
![Page 29: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/29.jpg)
29
![Page 30: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/30.jpg)
30
![Page 31: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/31.jpg)
31
Logical 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).
![Page 32: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/32.jpg)
32
Logical 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.
![Page 33: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/33.jpg)
33
Adders: 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.
![Page 34: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/34.jpg)
34
How to add binary numbers
Consider adding two 1-bit binary numbers x and y
0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 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
![Page 35: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/35.jpg)
35
x y s c
1 1 0 1
1 0 1 0
0 1 1 0
0 0 0 0
= s (sum)
c (carry)
![Page 36: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/36.jpg)
36
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
HAX
Y
S
C
HAX
Y
S
C
xy
c
c
s
HAX
Y
S
C
HAX
Y
S
C
xy
c
A 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.
![Page 37: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/37.jpg)
37
The full adder
The full circuitry of the full adder
xy
s
c
c
![Page 38: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/38.jpg)
38
We can use a half-adder and full adders to compute the sum of two Boolean numbers
1 1 0 0
+ 1 1 1 0010?
001
Adding bigger binary numbers
![Page 39: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/39.jpg)
39
Adding bigger binary numbers
Just chain one half adder and full adders together, e.g., to add x=x2x1x0 and y=y2y1y0 we need:
HAX
Y
S
C
FAC
Y
X
S
C
FAC
Y
X
S
C
FAC
Y
X
S
C
x1y1
x2y2
x3y3
x0y0
s0
s1
s2
s3c
![Page 40: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/40.jpg)
40
Adding 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 4+9*31 = 283 logic gates
To add 64 bit binary numbers, you need 1 HA and 63 FAs Total of 4+9*63 = 571 logic gates
![Page 41: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/41.jpg)
41
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!
![Page 42: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/42.jpg)
42
Flip-flops
Consider the following circuit:
What does it do?
![Page 43: Chapter 10.3: Logic Gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5681464a550346895db35b92/html5/thumbnails/43.jpg)
43
Memory
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
That’s about 43 million transistors!
In reality, those transistors are split into 9 ICs of about 5 million transistors each