Quiz 2

Boolean Algebra and K-Maps

862 words
4 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Boolean Algebra and K-Maps ## 🎯 Learning Objectives - Apply Boolean algebra laws to simplify expressions - Use K-maps for 2, 3, and 4 variable minimization - Handle don't-care conditions in K-maps - Implement minimized expressions with logic gates * * * ## 1. Boolean Algebra Laws Law Expression Identity A + 0 = A...

Boolean Algebra and K-Maps

🎯 Learning Objectives

  • Apply Boolean algebra laws to simplify expressions
  • Use K-maps for 2, 3, and 4 variable minimization
  • Handle don't-care conditions in K-maps
  • Implement minimized expressions with logic gates

1. Boolean Algebra Laws

LawExpression
IdentityA + 0 = A, A · 1 = A
ComplementA + Ā = 1, A · Ā = 0
IdempotentA + A = A, A · A = A
DominanceA + 1 = 1, A · 0 = 0
AbsorptionA + AB = A, A(A + B) = A
De Morgan(A + B)̄ = Ā · B̄, (AB)̄ = Ā + B̄
DistributiveA(B + C) = AB + AC
ConsensusAB + ĀC + BC = AB + ĀC

2. K-Map Simplification

2.1 2-Variable K-Map

F(A, B) = ĀB̄ + ĀB + AB
A\B01
011
101
Groups: Ā (both cells in row 0), B (cells B=1) Result: F = Ā + B

2.2 3-Variable K-Map

F(A, B, C) = Σm(0, 1, 2, 5, 7)
AB\C01
0011
0110
1101
1001
Groups:
  • m0+m1 (C=0, AB=00+01): pulls in ĀB̄C̄+ĀB̄... Wait, let me redo. Better: 3-variable K-map Gray code order:
BC\A01
0010 (m0, m4)
0111 (m1, m5)
1101 (m3, m7)
1010 (m2, m6)
Groups:
  • Ā: m0, m1, m2 = Σ(0,1,2) (all in A=0 column except... wait, A=0 includes rows 00,01,11,10 for BC). Actually m0(000)=1, m1(001)=1, m2(010)=0, m3(011)=0. So Ā doesn't cover all — m2 is 0.
  • Let me redo the function: F = Σ(0,1,5,7) = m0 + m1 + m5 + m7
BC\A01
0010
0110
1101
1001
Groups:
  • ĀB̄: m0 + m1 = ĀB̄
  • AC: m5 + m7 = AC Result: F = ĀB̄ + AC

2.3 4-Variable K-Map

F(A, B, C, D) = Σm(0, 2, 3, 5, 7, 8, 10, 11, 13, 15)
CD\AB00011110
001001
010110
111111
101001
Groups:
  • Corners: m0, m2, m8, m10 = B̄D̄
  • Center 2×2: m5, m7, m13, m15 = BD
  • m3, m11 = ĀCD Wait, m3=0011=3, yes. m11=1011=11, yes. ĀCD? A=0,C=1,D=1 → m3. A=1,C=1,D=1 → m11. So A variable differs → can't combine as ĀCD. Actually CD=11 with B varying: m3(A=0,B=1,C=1,D=1), m11(A=1,B=1,C=1,D=1). That gives BD? No — B=1,D=1 and C=1 both times. So it's BCD for both. But we can also combine m3 with m2 (0010) for ĀC̄D... wait. Let me simplify: F = B̄D̄ + BD + CD Check: B̄D̄ covers m0, m2, m8, m10. BD covers m5, m7, m13, m15. CD covers m3, m7, m11, m15. Total unique minterms: 0,2,3,5,7,8,10,11,13,15 = matches! ✓

3. Don't-Care Conditions

Don't-cares (X) can be assigned 0 or 1 to form larger groups. Example: F(A,B,C,D) = Σm(1,3,7,11,15) + d(0,2,5)
CD\AB00011110
00X00X
011X00
111110
100000
Using X at m0,m2 (ĀB̄C̄) gives group: ĀB̄. Using X at m5 gives group: BD. Result: F = ĀB̄ + BD

4. Common Pitfalls

Pitfall: Wrong Group Sizes in K-Map

The mistake: Creating groups of 3, 5, or 6 cells. Correct approach: Groups must be powers of 2 (1, 2, 4, 8, 16) and rectangular. Groups of 3 are invalid — they don't correspond to any single product term.

5. Key Concepts Reference

ConceptDescription
LiteralVariable or its complement
MintermProduct of all variables (AND)
ImplicantProduct term covering minterms
Prime implicantImplicant not contained in larger one
Essential prime implicantCovers a minterm no other PI covers
Don't careOutput doesn't matter for this input

6. 📝 Practice Questions

Q1: Simplify F = ĀB̄C + ĀBC + ABC + AB̄C using Boolean algebra.
Answer: F = ĀC(B̄+B) + AC(B+B̄) F = ĀC(1) + AC(1) F = C(Ā + A) = C
So F = C — only depends on C, not A or B! Q2: Use K-map: F = Σm(0, 1, 4, 5, 6, 7) for F(A, B, C).
Answer:
BC\A01
0011
0111
1101
1001
Groups: B̄ (m0+m1+m4+m5=all where B=0), A (m4+m5+m6+m7=all where A=1) Result: F = B̄ + A = A + B̄ Q3: Apply De Morgan's: F = (A + BC)̄
Answer: (A + BC)̄ = Ā · (BC)̄ = Ā · (B̄ + C̄) = ĀB̄ + ĀC̄ Q4: Simplify using K-map with don't-cares: F = Σm(2,3,7,9) + d(0,1,10,11,15) for F(A,B,C,D).
Answer: Don't-cares allow large groups. All ones and don't-cares can be grouped: Corners m0,m2,m8,m10 (using d0,d10) = B̄D̄. m3,m7,m11,m15 (using d11,d15) = CD. m9 = 1001 = ĀC̄D? Wait, m9=1001: A=1,B=0,C=0,D=1. Using d10(1010),d11(1011), we get group with m9,m11 for AD. F = B̄D̄ + CD + AD.
Actually let me be more careful. F = B̄D̄ + CD (using d0,d2,d10 for B̄D̄, d11,d15 for CD, and maybe more). The expression F = B̄D̄ + CD covers m2,m3,m7,m9? m9=1001 is not covered by B̄D̄ (B=0,D=1 → B≠0) or CD (C=0,D=1 → C≠1). So m9 needs separate term: m9 = AB̄C̄D = ĀB̄C̄D? No, m9 has A=1, B=0, C=0, D=1. Using d10(1010) = AB̄CD̄ and d11(1011) = AB̄CD, we get group A B̄ D covers m9,m11. So F = B̄D̄ + CD + AB̄D.

7. 🔗 Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.