3. Classroom tasks and solutions / Аудиторні задачі та розв’язання
Source of tasks. The problems below are taken exactly from the
practical-class assignment for this topic (minimization of Boolean functions);
only the wording has been translated to English. The worked example below
demonstrates the full method (algebraic minimization → truth table → canonical
CNF); Задача 1–4 are the tasks to solve, each minimized with a Karnaugh
map. Every task is followed by a complete solution. Theory and the
laws of Boolean algebra are in 2method.md; recall the overline
x=¬x and juxtaposition xy=x∧y.
Throughout, a three-variable Karnaugh map has columns xy, xy, xy, xy and rows z, z; remember
that the first and last columns are adjacent (wrap-around).
Worked example — algebraic minimization and the canonical CNF
For f(x,y,z)=(x∨y)(y∨z)→(x∨z): (a) find a minimal DNF by transformation;
(b) build the truth table and write the canonical CNF.
(a) Minimal DNF. First simplify the antecedent by distributivity, then
eliminate the implication and push the negation inward:
(x∨y)(y∨z)f=y∨xz=(y∨xz)→(x∨z)=(y∨xz)∨x∨z=(y(x∨z))∨x∨z=xy∨yz∨x∨z=x∨y∨z.(distributivity)(A→B=A∨B)(De Morgan)(distributivity)(x∨xy=x∨y; z∨yz=z∨y)
So the minimal DNF is f=x∨y∨z.
(b) Truth table and canonical CNF.
| x |
y |
z |
f=x∨y∨z |
| 0 |
0 |
0 |
1 |
| 0 |
0 |
1 |
1 |
| 0 |
1 |
0 |
1 |
| 0 |
1 |
1 |
1 |
| 1 |
0 |
0 |
1 |
| 1 |
0 |
1 |
0 |
| 1 |
1 |
0 |
1 |
| 1 |
1 |
1 |
1 |
The function is 0 on the single row (x,y,z)=(1,0,1). Its maxterm
complements each variable that is 1 there (x and z), giving
canonical CNF: f=(x∨y∨z).
(With only one zero, the canonical CNF is a single maxterm — here identical to the
minimal DNF.)
Задача 1 — minimize with a Karnaugh map
Simplify f=xyz∨xyz∨xyz∨xyz∨xyz.
Solution. Place the five minterms on the map:
|
xy |
xy |
xy |
xy |
| z |
1 |
1 |
|
|
| z |
1 |
1 |
1 |
|

Two groups cover every 1:
- a block of four — the two y-columns (xy and xy), both rows;
only y stays constant, so the term is y;
- a block of two — row z, columns xy and
xy; here x and z stay
constant, giving xz.
f=y∨xz
Задача 2 — canonical DNF from a truth table, then minimize
For the function given by the truth table, write the canonical DNF, draw the
Karnaugh map, and simplify.
| x |
y |
z |
F |
| 0 |
0 |
0 |
1 |
| 0 |
0 |
1 |
0 |
| 0 |
1 |
0 |
1 |
| 0 |
1 |
1 |
0 |
| 1 |
0 |
0 |
0 |
| 1 |
0 |
1 |
1 |
| 1 |
1 |
0 |
0 |
| 1 |
1 |
1 |
1 |
Solution. F=1 on the rows (1,1,1),(1,0,1),(0,1,0),(0,0,0), so the canonical DNF is
F=xyz∨xyz∨xyz∨xyz.
On the map:
|
xy |
xy |
xy |
xy |
| z |
1 |
|
|
1 |
| z |
|
1 |
1 |
|

- row z, columns xy and xy (the first and last, adjacent by
wrap): only x and z stay constant ⇒xz;
- row z, columns xy and xy:
x and z stay constant ⇒xz.
F=xz∨xz
(As a check, xz∨xz is exactly “x and z are equal”,
which matches every row of the table.)
Задача 3 — minimize with a Karnaugh map (wrap-around)
Simplify f=xyz∨xyz∨xyz∨xyz∨xyz.
Solution. Place the five minterms on the map:
|
xy |
xy |
xy |
xy |
| z |
1 |
|
|
1 |
| z |
1 |
1 |
|
1 |

- a block of four — the two x-columns (xy and xy, the first
and last, adjacent by wrap), both rows; only x stays constant ⇒x;
- a block of two — row z, columns xy and xy; here
y and z stay constant ⇒yz.
Every 1 is covered, so (the smaller groups merge by absorption, A∨AB=A)
f=x∨yz
Задача 4 — Four-variable Karnaugh maps (variants)
Each map below defines a function f(x,y,z,t): the rows are labelled by xy and
the columns by zt, both in the Gray order 00,01,11,10. Minimise each function
to a DNF by grouping the $1$s; the minimal CNF (from grouping the $0$s) is given as
well. Wrap-around adjacency applies to both rows and columns.
Variant 1
| xy\zt |
00 |
01 |
11 |
10 |
| 00 |
1 |
0 |
0 |
1 |
| 01 |
1 |
0 |
1 |
1 |
| 11 |
1 |
1 |
0 |
1 |
| 10 |
1 |
1 |
1 |
1 |

