200 likes | 210 Views
Explore applications of Boolean algebra in digital logic networks including light switches, bit counters, multiplication, multiplexers, and priority encoders. Learn how to derive minimal expressions using truth tables and Karnaugh maps.
E N D
CSE20 Lecture 16Boolean Algebra: Applications Professor CK Cheng CSE Dept. UC San Diego 1
Outlines • Introduction • Light Switches • Bit Counter • Multiplication • Multiplexer • Priority Encoder • Summary
Introduction • Language Description • Truth Table • Karnaugh Map • Minimal Expression • Digital Logic Networks
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 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: (S1,S0) that counts the number of 1’s in (A, B, C). Derive minimal expressions of (S1,S0). For example: (A,B,C)=(0,0,0) => (S1,S0)=(0,0) 0: Binary code (A,B,C)=(1,1,0) => (S1,S0)=(1,0) 2: Binary code (A,B,C)=(1,1,1) => (S1,S0)=(1,1) 3: Binary code
Bit Counter Truth Table Karnaugh Map 8
Bit Counter Karnaugh Map S1=AB+BC+AC S0=AB’C’+ABC+ A’B’C+A’BC’ 9
Multiplication Input: Two binary numbers (a1,a0), (b1,b0) Output: (s3,s2,s1,s0) product of the two numbers. Derive minimal expressions of (s3,s2,s1,s0). For example: (a1,a0)×(b1,b0) = (s3,s2,s1,s0) (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)
Multiplication: Truth TableKarnaugh Maps are left as exercises. 11
Multiplication Input: Two binary numbers (a1,a0), (b1,b0) Output: (s3,s2,s1,s0) product of the two numbers. A minimal expression: s3=a1a0b1b0 s2=a1b1b0’+a1a0’b1 s1=a1’a0b1+a0b1b0’+a1a0’b0+a1b1’b0 s0=a0b0 Verification: (a1,a0), (b1,b0) are symmetric in the expressions.
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.
Multiplexer Truth Table Karaugh Map Y=S’B+SA
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
Priority Encoder Input: Three binary bits E (Enable), D1, D0 (Devices IDs) Output: A, Y If E=0, then A=Y=0; Else if D0=1, A=1, Y=0; (Let Device 0 take higher priority) Else if D1=1, A=1, Y=1; Else A=0, Y=0. For example: (E,D1,D0)=(0,1,0) => Y= 0, A=0. (E,D1,D0)=(1,0,1) => Y= 0, A=1. (E,D1,D0)=(1,1,0) => Y= 1, A=1. (E,D1,D0)=(1,0,0) => Y= 0, A=0.
Priority Encoder Truth Table Karaugh Maps
Priority Encoder Input: Three binary bits E (Enable), D1, D0 Output: A, Y If E=0, then A=Y=0; Else if D0=1, A=1, Y=0; Else if D1=1, A=1, Y=1; Else A=0, Y=0. Minimal Expression: Y=ED1D0’ A=ED1+ED0
Quiz • For the above Priority Encoder, let D1 take higher priority. Derive the minimal expression of the outputs A and Y.
Summary • Language Description • Combinatorial Systems • Truth Table • #variables <7 • Karnaugh Maps • Two level optimization • Minimal Expressions • Logic Networks 20