Boolean algebra and Karnaugh map practice
Group the 1s of a Karnaugh map in rectangles of 1, 2, 4 or 8 cells (wrapping round the edges) to read off the minimal sum of products.
Name the law (identity, null, idempotent, complement, absorption, De Morgan); evaluate; simplify.
Which law of Boolean algebra turns A·A into A?
How to solve these
Laws. Identity: X + 0 = X, X·1 = X. Null: X + 1 = 1, X·0 = 0. Idempotent: X + X = X. Complement: X + X′ = 1, X·X′ = 0. Absorption: X + X·Y = X, X·(X + Y) = X, and X + X′·Y = X + Y. De Morgan: (X·Y)′ = X′ + Y′ and (X + Y)′ = X′·Y′: flip every AND and OR and complement every letter.
Karnaugh maps. The rows and columns are labelled in Gray code (00, 01, 11, 10), so cells next to each other, including across the edges, differ in one letter. A rectangle of 2k cells that are all 1 is one product term: keep only the letters that stay the same over the group.
Minimal sum of products. Cover every 1 with as few groups as possible, each as large as possible. Overlaps are fine. An X (don't-care) may join a group when that makes it bigger, and may be left out.
Product of sums. Group the 0s instead. Each group gives one sum term with every letter complemented: a group where A = 1 and B = 0 gives (A′ + B).
Cost. Fewest terms first, then fewest letters (literals). Built from gates, each term of two or more letters is one AND gate, and the terms feed one OR gate.
Worked example
Group the 1s in this Karnaugh map. Which is the minimal sum of products?
Answer: A′·B. Cover every 1 with as few groups as possible, each as large as possible (1, 2, 4 or 8 cells in a rectangle, wrapping round the edges): A′·B (1 cell). So the minimal sum of products is A′·B.
Show the working
- The only 1 is in cell 01 (bits in the order A, B).
- Group them in rectangles of 1, 2, 4 or 8 cells, as large and as few as possible, wrapping round the edges. Each group keeps only the letters that stay the same across its cells: 01 → A′·B.
- Add (OR) the group terms together. Answer: A′·B.
Questions
Why are K-map rows labelled 00, 01, 11, 10?
That is Gray code: neighbouring labels differ in one bit, so neighbouring cells differ in one letter and a pair of them merges into one shorter term. In plain binary order, 01 and 10 would sit side by side and could not be grouped.
What is a don't-care?
An input that never happens, or whose output does not matter. Mark it X and treat it as 1 when that makes a group bigger, or as 0 otherwise.
Can a Karnaugh map have two different minimal answers?
Yes, some maps can be covered in two equally small ways. Every map here is checked to have exactly one minimal form, so only one option can be right.
How are these answers checked?
Each map and expression is generated fresh. A separate test reads the drawn map back, tries every input row, finds the prime implicants with a Quine-McCluskey table and searches every set of them for the smallest cover, then confirms exactly one option matches.