Introductory Workshop To 8051 - Lec1,2. DLD Intro
Introductory Workshop To 8051 - Lec1,2. DLD Intro
a ab
b ab + cd
c e (ab+cd)
d cd
e
2-<2>
Digital Discipline: Binary Values
• Typically consider only two discrete values:
– 1’s and 0’s
– 1, TRUE, HIGH
– 0, FALSE, LOW
• 1 and 0 can be represented by specific
voltage levels, rotating gears, fluid levels,
etc.
• Digital circuits usually depend on specific
voltage levels to represent 1 and 0
• Bit: Binary digit
1-<3> 3
George Boole, 1815 - 1864
• Born to working class parents
• Taught himself mathematics and
joined the faculty of Queen’s
College in Ireland.
• Wrote An Investigation of the Laws
of Thought (1854)
• Introduced binary variables
• Introduced the three fundamental
logic operations: AND, OR, and
NOT.
1-<4>
Boolean Algebra
• Set of axioms and theorems to simplify Boolean
equations
• Like regular algebra, but in some cases simpler
because variables can have only two values (1 or 0)
• Axioms and theorems obey the principles of
duality:
– ANDs and ORs interchanged, 0’s and 1’s interchanged
1-<5>
Boolean Axioms
1-<6>
Boolean Theorems
1-<7>
T1: Identity Theorem
• B 1=
• B+0=
1-<8>
T1: Identity Theorem
• B 1=B
• B+0=B
B
1 = B
B
0 = B
1-<9>
T2: Null Element Theorem
• B 0=
• B+1=
1-<10>
T2: Null Element Theorem
• B 0=0
• B+1=1
B
0 = 0
B
1 = 1
1-<11>
T3: Idempotency Theorem
• B B=
• B+B=
1-<12>
T3: Idempotency Theorem
• B B=B
• B+B=B
B
B = B
B
B = B
1-<13>
T4: Identity Theorem
• B=
1-<14>
T4: Identity Theorem
• B=B
B = B
1-<15>
T5: Complement Theorem
• B B=
• B+B=
1-<16>
T5: Complement Theorem
• B B=0
• B+B=1
B
B = 0
B
B = 1
1-<17>
Boolean Theorems: Summary
1-<18>
Review of Boolean algebra and switching functions
A A
1 A 1 1
A A
0 0 A
0
1-<20>
1. Identity A* 1 =A A+1= 1
A*0= 0 A+ 0 =A
2. Complement A + A’ = 1 A * A’ = 0
A+BC = (A+B)(A+C) A
A B
B A
C
C
21
T7. Associativity
(A+B) + C = A + (B+C) C A
A B
B C
(AB)C = A(BC) C A
A B
B C
22
Simplifying Boolean Expressions:
Example 1
• Y = AB + AB
1-<23>
Simplifying Boolean Expressions:
Example 1
• Y = AB + AB
= B(A + A) T8
= B(1) T5’
=B T1
1-<24>
Simplifying Boolean Expressions:
Example 2
• Y = A(AB + ABC)
1-<25>
Simplifying Boolean Expressions:
Example 2
• Y = A(AB + ABC)
= A(AB(1 + C)) T8
= A(AB(1)) T2’
= A(AB) T1
= (AA)B T7
= AB T3
1-<26>
DeMorgan’s Theorem
• Y = AB = A + B A
B
Y
A
Y
B
A
Y
B
• Y=A+B=A B A
B
Y
1-<27>
Bubble Pushing
• Pushing bubbles backward (from the output) or
forward (from the inputs) changes the body of
the gate from AND to OR or vice versa.
• Pushing a bubble from the output back to the
inputs puts bubbles on all gate inputs.
A A
Y Y
B B
I) Specification
– a. Language
– b. Truth Table
– c. Boolean Algebra
– d. Incompletely Specified Function
29
Binary Addition (I’ll explain this again, don’t
worry)
5
+ 7
12
Carry Sum
1 1 1 Carry bits
1 0 1 5
+ 1 1 1 7
1 1 0 0 12
Carryout Sums
30
Half Adder
Truth Table
a
a b carry sum
Sum 0 0 0 0
0 1 0 1
b 1 0 0 1
Carry 1 1 1 0
31
Switching Function
Sum (a,b) = a’b + ab’
Ex:
Sum (0,0) = 0’0 + 0*0’ = 0 + 0 = 0
Sum (0,1) = 0’1 + 0*1’ = 1 + 0 = 1
Sum (1,1) = 1’1 + 1*1’ = 0 + 0 = 0
32
Full Adder
Truth Table
33
Minterm and Maxterm (google these.
Important concept)
Id a b cin carryout
0 0 0 0 0 a+b+c
1 0 0 1 0 a+b+c’
2 0 1 0 0 a+b’+c
3 0 1 1 1 a’ b c
4 1 0 0 0 a’+b+c
5 1 0 1 1 a b’c
6 1 1 0 1 a b c’
maxterm
7 1 1 1 1 abc
minterm
34
Minterms
f1(a,b,c) = a’bc + ab’c + abc’ + abc
35
Maxterms
f2(a,b,c) = (a+b+c)(a+b+c’)(a+b’+c)(a’+b’+c)
36
f1(a,b,c) = a’bc + ab’c + abc’ + abc
f2(a,b,c) = (a+b+c)(a+b+c’)(a+b’+c)(a’+b’+c)
f1(a, b, c) = m3 + m5 + m6 + m7 = Sm(3,5,6,7)
f2(a, b, c) = M0M1M2M4 = PM(0, 1, 2, 4)
37
Minterm 4 = ab’c’
40
Incompletely Specified Function
Don’t care set is important because it allows us to
minimize the function
Id a b f (a, b)
1) The input does not
0 0 0 1 happen.
1 0 1 0
2 1 0 1 2) The input happens, but
3 1 1 - the output is ignored.
Examples:
-Decimal number 0… 9 uses 4 bits. (1,1,1,1) does not happen.
-Final carry out bit (output is ignored).
41
Incompletely Specified Function
42
Definitions
Literals xi or xi’
43
Implementation
Specification Schematic Diagram
Net list,
Switching expression
Obj min cost Search in solution space
(max performance)
44
Implementation (Optimization)
Karnaugh map – 2D truth table
ID A B f(A,B) minterm
0 0 0 0
1 0 1 1 A’B
2 1 0 1 AB’
3 1 1 1 AB
45
Function can be represented by sum of minterms:
f(A,B) = A’B+AB’+AB
This is not optimal however!
We want to minimize the number of literals and terms.
We factor out common terms –
A’B+AB’+AB= A’B+AB’+AB+AB
=(A’+A)B+A(B’+B)=B+A
f(A,B) = A+B
46
On the K-map however:
A=0 A= 1
AB’
0 2
B=0 0 1
1 3
B=1 1 1
A’B AB
f(A,B) = A + B
47
Another Example
ID A B f(A,B) minterm
0 0 0 0
1 0 1 1 A’B
2 1 0 0
3 1 1 1 AB
f(A,B)=A’B+AB=(A’+A)B=B
48
On the K-map:
A=0 A= 1
0 2
B= 0 0 0
1 3
B=1 1 1
A’B AB
f(A,B)=B
49
Using Maxterms
ID A B f(A,B) Maxterm
0 0 0 0 A+B
1 0 1 1
2 1 0 0 A’+B
3 1 1 1
f(A,B)=(A+B)(A’+B)=(AA’)+B=0+B=B
50
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)
a
f(a,b)
b
51
Two-Input Logic Gates
AND OR
A A
Y Y
B B
Y = AB Y=A+B
A B Y A B Y
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
52
More Two-Input Logic Gates
A B Y A B Y A B Y A B Y
0 0 0 0 0 1 0 0 1 0 0 1
0 1 1 0 1 1 0 1 0 0 1 0
1 0 1 1 0 1 1 0 0 1 0 0
1 1 0 1 1 0 1 1 0 1 1 1
53
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
54
Corresponding K-map
a=1
f(a,b,c) = c’
55
Karnaugh Maps (K-Maps)
• Boolean expressions can be minimized by combining
terms
• K-maps minimize equations graphically
• PA + PA = P
A B C Y Y Y
AB AB
0 0 0 1
00 01 11 10 C 00 01 11 10
0 0 1 1 C
0 1 0 0
0 1 1 0 0 1 0 0 0 0 ABC ABC ABC ABC
1 0 0 0
1 0 1 0
1 1 0 0 1 1 0 0 0 1 ABC ABC ABC ABC
1 1 1 0
56
K-map
• Circle 1’s in adjacent squares
• In the Boolean expression, include only the
literals whose true
Y
A B C Y AB
0 0 0 1 00 01 11 10
C
0 0 1 1
0 1 0 0 0 1 0 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0 1 1 0 0 0
1 1 1 0
y(A,B)=A’B’
57
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
58
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’
59
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
60
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’
61
4-input K-map
A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1 01
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0 10
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
62
4-input K-map
A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00 1 0 0 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1 01 0 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11 1 1 0 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0 10 1 1 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
63
4-input K-map
A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00 1 0 0 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1 01 0 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11 1 1 0 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0 10 1 1 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0 Y = AC + ABD + ABC + BD
64
K-maps with Don’t Cares
A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00
0 1 0 0 0
0 1 0 1 X
0 1 1 0 1 01
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X 10
1 1 0 1 X
1 1 1 0 X
1 1 1 1 X
65
K-maps with Don’t Cares
A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00 1 0 X 1
0 1 0 0 0
0 1 0 1 X
0 1 1 0 1 01 0 X X 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11 1 1 X X
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X 10 1 1 X X
1 1 0 1 X
1 1 1 0 X
1 1 1 1 X
66
K-maps with Don’t Cares
A B C D Y Y
0 0 0 0 1 AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00 1 0 X 1
0 1 0 0 0
0 1 0 1 X
0 1 1 0 1 01 0 X X 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11 1 1 X X
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X 10 1 1 X X
1 1 0 1 X
1 1 1 0 X
1 1 1 1 X Y = A + BD + C
67