0% found this document useful (0 votes)
117 views34 pages

Gates and Logic: From Transistors To Logic Gates and Logic Circuits

The document discusses the basics of transistors, logic gates, and logic circuits. It covers how transistors work and are used to build logic gates like AND, OR, NOT. The goals are to explain how logic circuits are constructed from transistors and gates, how to derive circuits from truth tables, and techniques for minimizing logic circuits.

Uploaded by

Saleem Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views34 pages

Gates and Logic: From Transistors To Logic Gates and Logic Circuits

The document discusses the basics of transistors, logic gates, and logic circuits. It covers how transistors work and are used to build logic gates like AND, OR, NOT. The goals are to explain how logic circuits are constructed from transistors and gates, how to derive circuits from truth tables, and techniques for minimizing logic circuits.

Uploaded by

Saleem Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Gates

and Logic:
From Transistors to Logic Gates and
Logic Circuits
Prof. Anne Bracy
CS 3410
Computer Science
Cornell University

The slides are the product of many rounds of teaching CS 3410 by


Professors Weatherspoon, Bala, Bracy, and Sirer.
Goals for Today
• From Switches to Logic Gates to Logic Circuits
• Transistors, Logic Gates, Truth Tables
• Logic Circuits
§ Identity Laws
§ From Truth Tables to Circuits (Sum of Products)
• Logic Circuit Minimization
§ Algebraic Manipulations
§ Karnaugh Maps

2
Silicon Valley & the Semiconductor Industry
• Transistors:
• Youtube video “How does a transistor work”
https://www.youtube.com/watch?v=IcrBqCFLHIY
• Break: show some Transistor, Fab, Wafer photos

3
Transistors 101
Source Gate Drain Source Gate Drain


Insulator Insulator
- + + + + + + + + - - + + + + + + -
+ + P-type channel created
- + + + - - - + + + - - + + + - +- - + ++ -
P-type - P-type P-type - P-type
- N-type - - N-type -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -

Off On
N-Type Silicon: negative free-carriers (electrons)
P-Type Silicon: positive free-carriers (holes)
P-Transistor: negative charge on gate generates electric field that
creates a (+ charged) p-channel connecting source & drain
N-Transistor: works the opposite way
Metal-Oxide Semiconductor (Gate-Insulator-Silicon)
• Complementary MOS = CMOS technology uses both p- & n-type
transistors
4
CMOS Notation
N-type Off/Open On/Closed

0 1
gate

P-type
Off/Open On/Closed

1 0
gate

Gate input controls whether current can flow


between the other two terminals or not.

Hint: the “o” bubble of the p-type tells you that


this gate wants a 0 to be turned on
5
iClicker Question
Which of the following statements is false?

(A) P- and N-type transistors are both used in CMOS


designs.
(B) As transistors get smaller, the frequency of your
processor will keep getting faster.
(C) As transistors get smaller, you can fit more and
more of them on a single chip.
(D) Pure silicon is a semi conductor.
(E) Experts believe that Moore’s Law will soon end.

6
2-Transistor Combination: NOT
• Logic gates are constructed by combining transistors
in complementary arrangements
• Combine p&n transistors to make a NOT gate:
CMOS Inverter :
power source (1) power source (1) power source (1)

p-gate — p-gate + p-gate


closes stays open
0 1 1 0
input output
n-gate
n-gate n-gate
— + closes
stays open

ground (0) ground (0) ground (0)

7
Inverter
Vsupply (aka logic 1) Function: NOT
Symbol:
in out
in out

(ground is logic 0)
Truth Table:

In Out
0 1
1 0

8
Logic Gates
• Digital circuit that either allows
signal to pass through it or not
• Used to build logic functions
• Seven basic logic gates:
AND,
OR,
NOT,
NAND (not AND), George Boole,(1815-1864)
NOR (not OR),
XOR
Did you know?
XNOR (not XOR)
George Boole Inventor of the idea
of logic gates. He was born in
Lincoln, England and he was the son
of a shoemaker.
9
Logic Gates: Names, Symbols, Truth Tables
A Out

NOT: A 0 1
1 0

A B Out A B Out

A NAND: A
0 0 0 0 0 1

AND: B 0 1 0 B 0 1 1

1 0 0 1 0 1

1 1 1 1 1 0

A B Out A B Out
OR: A A 0 0 1

