CS 140 Lecture 3 Combinational Logic - PowerPoint PPT Presentation

About This Presentation
Title:

CS 140 Lecture 3 Combinational Logic

Description:

Karnaugh Maps (K-Maps) Boolean expressions can be minimized by combining terms ... PA PA = P. 17. Circle 1's in adjacent squares ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 28
Provided by: Thom88
Learn more at: https://cseweb.ucsd.edu
Category:

less

Transcript and Presenter's Notes

Title: CS 140 Lecture 3 Combinational Logic


1
CS 140 Lecture 3Combinational Logic
  • Professor CK Cheng
  • CSE Dept.
  • UC San Diego

2
Part I.
  • Specification
  • Implementation
  • K-maps

3
Definitions
Literals xi or xi Product Term x2x1x0
Sum Term x2 x1 x0 Minterm of n
variables A product of n variables in which
every variable appears exactly once.
4
Implementation
Specification ? Schematic Diagram
Net
list, Switching expression Obj min cost
? Search in solution space (max
performance) Cost wires, gates ?
Literals, product terms, sum
terms We want to minimize of terms, of
literals
5
Implementation (Optimization)
Karnaugh map 2D truth table
ID A B f(A,B) minterm
0 0 0 0
1 0 1 1 AB
2 1 0 1 AB
3 1 1 1 AB
6
Function can be represented by sum of
minterms f(A,B) ABABAB This is not
optimal however! We want to minimize the number
of literals and terms. We factor out common terms
ABABAB ABABABAB (AA)BA(BB)BA
f(A,B) AB
7
On the K-map however
A 0 A 1
AB
0 2
0 1 1 1
B 0 B 1
1 3
AB
AB
f(A,B) A B
8
Another Example
ID A B f(A,B) minterm
0 0 0 0
1 0 1 1 AB
2 1 0 0
3 1 1 1 AB
f(A,B)ABAB(AA)BB
9
On the K-map
A 0 A 1
0 2
0 0 1 1
B 0 B 1
1 3
AB
AB
f(A,B)B
10
Using Maxterms
ID A B f(A,B) Maxterm
0 0 0 0 AB
1 0 1 1
2 1 0 0 AB
3 1 1 1
f(A,B)(AB)(AB)(AA)B0BB
11
Two variable K-maps
Id a b f (a, b) 0 0 0
f (0, 0) 1 0 1 f (0, 1)
2 1 0 f (1, 0) 3 1 1
f (1, 1)
2 variables means we have 22 entries and thus we
have 2 to the 22 possible functions for 2 bits,
which is 16.
a b
f(a,b)
12
Two-Input Logic Gates

13
More Two-Input Logic Gates

14
Three variables K-maps
Id a b c f (a,b,c) 0 0
0 0 1 1 0 0 1
0 2 0 1 0 1 3 0
1 1 0 4 1 0 0
1 5 1 0 1 0 6 1
1 0 1 7 1 1 1
0
15
Corresponding K-map
b 1
Gray code
(0,0) (0,1) (1,1) (1,0)
0 2 6
4
c 0
1 1 1 1
1 3 7
5
c 1
0 0 0 0
a 1
f(a,b,c) c
16
Karnaugh Maps (K-Maps)
  • Boolean expressions can be minimized by combining
    terms
  • K-maps minimize equations graphically
  • PA PA P

17
K-map
  • Circle 1s in adjacent squares
  • In the Boolean expression, include only the
    literals whose true

y(A,B)AB
18
Another 3-Input example
Id a b c f (a,b,c) 0 0
0 0 0 1 0 0 1
0 2 0 1 0 1 3 0
1 1 0 4 1 0 0
1 5 1 0 1 1 6 1
1 0 - 7 1 1 1
1
19
Corresponding K-map
b 1
(0,0) (0,1) (1,1) (1,0)
0 2 6
4
c 0
0 1 - 1
1 3 7
5
c 1
0 0 1 1
a 1
f(a,b,c) a bc
20
Yet another example
Id a b c f (a,b,c,d) 0 0
0 0 1 1 0 0 1
1 2 0 1 0 - 3 0
1 1 0 4 1 0 0
1 5 1 0 1 1 6 1
1 0 0 7 1 1 1
0
21
Corresponding K-map
b 1
(0,0) (0,1) (1,1) (1,0)
0 2 6
4
c 0
1 - 0 1
1 3 7
5
c 1
1 0 0 1
a 1
f(a,b,c) b
22
4-input K-map
23
4-input K-map
24
4-input K-map
25
K-maps with Dont Cares
26
K-maps with Dont Cares
27
K-maps with Dont Cares
Write a Comment
User Comments (0)
About PowerShow.com