Raw

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\overline{x}=\neg x and juxtaposition xy=xyxy = x\wedge y.

Throughout, a three-variable Karnaugh map has columns xy, xy, xy, xyxy,\ \overline{x}\,y,\ \overline{x}\,\overline{y},\ x\overline{y} and rows z, zz,\ \overline{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)=(xy)(yz)(xz)f(x,y,z) = (\overline{x} \vee \overline{y})(\overline{y} \vee \overline{z}) \to (\overline{x} \vee \overline{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:

(xy)(yz)=yxz(distributivity)f=(yxz)(xz)=(yxz)xz(AB=AB)=(y(xz))xz(De Morgan)=xyyzxz(distributivity)=xyz.(xxy=xy; zyz=zy)\begin{aligned} (\overline{x} \vee \overline{y})(\overline{y} \vee \overline{z}) &= \overline{y} \vee \overline{x}\,\overline{z} && \text{(distributivity)}\\ f &= (\overline{y} \vee \overline{x}\,\overline{z}) \to (\overline{x} \vee \overline{z}) = \overline{(\overline{y} \vee \overline{x}\,\overline{z})} \vee \overline{x} \vee \overline{z} && \text{(} A\to B=\overline A\vee B\text{)}\\ &= \big(y\,(x \vee z)\big) \vee \overline{x} \vee \overline{z} && \text{(De Morgan)}\\ &= xy \vee yz \vee \overline{x} \vee \overline{z} && \text{(distributivity)}\\ &= \overline{x} \vee y \vee \overline{z}. && \text{(} \overline{x}\vee xy=\overline{x}\vee y;\ \overline{z}\vee yz=\overline{z}\vee y\text{)} \end{aligned}

So the minimal DNF is  f=xyz\ f = \overline{x} \vee y \vee \overline{z}.

(b) Truth table and canonical CNF.

xx yy zz f=xyzf=\overline{x}\vee y\vee\overline{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 00 on the single row (x,y,z)=(1,0,1)(x,y,z)=(1,0,1). Its maxterm complements each variable that is 11 there (xx and zz), giving

canonical CNF: f=(xyz).\text{canonical CNF: } f = (\overline{x} \vee y \vee \overline{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=xyzxyzxyzxyzxyz.\ f = xyz \vee \overline{x}\,\overline{y}\,\overline{z} \vee \overline{x}yz \vee xy\overline{z} \vee \overline{x}y\overline{z}.

Solution. Place the five minterms on the map:

xyxy xy\overline{x}y xy\overline{x}\,\overline{y} xyx\overline{y}
zz 1 1
z\overline{z} 1 1 1

Annotated Karnaugh map for Задача 1: the block-of-four group y and the block-of-two group x-bar z-bar cover every 1

Two groups cover every 11:

  • a block of four — the two yy-columns (xyxy and xy\overline{x}y), both rows; only yy stays constant, so the term is yy;
  • a block of two — row z\overline{z}, columns xy\overline{x}y and xy\overline{x}\,\overline{y}; here x\overline{x} and z\overline{z} stay constant, giving xz\overline{x}\,\overline{z}.

 f=yxz \boxed{\ f = y \vee \overline{x}\,\overline{z}\ }

Задача 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.

xx yy zz FF
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=1F=1 on the rows (1,1,1),(1,0,1),(0,1,0),(0,0,0)(1,1,1),(1,0,1),(0,1,0),(0,0,0), so the canonical DNF is

F=xyzxyzxyzxyz.F = xyz \vee x\overline{y}z \vee \overline{x}y\overline{z} \vee \overline{x}\,\overline{y}\,\overline{z}.

On the map:

xyxy xy\overline{x}y xy\overline{x}\,\overline{y} xyx\overline{y}
zz 1 1
z\overline{z} 1 1

Annotated Karnaugh map for Задача 2: the wrap-around group xz (first and last columns) and the group x-bar z-bar

  • row zz, columns xyxy and xyx\overline{y} (the first and last, adjacent by wrap): only xx and zz stay constant xz\Rightarrow xz;
  • row z\overline{z}, columns xy\overline{x}y and xy\overline{x}\,\overline{y}: x\overline{x} and z\overline{z} stay constant xz\Rightarrow \overline{x}\,\overline{z}.

 F=xzxz \boxed{\ F = xz \vee \overline{x}\,\overline{z}\ }

(As a check, xzxzxz\vee\overline{x}\,\overline{z} is exactly “xx and zz are equal”, which matches every row of the table.)

Задача 3 — minimize with a Karnaugh map (wrap-around)

Simplify  f=xyzxyzxyzxyzxyz.\ f = xyz \vee x\overline{y}z \vee xy\overline{z} \vee x\overline{y}\,\overline{z} \vee \overline{x}y\overline{z}.

Solution. Place the five minterms on the map:

xyxy xy\overline{x}y xy\overline{x}\,\overline{y} xyx\overline{y}
zz 1 1
z\overline{z} 1 1 1

Annotated Karnaugh map for Задача 3: the wrap-around group x (first and last columns, both rows) and the group y z-bar

  • a block of four — the two xx-columns (xyxy and xyx\overline{y}, the first and last, adjacent by wrap), both rows; only xx stays constant x\Rightarrow x;
  • a block of two — row z\overline{z}, columns xyxy and xy\overline{x}y; here yy and z\overline{z} stay constant yz\Rightarrow y\overline{z}.

Every 11 is covered, so (the smaller groups merge by absorption, AAB=AA \vee AB = A)

 f=xyz \boxed{\ f = x \vee y\overline{z}\ }

Задача 4 — Four-variable Karnaugh maps (variants)

Each map below defines a function f(x,y,z,t)f(x,y,z,t): the rows are labelled by xyxy and the columns by ztzt, both in the Gray order 00,01,11,1000,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\ztxy \backslash 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

Annotated 4-variable Karnaugh map for Variant 1: four colour-coded groups and the resulting minimal DNF

Grouping the twelve $1$s:

  • t\overline{t} — the two t=0t=0 columns (00,1000,10), all rows (a block of 88);
  • xyx\overline{y} — row 1010, all columns (a block of 44);
  • xzx\overline{z} — rows 11,1011,10, columns 00,0100,01 (a block of 44);
  • xyz\overline{x}yz — row 0101, columns 11,1011,10 (a block of 22).

 f=txyxzxyz \boxed{\ f = \overline{t} \vee x\overline{y} \vee x\overline{z} \vee \overline{x}yz\ }

CNF: f=(xyt)(xzt)(xyzt).\text{CNF: } f = (x \vee y \vee \overline{t})(x \vee z \vee \overline{t})(\overline{x} \vee \overline{y} \vee \overline{z} \vee \overline{t}).

Variant 2

xy\ztxy \backslash 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

Annotated 4-variable Karnaugh map for Variant 2: three colour-coded groups and the resulting minimal DNF

Groups: yty\overline{t} (rows 01,1101,11, columns 00,1000,10), xt\overline{x}\,\overline{t} (rows 00,0100,01, columns 00,1000,10), and xytx\overline{y}t (row 1010, columns 01,1101,11).

 f=ytxtxyt \boxed{\ f = y\overline{t} \vee \overline{x}\,\overline{t} \vee x\overline{y}t\ }

CNF: f=(xt)(yt)(xyt).\text{CNF: } f = (x \vee \overline{t})(\overline{y} \vee \overline{t})(\overline{x} \vee y \vee t).

Variant 3

xy\ztxy \backslash 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

Annotated 4-variable Karnaugh map for Variant 3: three colour-coded groups and the resulting minimal DNF

Groups: xtxt (rows 11,1011,10, columns 01,1101,11), xt\overline{x}\,\overline{t} (rows 00,0100,01, columns 00,1000,10), and yzt\overline{y}z\overline{t} (rows 00,1000,10, column 1010).

 f=xtxtyzt \boxed{\ f = xt \vee \overline{x}\,\overline{t} \vee \overline{y}z\overline{t}\ }

CNF: f=(xt)(xzt)(xyt).\text{CNF: } f = (x \vee \overline{t})(\overline{x} \vee z \vee t)(\overline{x} \vee \overline{y} \vee t).

Variant 4

xy\ztxy \backslash 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

Annotated 4-variable Karnaugh map for Variant 4: three colour-coded groups and the resulting minimal DNF

Groups: z\overline{z} (the two z=0z=0 columns 00,0100,01, all rows — a block of 88), xyxy (row 1111, all columns), and yt\overline{y}t (rows 00,1000,10, columns 01,1101,11).

 f=zxyyt \boxed{\ f = \overline{z} \vee xy \vee \overline{y}t\ }

CNF: f=(yzt)(xyz).\text{CNF: } f = (y \vee \overline{z} \vee t)(x \vee \overline{y} \vee \overline{z}).

Variant 5

xy\ztxy \backslash 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

Annotated 4-variable Karnaugh map for Variant 5: four colour-coded groups including the four-corners group, and the resulting minimal DNF

Groups: xt\overline{x}\,\overline{t} (rows 00,0100,01, columns 00,1000,10), yt\overline{y}\,\overline{t} (rows 00,1000,10, columns 00,1000,10), xytxyt (row 1111, columns 01,1101,11), and xyz\overline{x}\,\overline{y}\,\overline{z} (row 0000, columns 00,0100,01).

 f=xtytxytxyz \boxed{\ f = \overline{x}\,\overline{t} \vee \overline{y}\,\overline{t} \vee xyt \vee \overline{x}\,\overline{y}\,\overline{z}\ }

CNF: f=(xyt)(xyt)(xzt)(xyt).\text{CNF: } f = (\overline{x} \vee \overline{y} \vee t)(x \vee \overline{y} \vee \overline{t})(x \vee \overline{z} \vee \overline{t})(\overline{x} \vee y \vee \overline{t}).

Задача 5 — a map with don’t-care conditions

A circuit reads a decimal digit as a 4-bit BCD code wxyzwxyz (value 8w+4x+2y+z8w+4x+2y+z) and must output 11 when the digit is 5\ge 5. Codes 1010101011111111 (values 10101515) never occur, so their output is a “don’t-care” ×\times — free to be 00 or 11, whichever minimises the result. Find the minimal DNF.

Rows wxwx, columns yzyz (Gray order); ×\times marks a don’t-care:

wx\yzwx \backslash yz 00 01 11 10
00 0 0 0 0
01 0 1 1 1
11 ×\times ×\times ×\times ×\times
10 1 1 ×\times ×\times

Solution. Treat each ×\times as a 11 only when it enlarges a group. Three groups then cover every required 11:

  • ww — the two w=1w=1 rows (11,1011,10), all columns (a block of 88): the ×\times-row 1111 and the ×\times-cells of row 1010 let wxyw\overline{x}\,\overline{y} (just 8,98,9) grow to the single literal ww;
  • xyxy — rows 01,1101,11, columns 11,1011,10 (covers 6,76,7);
  • xzxz — rows 01,1101,11, columns 01,1101,11 (covers 5,75,7).

 f=wxyxz \boxed{\ f = w \vee xy \vee xz\ }

Every genuine 11 (5,6,7,8,95,6,7,8,9) is covered and no genuine 00 (0044) is; the unused don’t-cares are simply left at 00. (Ignoring the don’t-cares — forcing 10101515 to 00 — would block the ww group and force the longer wxyxyxzw\overline{x}\,\overline{y}\vee xy\vee xz; this is the practical payoff of don’t-cares.)

Practical/Practical4/3classroom.md · 11.4 KB · updated 2026-08-01 18:44