B
0 0 0
NOR:
0 1 1 B 0 1 0

1 0 1 1 0 0

1 1 1 1 1 0

A B Out A B Out

XOR:. A 0 0 0
XNOR: A
0 0 1

B 0 1 1 B 0 1 0

1 0 1 1 0 0

1 1 0 1 1 1
NOR Gate
Vsupply
Function: NOR
A Symbol:

B a
out
b
out
A B
Truth Table:
A B out
0 0 1
0 1 0
1 0 0
1 1 0
11
iClicker Question
Which Gate is this? Function:
Vsupply Vsupply
Symbol:
A B
out
B Truth Table:

A A B out
0 0
(A) NOT
0 1
(B) OR
(C) XOR 1 0
(D) AND 1 1
(E) NAND 12
Abstraction
• Hide complexity through simple abstractions
§ Simplicity
• Box diagram represents inputs and outputs
§ Complexity
• Hides underlying NMOS- and PMOS-transistors and atomic
interactions

Vdd a

in out d out

Vss b
a
d out
in out 13
b
iClicker Question
Which Gate is this? Function:
a Symbol:
b
Out

Truth Table:

A B out
0 0
(A) NOT
0 1
(B) OR
(C) XOR 1 0
(D) AND 1 1
(E) NAND 14
Universal Gates
• NAND and NOR:
§ Can implement any function with NAND or just NOR gates
§ useful for manufacturing

• NOT:
a

• AND: a
b
• OR:
a
b

15
What does this logic circuit do?
Function:
a Symbol:
Truth Table:
Out
d a b d Out
0 0 0
b 0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

Multiplexing Like a Boss


16
Goals for Today
• From Switches to Logic Gates to Logic Circuits
• Transistors, Logic Gates, Truth Tables
• Logic Circuits
§ From Truth Tables to Circuits (Sum of Products)
§ Identity Laws
• Logic Circuit Minimization
§ Algebraic Manipulations
§ Karnaugh Maps

17
Logic Implementation
How to implement a desired logic function?
a b c out minterm 1) Write minterms
0 0 0 0 a b c 2) Write sum of products:
0 0 1 1 a b c OR of all minterms where out=1
0 1 0 0 a b c out = abc + abc + abc
0 1 1 1 a b c a
1 0 0 0 a b c b
c
1 0 1 1 a b c out
1 1 0 0 a b c
1 1 1 0 a b c

Any combinational circuit can be implemented in


two levels of logic (ignoring inverters) 18
Logic Equations
NOT: = ā = !a = ¬a

AND: = a · b = a & b = a Ù b NAND:


(a ⚫ b) = !(a & b) = ¬ (a Ù b)
OR: = a + b = a | b = a Ú b
NOR:
(a + b) = !(a | b) = ¬ (a Ú b)
XOR: = a Å b = ab+ āb
XNOR:
(a ⨁ b) = ab + ab
Logic Equations
§ Constants: true = 1, false = 0
§ Variables: a, b, out, …
§ Operators (above): AND, OR, NOT, etc.

19
Identities

Identities useful for manipulating logic equations


• For optimization & ease of implementation
a + 0 = a
a + 1 = 1
a + ā = 1

a · 0 = 0
a · 1 = a
a · ā = 0
20
Identities
Identities useful for manipulating logic equations
• For optimization & ease of implementation

(a + b) = a • b
A A
↔ B
(ab) = a + b B

A A

B
↔ B

a + a b = a

a (b+c) = ab + ac

a(b + c) = a + b • c 21
Goals for Today
• From Switches to Logic Gates to Logic Circuits
• Transistors, Logic Gates, Truth Tables
• Logic Circuits
§ Identity Laws
§ From Truth Tables to Circuits (Sum of Products)
• Logic Circuit Minimization – why?
§ Algebraic Manipulations
§ Karnaugh Maps

22
Minimization Example
a + 0 = a Minimize this logic equation:
a + 1 = 1
a + ā = 1
a · 0 = 0 (a+b)(a+c) = (a+b)a + (a+b)c
a · 1 = a = aa + ba + ac + bc
a · ā = 0
= a + a(b+c) + bc
a + a b = a = a + bc
a (b+c) = ab + ac
(a + b) = a • b
(ab) = a + b
a(b + c) = a + b • c 23
iClicker Question
a + 0 = a (a+b)(a+c) à a + bc
a + 1 = 1
a + ā = 1
a · 0 = 0 How many gates were
a · 1 = a required before and after?
a · ā = 0