Grouping the twelve $1$s:
- t — the two t=0 columns (00,10), all rows (a block of 8);
- xy — row 10, all columns (a block of 4);
- xz — rows 11,10, columns 00,01 (a block of 4);
- xyz — row 01, columns 11,10 (a block of 2).
f=t∨xy∨xz∨xyz
CNF: f=(x∨y∨t)(x∨z∨t)(x∨y∨z∨t).
Variant 2
| xy\zt |
00 |
01 |
11 |
10 |
| 00 |
1 |
0 |
0 |
1 |
| 01 |
1 |
0 |
0 |
1 |
| 11 |
1 |
0 |
0 |
1 |
| 10 |
0 |
1 |
1 |
0 |

Groups: yt (rows 01,11, columns 00,10), xt
(rows 00,01, columns 00,10), and xyt (row 10, columns 01,11).
f=yt∨xt∨xyt
CNF: f=(x∨t)(y∨t)(x∨y∨t).
Variant 3
| xy\zt |
00 |
01 |
11 |
10 |
| 00 |
1 |
0 |
0 |
1 |
| 01 |
1 |
0 |
0 |
1 |
| 11 |
0 |
1 |
1 |
0 |
| 10 |
0 |
1 |
1 |
1 |

Groups: xt (rows 11,10, columns 01,11), xt (rows
00,01, columns 00,10), and yzt (rows 00,10, column
10).
f=xt∨xt∨yzt
CNF: f=(x∨t)(x∨z∨t)(x∨y∨t).
Variant 4
| xy\zt |
00 |
01 |
11 |
10 |
| 00 |
1 |
1 |
1 |
0 |
| 01 |
1 |
1 |
0 |
0 |
| 11 |
1 |
1 |
1 |
1 |
| 10 |
1 |
1 |
1 |
0 |

Groups: z (the two z=0 columns 00,01, all rows — a block of 8),
xy (row 11, all columns), and yt (rows 00,10, columns 01,11).
f=z∨xy∨yt
CNF: f=(y∨z∨t)(x∨y∨z).
Variant 5
| xy\zt |
00 |
01 |
11 |
10 |
| 00 |
1 |
1 |
0 |
1 |
| 01 |
1 |
0 |
0 |
1 |
| 11 |
0 |
1 |
1 |
0 |
| 10 |
1 |
0 |
0 |
1 |

Groups: xt (rows 00,01, columns 00,10),
yt (rows 00,10, columns 00,10), xyt (row 11,
columns 01,11), and xyz (row 00, columns
00,01).
f=xt∨yt∨xyt∨xyz
CNF: f=(x∨y∨t)(x∨y∨t)(x∨z∨t)(x∨y∨t).
Задача 5 — a map with don’t-care conditions
A circuit reads a decimal digit as a 4-bit BCD code wxyz (value 8w+4x+2y+z) and
must output 1 when the digit is ≥5. Codes 1010–1111 (values 10–15) never
occur, so their output is a “don’t-care” × — free to be 0 or 1, whichever
minimises the result. Find the minimal DNF.
Rows wx, columns yz (Gray order); × marks a don’t-care:
| wx\yz |
00 |
01 |
11 |
10 |
| 00 |
0 |
0 |
0 |
0 |
| 01 |
0 |
1 |
1 |
1 |
| 11 |
× |
× |
× |
× |
| 10 |
1 |
1 |
× |
× |
Solution. Treat each × as a 1 only when it enlarges a group. Three groups
then cover every required 1:
- w — the two w=1 rows (11,10), all columns (a block of 8): the ×-row 11
and the ×-cells of row 10 let wxy (just 8,9) grow to
the single literal w;
- xy — rows 01,11, columns 11,10 (covers 6,7);
- xz — rows 01,11, columns 01,11 (covers 5,7).
f=w∨xy∨xz
Every genuine 1 (5,6,7,8,9) is covered and no genuine 0 (0–4) is; the unused
don’t-cares are simply left at 0. (Ignoring the don’t-cares — forcing 10–15 to 0 —
would block the w group and force the longer wxy∨xy∨xz;
this is the practical payoff of don’t-cares.)
Practical/Practical4/3classroom.md · 11.4 KB · updated 2026-08-01 18:44