CSE 20 Lecture 16 Boolean Algebra Applications Professor
CSE 20 Lecture 16 Boolean Algebra: Applications Professor CK Cheng CSE Dept. UC San Diego 1
Outlines • • Introduction Light Switches Bit Counter Multiplication Multiplexer Priority Encoder Summary 2
Introduction • • • Language Description Truth Table Karnaugh Map Minimal Expression Digital Logic Networks 3
Light Switches Given two switches A, B with two states (Up, Down), the switches control one light emitter Y. Initially A=B=Down, and Y=Off. The light Y is turned between Off and On when one of the switch changes its state. Describe Y as a function of A and B. Assignment: A, B are in {0, 1} (Down, Up) Y is in {0, 1} (Off, On) 4
Light Switches Truth Table Karnaugh Map Id A B Y 0 0 1 0 1 1 2 1 0 1 3 1 1 0 Y A=0 A=1 B=0 0 1 B=1 1 0 5
Light Switches Minimal Expression in sum of products format. Y(A, B)=A’B+AB’ 6
Bit Counter Input: Three binary bits (A, B, C) Output: (S 1, S 0) that counts the number of 1’s in (A, B, C). Derive minimal expressions of (S 1, S 0). For example: (A, B, C)=(0, 0, 0) => (S 1, S 0)=(0, 0) 0: Binary code (A, B, C)=(1, 1, 0) => (S 1, S 0)=(1, 0) 2: Binary code (A, B, C)=(1, 1, 1) => (S 1, S 0)=(1, 1) 3: Binary code 7
Bit Counter Truth Table Id 0 1 2 3 4 5 6 7 A 0 0 1 1 B 0 0 1 1 C 0 1 0 1 Karnaugh Map S 1 S 0 0 1 0 1 1 S 1 B, C 0, 0 0, 1 1, 0 A=0 0 0 1 0 A=1 0 1 1 1 S 0 B, C 0, 0 0, 1 1, 0 A=0 0 1 A=1 1 0 8
Bit Counter Karnaugh Map S 1 B, C 0, 0 0, 1 1, 0 A=0 0 0 1 0 A=1 0 1 1 1 S 0 B, C 0, 0 0, 1 1, 0 A=0 0 1 A=1 1 0 1 S 1=AB+BC+AC S 0=AB’C’+ABC+ A’B’C+A’BC’ 0 9
Multiplication Input: Two binary numbers (a 1, a 0), (b 1, b 0) Output: (s 3, s 2, s 1, s 0) product of the two numbers. Derive minimal expressions of (s 3, s 2, s 1, s 0). For example: (a 1, a 0)×(b 1, b 0) = (s 3, s 2, s 1, s 0) (0, 0)×(0, 0) = (0, 0, 0, 0) (1, 0)×(0, 1) = (0, 0, 1, 0) (1, 1)×(1, 0) = (0, 1, 1, 0) (1, 1)×(1, 1) = (1, 0, 0, 1) 10
Multiplication: Truth Table Karnaugh Maps are left as exercises. Id a 1 a 0 b 1 b 0 s 3 s 2 s 1 s 0 0 0 0 0 1 0 0 0 0 2 0 0 1 0 0 0 3 0 0 1 1 0 0 4 0 1 0 0 0 5 0 1 0 0 0 1 6 0 1 1 0 0 0 1 0 7 0 1 1 1 0 0 1 1 8 1 0 0 0 0 9 1 0 0 1 0 10 1 0 0 11 1 0 12 1 1 0 0 0 13 1 1 0 0 1 1 14 1 1 1 0 0 1 1 0 15 1 1 1 0 0 1 11
Multiplication Input: Two binary numbers (a 1, a 0), (b 1, b 0) Output: (s 3, s 2, s 1, s 0) product of the two numbers. A minimal expression: s 3=a 1 a 0 b 1 b 0 s 2=a 1 b 1 b 0’+a 1 a 0’b 1 s 1=a 1’a 0 b 1+a 0 b 1 b 0’+a 1 a 0’b 0+a 1 b 1’b 0 s 0=a 0 b 0 Verification: (a 1, a 0), (b 1, b 0) are symmetric in the expressions. 12
Multiplexer Input: Three binary bits S (select), A, B (data) Output: Y If S=0, then Y=B; else Y=A. For example: (S, A, B)=(0, 1, 0) => Y= 0. (S, A, B)=(1, 1, 0) => Y= 1. (S, A, B)=(1, 0, 1) => Y= 0. 13
Multiplexer Truth Table Id 0 1 2 3 4 5 6 7 S 0 0 1 1 A 0 0 1 1 Karaugh Map B 0 1 0 1 Y 0 1 0 0 1 1 Y AB AB 0, 0 0, 1 1, 0 S=0 0 1 1 0 S=1 0 0 1 1 Y=S’B+SA 14
Multiplexer Input: Three binary bits S (select), A, B (data) Output: Y If S=0, then Y=B; else Y=A. Minimal Expression: Y=S’B+SA 15
Priority Encoder Input: Three binary bits E (Enable), D 1, D 0 (Devices IDs) Output: A, Y If E=0, then A=Y=0; Else if D 0=1, A=1, Y=0; (Let Device 0 take higher priority) Else if D 1=1, A=1, Y=1; Else A=0, Y=0. For example: (E, D 1, D 0)=(0, 1, 0) => Y= 0, A=0. (E, D 1, D 0)=(1, 0, 1) => Y= 0, A=1. (E, D 1, D 0)=(1, 1, 0) => Y= 1, A=1. (E, D 1, D 0)=(1, 0, 0) => Y= 0, A=0. 16
Priority Encoder Truth Table Id 0 1 2 3 4 5 6 7 E 0 0 1 1 D 1 0 0 1 1 Karaugh Maps D 0 0 1 0 1 A 0 0 0 1 1 1 Y 0 0 0 1 0 Y D 1 D 0 0, 1 1, 1 0, 0 D 1 D 0 1, 0 E=0 0 0 E=1 0 0 0 1 A D 1 D 0 0, 1 1, 1 0, 0 D 1 D 0 1, 0 E=0 0 0 E=1 0 1 17
Priority Encoder Input: Three binary bits E (Enable), D 1, D 0 Output: A, Y If E=0, then A=Y=0; Else if D 0=1, A=1, Y=0; Else if D 1=1, A=1, Y=1; Else A=0, Y=0. Minimal Expression: Y=ED 1 D 0’ A=ED 1+ED 0 18
Quiz • For the above Priority Encoder, let D 1 take higher priority. Derive the minimal expression of the outputs A and Y. 19
Summary • Language Description • Combinatorial Systems • Truth Table • #variables <7 • Karnaugh Maps • Two level optimization • Minimal Expressions • Logic Networks 20
- Slides: 20