a + a b = a BEFORE AFTER
a (b+c) = ab + ac (A) 2 OR 1 OR
(B) 2 OR, 1 AND 2 OR
(a + b) = a • b (C) 2 OR, 1 AND 1 OR, 1 AND
(ab) = a + b (D) 2 OR, 2 AND 2 OR
a(b + c) = a + b • c (E) 2 OR, 2 AND 2 OR, 1 AND
24
Checking Equality w/Truth Tables
circuits ↔ truth tables ↔equations
Example: (a+b)(a+c) = a + bc
a b c (a+b) LHS (a+c) RHS bc

0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1 25
Checking Equality w/Truth Tables
circuits ↔ truth tables ↔equations
Example: (a+b)(a+c) = a + bc
a b c (a+b) LHS (a+c) RHS bc

0 0 0 0 0 0 0 0
0 0 1 0 0 1 0 0
0 1 0 1 0 0 0 0
0 1 1 1 1 1 1 1
1 0 0 1 1 1 1 0
1 0 1 1 1 1 1 0
1 1 0 1 1 1 1 0
1 1 1 1 1 1 1 1 26
Minimization in Practice
How does one find the most efficient equation?
• Manipulate algebraically until…?
• Use Karnaugh Maps (optimize visually)
• Use a software optimizer

For large circuits


• Decomposition & reuse of building blocks

27
Building a Karnaugh Map
a b c out
Sum of minterms yields
0 0 0 0
0 0 1 1
out =
0 1 0 0
0 1 1 1 abc + abc + abc + abc
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 0

ab
c 00 01 11 10 K-maps identify which inputs
0 0 0 0 1 are relevant to the output
1 1 1 0 1
28
Minimization with K-Maps
ab
c 00 01 11 10 (1) Circle the 1’s (see below)
0 0 0 0 1 (2) Each circle is a logical
component of the final equation
1 1 1 0 1

= ab" + a"c
Rules:
• Use fewest circles necessary to cover all 1’s
• Circles must cover only 1’s
• Circles span rectangles of size power of 2 (1, 2, 4, 8…)
• Circles should be as large as possible (all circles of 1?)
• Circles may wrap around edges of K-Map
• 1 may be circled multiple times if that means fewer
circles
29
Karnaugh Minimization Tricks (1)

ab
c 00 01 11 10
Minterms can overlap
0 0 1 1 1
out = bc" + ac" + ab
1 0 0 1 0
ab
c 00 01 11 10
0 1 1 1 1 Minterms can span 2, 4, 8 or
1 0 0 1 0 more cells
out = c" + ab

30
Karnaugh Minimization Tricks (2)
ab
cd 00 01 11 10
00 0 0 0 0 • The map wraps around
01 1 0 0 1 out = b"d
11 1 0 0 1
10
0 0 0 0
ab
cd 00 01 11 10
00 1 0 0 1 out = b" d"
01 0 0 0 0
11 0 0 0 0
10
1 0 0 1
31
Don’t Cares
ab “Don’t care” values can be
cd 00 01 11 10 interpreted individually in
00 0 0 0 0 whatever way is convenient
01 1 x x x
• assume all x’s = 1
11 1 x x 1 à out = d
10
0 0 0 0
ab • assume middle x’s = 0
cd 00 01 11 10
(ignore them)
00 1 0 0 x • assume 4th column x = 1
01 0 x x 0 " d"
à out = b
11 0 x x 0
10
1 0 0 1
32
Takeaway
• Binary —two symbols: true and false—is the basis of
Logic Design

• More than one Logic Circuit can implement same Logic


function. Use Algebra (Identities) or Truth Tables to
show equivalence.

• Any logic function can be implemented as “sum of


products”. Karnaugh Maps minimize number of gates.

33
Summary
• Most modern devices made of billions of transistors
§ You will build a processor in this course!
§ Modern transistors made from semiconductor
materials
§ Transistors used to make logic gates and logic circuits
• We can now implement any logic circuit
§ Use P- & N-transistors to implement NAND/NOR
gates
§ Use NAND or NOR gates to implement the logic
circuit
§ Efficiently: use K-maps to find required minimal terms
34

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy