0% found this document useful (0 votes)
9 views49 pages

02 Gates W

Uploaded by

batalhag
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)
9 views49 pages

02 Gates W

Uploaded by

batalhag
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/ 49

Prof.

Hakim Weatherspoon
CS 3410, Spring 2015
Computer Science
Cornell University

See: P&H Appendix B.2 and B.3 (Also, see B.1)


From Switches to Logic Gates to Logic Circuits
Logic Gates
• From switches
• Truth Tables
Logic Circuits
• Identity Laws
• From Truth Tables to Circuits (Sum of Products)
Logic Circuit Minimization
• Algebraic Manipulations
• Truth Tables (Karnaugh Maps)
Transistors (electronic switch)
• Acts as a conductor or
insulator
• Can be used to build
amazing things…

The Bombe used to break the German


Enigma machine during World War II
+
Either (OR)
Truth Table
A A B Light
-
OFF OFF
OFF ON
B ON OFF
ON ON

Both (AND)
+
A - A B Light
OFF OFF
OFF ON
B ON OFF
ON ON
Either (OR)
Truth Table
A A B Light
-
OR
OFF OFF
OFF ON
B ON OFF
ON ON

Both (AND)
A - A B Light
OFF OFF
AND OFF ON
B ON OFF
ON ON
Either (OR)
Truth Table
A A B Light
-
OR 0 = OFF
0 0
0 1 1 = ON
B 1 0
1 1

Both (AND)
A - A B Light
0 0
AND 0 1
B 1 0
1 1
A

OR
B
George Boole,(1815-1864)

A Did you know?


George Boole Inventor of the idea
AND of logic gates. He was born in
B Lincoln, England and he was the son
of a shoemaker in a low class family.
Binary (two symbols: true and false) is the basis of
Logic Design
NOT:
A Out
A

A B Out

AND: A 0 0
0 1
0
0
B 1 0 0
1 1 1

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

Logic Gates
• digital circuit that either allows a signal to pass through it or not.
• Used to build logic functions
• There are seven basic logic gates:
AND, OR, NOT,
NAND (not AND), NOR (not OR), XOR, and XNOR (not XOR) [later]
NOT:
A Out
A 0 1
1 0

A B Out

AND: A 0 0
0 1
0
0
B 1 0 0
1 1 1

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

Logic Gates
• digital circuit that either allows a signal to pass through it or not.
• Used to build logic functions
• There are seven basic logic gates:
AND, OR, NOT,
NAND (not AND), NOR (not OR), XOR, and XNOR (not XOR) [later]
NOT:
A Out
A 0 1
1 0

A B Out A B Out

AND: A 0 0
0 1
0
0
NAND: A
0 0
0 1
1
1
B 1 0 0 B 1 0 1
1 1 1 1 1 0

OR: A B Out NOR: A B Out


A A
0 0 0 0 0 1
B 0 1 1 B 0 1 0
1 0 1 1 0 0
1 1 1 1 1 0

Logic Gates
• digital circuit that either allows a signal to pass through it or not.
• Used to build logic functions
• There are seven basic logic gates:
AND, OR, NOT,
NAND (not AND), NOR (not OR), XOR, and XNOR (not XOR) [later]
From Switches to Logic Gates to Logic Circuits
Logic Gates
• From switches
• Truth Tables
Logic Circuits
• Identity Laws
• From Truth Tables to Circuits (Sum of Products)
Logic Circuit Minimization
• Algebraic Manipulations
• Truth Tables (Karnaugh Maps)
Transistors (electronic switch)
Given a Logic function, create a Logic Circuit that
implements the Logic Function…
…and, with the minimum number of logic gates

Fewer gates: A cheaper ($$$) circuit!


NOT:
A Out
0 1
A
1 0

A B Out

AND: A
0 0
0 1
0
0
B 1 0 0
1 1 1

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

XOR: 1 1 1

A B Out
A 0 0 0
0 1 1
B
1 0 1
1 1 0

.
NOT:
A Out
0 1
A
1 0

A B Out A B Out

AND: A
0 0
0 1
0
0
NAND: A
0 0
0 1
1
1
B 1 0 0 B 1 0 1
1 1 1 1 1 0

OR: A B Out NOR: A B Out


A A
0 0 0 0 0 1
B 0 1 1 B 0 1 0
1 0 1 1 0 0

XOR: 1 1 1
XNOR:
1 1 0

A B Out A B Out
A 0 0 0 A 0 0 1
0 1 1 0 1 0
B B
1 0 1 1 0 0
1 1 0 1 1 1

.
NOT:
• out = ā = !a = ¬a

AND:
• out = a ∙ b = a & b = a ∧ b

OR:
• out = a + b = a | b = a ∨ b

XOR:
• out = a ⊕ b = ab� + āb

Logic Equations
• Constants: true = 1, false = 0
• Variables: a, b, out, …
• Operators (above): AND, OR, NOT, etc.
NOT:
• out = ā = !a = ¬a

AND: NAND:
• out = a ∙ b = a & b = a ∧ b • out = a · b = !(a & b) = ¬ (a ∧ b)

OR: NOR:
• out = a + b = a | b = a ∨ b • out = a + b = !(a | b) = ¬ (a ∨ b)

XOR: XNOR:
• out = a ⊕ b = ab� + āb • out = a ⊕ b = ab + ab

Logic Equations
• Constants: true = 1, false = 0
• Variables: a, b, out, …
• Operators (above): AND, OR, NOT,
• . etc.
Identities useful for manipulating logic equations
– For optimization & ease of implementation
a+0=
a+1=
a+ā=

a∙0 =
a∙1 =
a∙ā =
Identities useful for manipulating logic equations
– For optimization & ease of implementation

(a + b) =

(a � b) =

a+ab =

a(b+c) =

a(b + c) =
• functions: gates ↔ truth tables ↔ equations
• Example: (a+b)(a+c) = a + bc
a b c

0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
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.
From Switches to Logic Gates to Logic Circuits
Logic Gates
• From switches
• Truth Tables
Logic Circuits
• Identity Laws
• From Truth Tables to Circuits (Sum of Products)
Logic Circuit Minimization
• Algebraic Manipulations
• Truth Tables (Karnaugh Maps)
Transistors (electronic switch)
How to standardize minimizing logic circuits?
How to implement a desired logic function?
a b c out
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 0
How to implement a desired logic function?
a b c out minterm 1) Write minterms
0 0 0 0 a b c 2) sum of products:
0 0 1 1 a b c • OR of all minterms where out=1
0 1 0 0 abc
0 1 1 1 abc
1 0 0 0 abc
1 0 1 1 abc
1 1 0 0 abc
1 1 1 0 abc
How to implement a desired logic function?
a b c out minterm 1) Write minterms
0 0 0 0 a b c 2) sum of products:
0 0 1 1 a b c • OR of all minterms where out=1
0 1 0 0 abc
0 1 1 1 abc
1 0 0 0 abc
1 0 1 1 abc
1 1 0 0 abc
1 1 1 0 abc
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
Sum of minterms yields
 �
out = abc + a�bc + abc + abc
a b c out
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 0
Sum of minterms yields
 out =
a b c out
0 0 0 0
0 0 1 1
0 1 0 0 Karnaugh maps identify
0 1 1 1 which inputs are (ir)relevant
1 0 0 1
1 0 1 1
to the output
1 1 0 0
1 1 1 0

ab
c 00 01 11 10
0 0 0 0 1
1 1 1 0 1
Sum of minterms yields
 �
out = abc + a�bc + abc + abc
a b c out
0 0 0 0
0 0 1 1
0 1 0 0 Karnaugh map minimization
0 1 1 1
 Cover all 1’s
1 0 0 1
1 0 1 1  Group adjacent blocks of 2n
1 1 0 0 1’s that yield a rectangular
1 1 1 0
shape
ab
c 00 01 11 10  Encode the common features
of the rectangle
0 0 0 0 1
 out = ab� + a�c
1 1 1 0 1
ab
c 00 01 11 10
Minterms can overlap
0 0 1 1 1
 out = b�c + a�c + ab
1 0 0 1 0
ab
c 00 01 11 10
0 1 1 1 1 Minterms can span 2, 4, 8
1 0 0 1 0
or more cells
 out = c� + ab
