Download presentation
Presentation is loading. Please wait.
1
Digital Logic Review: Part II
ECE511: Digital System & Microprocessor
2
What we will learn in this session:
Negative number representation: 2’s Complement method. Minimizing Boolean expressions: K-map Boolean algebra. Comparison between Active High, and Active Low signals.
3
2’s Complement Representation
4
2’s Complement Used by M68k to represent negative numbers. Advantages:
Simple representation, conversion method. Can perform arithmetic operations directly. Can use existing circuits. MSB regarded as sign bit. If 0, then positive number. If 1, then negative number. Max value for 8-bits -128 to 127
5
2’s Complement +34 (decimal) 00100010 -54 (decimal) 11001010 Value
Sign bit Value Sign bit
6
Converting to 2’s Complement
1. Start with positive number 10 (decimal) = (binary) 2. Invert all the bits (invert) 3. Add 1 to inverted result 2’s Complement (-10)
7
Converting 2’s Complement Back
Converting -5 to 5: 1. The 2’s complement representation: -5 (decimal) = (binary) 2. Invert all the bits (invert) 3. Add 1 to inverted result Positive value (+5)
8
Max Value +127 1 1 1 1 1 1 1 Sign bit Value -127 =
9
Min Value -128 1 Sign bit Value +128 = ???
10
What about zero? Sign bit Value invert 1 1 1 1 1 1 1 1 +1
Sign bit Value invert 1 1 1 1 1 1 1 1 +1 1 carried out, not counted.
11
Calculating the Maximum Range
Calculated using the following formula: -(2n-1)< x < +(2n-1-1) Where n is number of bits.
12
Example: Calculating 2’s Complement Range
What is the range for 32-bit in 2’s complement representation? n = 32 -( ) < x < 232-1 -2,147,483,649 < x < 2,147,483,648
13
Active High vs. Active Low
14
Active High and Active Low
Some signals are active lows. They are active when they are low. Marked with bar:
15
Active High and Active Low
5 V is ACTIVE 0 V is INACTIVE Active Low 5 V is INACTIVE 0 V is ACTIVE TRUE FALSE TRUE FALSE
16
Why are active low signals preferred in control?
More noise immunity: All electronic circuits affected by noise. Less likely to false trigger. Not affected by voltage surge.
17
Noise Immunity Example: Resets system when active (pulled high). + =
False Triggering, system reset accidentally. 5V 5V 5V + = 0V 0V 0V Signal Noise New Signal
18
Noise Immunity Example: Resets system when active (pulled low). + =
No effect, since RESET is active low. 5V 5V 5V + = 0V 0V 0V Signal Noise New Signal
19
Noise Immunity Example: Reads from memory when low,
writes to memory when high. False Triggering, memory contents will be lost. 5V 5V 5V + = 0V 0V 0V Signal Noise New Signal
20
Noise Immunity Example: Reads from memory when high,
writes to memory when low. No data lost even when false triggering occurred. 5V 5V 5V + = 0V 0V 0V Signal Noise New Signal
21
Logic Minimization
22
Importance of Minimization
In electronics, we want: Functionality – desired objective. Minimal circuit area – wafers, board space. Minimal cost – more IC, more $$$. Maximum reliability – more components, more fail. Logic minimization + good design achieves all this. 2 popular methods: Boolan Algebra. Karnaugh Map.
23
Boolean Algebra
24
Boolean Algebra Named after George Boole.
Based on set theory and algebra. Application to electronics – C. Shannon. Application to computers: J. V. Atanasoff. Important in computer emergence.
25
Boolean Identities Set of fundamental rules:
Defines Boolean behaviors. Mathematics and Set Theory. Used for minimization. No set guideline for minimization: When to use what. Depends on luck, experience. Better to use K-Map.
26
Boolean Identities Identity Law Dominance Law Idempotent Law
Inverse Law Commutative Law Associative Law Distributive Law Absorption Law De Morgan Law Double Complement Law *You don’t have to memorize all these, you just have to know about them. Just use K-Map for minimization.
27
Identity Law + Dominance Law
1x = x 0 + x = x 0x = 0 1 + x = 1
28
Idempotent Law + Inverse Law
xx = x x + x = x xx = 0 x + x = x
29
Commutative Law + Associative Law
xy = yx x + y = y + x (xy)z = x(yz) (x + y) + z = x + (y + z)
30
Distributive Law x + yz = (x + y) (x + z) x(y + z) = xy + xz
31
Absorption Law x (x + y) = x x + xy = x
32
Double Complement Law x = x
33
De Morgan’s Law A . B = A + B A + B = A . B A . B A + B . = + A + B
+ = .
34
De Morgan’s Law A . B = A + B A + B = A . B A . B A + B . = + A + B
+ = .
35
Example 1 Z = ABC + ABC + ABC Z = ABC + B(AC + AC) Z = ABC + BC(A + A)
Minimize: Z = ABC + ABC + ABC Z = ABC + ABC + ABC Z = ABC + B(AC + AC) Z = ABC + BC(A + A) Z = ABC + BC Distributive Law Distributive Law Inverse Law
36
What if… Z = ABC + ABC + ABC Z = A(BC + BC) + ABC
Minimize: Z = ABC + ABC + ABC Z = ABC + ABC + ABC Distributive Law Z = A(BC + BC) + ABC Stuck here… * Can never get the answer!
37
Karnaugh Map
38
Karnaugh Maps To simplify Boolean expressions.
Invented by Maurice Karnaugh. Simpler than Boolean Algebra. Principles: Group together common factors. Delete unwanted variables. Works best for two to four variables.
39
Table Layout – 2 Variables
1 B A
40
Table Layout – 3 Variables
11 01 00 10 C AB 1
41
Table Layout – 4 Variables
11 01 00 10 CD AB
42
How to Construct the K-Map
Analyze function, create Truth Table (TT). Draw K-Map based on no. of variables. Fill the K-Map with values from TT. Group 1’s together. Extract simplified expression.
43
× Rules √ 1. You must not miss any 1’s.
11 01 00 10 CD AB 1 × √ 1. You must not miss any 1’s. 2. You can go right-left or up-down, but you cannot go diagonal.
44
× Rules √ 3. You can only have 1, 2, 4, 8, …, 2n elements in a group.
11 01 00 10 CD AB 1 √ 3. You can only have 1, 2, 4, 8, …, 2n elements in a group. 11 01 00 10 CD AB 1 ×
45
× Rules √ 4. Try to cover all 1’s using the minimum number of groups.
11 01 00 10 CD AB 1 4. Try to cover all 1’s using the minimum number of groups. . √ 11 01 00 10 CD AB 1 × 2 groups 6 groups
46
Rules √ √ √ 5. Overlapping groups are allowed. AB AB CD CD 11 01 00 10
1 5. Overlapping groups are allowed. √ 11 01 00 10 CD AB 1 √ √
47
Rules √ √ 6. Wrap-around is allowed. CD AB CD AB Corner wrap Side wrap
11 01 00 10 CD AB 1 11 01 00 10 CD AB 1 √ √ Corner wrap Side wrap
48
Rules 11 01 00 10 CD AB 1 √ Top-down wrap
49
× Rules √ 6. Don’t cares (X) can be grouped with 1’s if they help. CD
11 01 00 10 CD AB X 1 11 01 00 10 CD AB X 1 × √ Don’t cares can help make the group larger (1 group). Not selecting don’t cares (2 groups)
50
Extracting the Results
*All AB cancel out, only C and D are left. AB 00 01 11 10 AB 00 CD 00 01 11 10 00 1 1 1 1 01 CD 11 1 1 10 1 1 AB *A and D cancel out, only B and C are left. Answer: 01 11 11 CD 10
51
Example Minimize this logic equation:
52
Solution A B C Z 1
53
Solution AB 00 01 11 10 1 1 1 C 1 1 1 1 Values of Z (from TT)
54
Solution AB 00 01 11 10 1 1 1 C 1 1 1 1
55
Solution 11 01 00 10 C AB 1
56
Example 1 Z = ABC + BC C Minimize: Z = ABC + ABC + ABC AB 11 01 00 10
C A B C Z 1 Truth Table: Z = ABC + BC
57
Example 2 Minimize: Z = ABCD + ABCD + ABCD + ABCD B C D Z 1 A
1 A Truth Table:
58
Example 2 11 01 00 10 CD AB 1 Z = ACD + ABCD + ABCD
59
Conclusion
60
Conclusion Active low signals are active when they are low.
2’s Complement represents negative numbers in µP. Boolean Logic and K-Map minimize equations. K-Map simpler, less errors. Both should have same answers.
61
The End Please read:
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.