ab
cd 00 01 11 10
00 0 0 0 0 The map wraps around
01 1 0 0 1 �
• out = bd
11 1 0 0 1
10
0 0 0 0
ab
cd 00 01 11 10
00 1 0 0 1
01 • out =
0 0 0 0
11 0 0 0 0
10
1 0 0 1
ab
cd 00 01 11 10
00 0 0 0 0 “Don’t care” values can be
01 1 x x x interpreted individually in
11 1 x x 1 whatever way is convenient
10 • assume all x’s = 1
0 0 0 0
ab
• out = d
cd 00 01 11 10
00 1 0 0 x
01
• assume middle x’s = 0
0 x x 0
• assume 4th column x = 1
11 0 x x 0
• out =
10
1 0 0 1
A multiplexer selects
a between multiple inputs
b • out = a, if d = 0
d • out = b, if d = 1
a b d out
0 0 0 Build truth table
0 0 1
0 1 0 Minimize diagram
Derive logic diagram
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
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.
From Transistors to Gates to Logic Circuits
Logic Gates
• From transistors
• Truth Tables
Logic Circuits
• Identity Laws
• From Truth Tables to Circuits (Sum of Products)
Logic Circuit Minimization
• Algebraic Manipulations
• Truth Tables (Karnaugh Maps)
Transistors (electronic switch)
Transistors:
• 6:10 minutes (watch from from 41s to 7:00)
• http://www.youtube.com/watch?v=QO5FgM7MLGg

• Fill our Transistor Worksheet with info from Video


• NMOS Transistor PMOS Transistor
VD VS

VG VG
VG = VS VG = 0 V VG = VS VG = 0 V

VS = 0 V VD = 0 V

• Connect source to drain Connect source to drain


when gate = 1 when gate = 0
• N-channel P-channel
• NMOS Transistor PMOS Transistor
VD VS

VG VG
VG = 1 VG = 0 VG = 1 VG = 0

VS = 0 V VD = 0 V

• Connect source to drain Connect source to drain


when gate = 1 when gate = 0
• N-channel P-channel
Vsupply (aka logic 1)

• Function: NOT
in out • Called an inverter
• Symbol:
in out
(ground is logic 0)

In Out • Useful for taking the


0 1 inverse of an input
1 0 • CMOS: complementary-symmetry metal–oxide–
semiconductor
Truth table
Vsupply Vsupply
• Function: NAND
A B
• Symbol:
out a
out
B b

A B out
0 0 1
1 0 1
0 1 1
1 1 0
Vsupply • Function: NOR
A • Symbol:
a
B out
b
out

A B

A B out
0 0 1
1 0 0
0 1 0
1 1 0
NOT:

AND:

OR:

NAND and NOR are universal


• Can implement any function with NAND or just NOR gates
• useful for manufacturing
NOT: a

AND: a
b

OR: a
b

NAND and NOR are universal


• Can implement any function with NAND or just NOR gates
• useful for manufacturing
One can buy gates separately
• ex. 74xxx series of
integrated circuits
• cost ~$1 per chip, mostly
for packaging and testing

Cumbersome, but possible to


build devices using gates put
together manually
http://techguru3d.com/4th-gen-intel-haswell-processors-architecture-and-lineup/

The first transistor • An Intel Haswell


• on a workbench at – 1.4 billion transistors
– 177 square millimeters
AT&T Bell Labs in 1947 – Four processing cores
• Bardeen, Brattain, and Shockley
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

b
Vss
a
d out
in out
b
Most modern devices are made from billions of on /off
switches called transistors
• We will build a processor in this course!
• Transistors made from semiconductor materials:
– MOSFET – Metal Oxide Semiconductor Field Effect Transistor
– NMOS, PMOS – Negative MOS and Positive MOS
– CMOS – complementary MOS made from PMOS and NMOS transistors
• Transistors used to make logic gates and logic circuits
We can now implement any logic circuit
• Can do it efficiently, using Karnaugh maps to find the minimal
terms required
• Can use either NAND or NOR gates to implement the logic
circuit
• Can use P- and N-transistors to implement NAND or NOR gates

You might also like