How to Solve 5-Variable K-Maps?

Last Modified:

Is it Practical to Solve or Simplify 5-Input Functions Using Manual K-maps?

Once we reach circuits with five or more inputs, manual simplification becomes increasingly impractical. That’s why Electronic Design Automation (EDA) tools are essential for handling complex logic efficiently. Even in academic contexts, most textbooks limit Karnaugh map discussions to four variables—beyond that, the process becomes too cumbersome for hand-solving. We’ll briefly explore 5-variable K-maps here to highlight just how tedious they are to work with. As the number of inputs grows to six or more, the complexity escalates exponentially, making manual methods virtually unmanageable.

Layouts of a 5-Input K-Map

A 5-input Karnaugh map involves five variables, resulting in 32 cells labeled with minterms from \(\mathsf{m_0}\) to \(\mathsf{m_{31}}\). There are several layout options for organizing these cells—such as \(\mathsf{2\times{}16,4\times{}8,8\times{}4,\textsf{ or }16\times{}2}\). However, if you’re already familiar with the \(\mathsf{4\times{}4}\) layout used for 4-variable maps, you can extend that approach by stacking two \(\mathsf{4\times{}4}\) maps (\(\mathsf{2\times{}4\times{}4}\)): one in front and one behind. In this configuration, the fifth variable typically serves as a selector—set to 0 for the front map and 1 for the back.

This method keeps the structure compact, avoiding more than four rows or columns, and preserves the familiar minterm ordering. It also simplifies visual grouping and pattern recognition. For comparison, a \(\mathsf{4\times{}8}\) layout is also commonly used and shown below.

To illustrate layout equivalence, we’ll briefly explore the \(\mathsf{4\times{}8}\) form in the Frequently Asked Questions section and explain why it may not be ideal for all scenarios.

As with 2‑ and 3‑input K‑maps, Gray codes are used to label both axes, ensuring that adjacent cells differ by only one bit. Furthermore, each cell position in the front and back maps are also adjacent as they differ by one bit of A. Each cell in the shown layout mentions the input combination relevant to it.

this image shows the labeling of the rows and columns of a 5-input k-map in gray code form and the corresponding input combinations in each cell

Alternative Labeling

In some K-map layouts, the row and column labels are presented not as Gray codes, but directly as complemented and uncomplemented variables. However, Gray code ordering still governs the cell arrangement to preserve adjacency. These variable-based labels may offer a more intuitive bridge between the map and the original Boolean function, and may appeal more to some readers. A 5-variable K-map with alternative labels and input combinations, is shown here:

this image shows the labeling of the rows and columns of a 5-input k-map using input literals and the corresponding input combinations in each cell

Minterms in a 5-Variable K-map

In the figure below, each cell is annotated with its corresponding minterm, determined by the input combination specified by the variables’ row and column labels,.

this image shows the minterms placement in a 5-input k-map

Adjacency Discussion

When we move to 5-input K-maps, the \(\mathsf{4\times{}4}\) layout is preserved—but now we use two stacked layers: a front and a back \(\mathsf{4\times{}4}\) grid. The fifth variable acts as a selector between these layers:

  • The front layer corresponds to the fifth variable being 0.
  • The back layer corresponds to the fifth variable being 1.

Each cell in the front map is adjacent to its counterpart in the back map, since they differ by only the fifth variable. This introduces a new dimension of adjacency—vertical adjacency across layers—which allows for forming valid implicants that span both maps.

For example:

  • A pair can consist of one cell in the front and its matching cell in the back.
  • A quad might include two cells in the front and two in the back.
  • An octet could span across both layers, wrapping around edges and layers simultaneously.

This layered adjacency means that even if two 1s appear in the same position across both maps, they can be grouped—just like edge-wrapping in 2D, this is a form of depth-wrapping in 3D.

In diagrams, using green to highlight the top and bottom edges and orange for the left and right—paired with double-headed arrows—clearly illustrates the wrap-around adjacency in the K-map. To show vertical adjacency between the front and back maps, matching cells are color-coded identically across both layers. This visual strategy helps learners recognize that 1s located on opposite edges or in corresponding positions across layers can still form valid implicants, even if they appear disconnected in the flat layout.

this image shows the adjacency of the border minterms in 5-input k-map

Example 1: Construct a 5-input K-map

Construct a K-map for the function \(\mathsf{Z=\sum\left(0,8\right)}\)

this image shows the solution of the given function in 2x4x4 5-input k-map

Example 2: Construct a 5-input K-map

Construct a K-map for the function \(\mathsf{Z=\sum\left(0,8,16\right)}\) and \(\mathsf{m_{24}}\) is a Don’t Care, \(\mathsf{X}\).

this image shows the solution of the given function in 2x4x4 5-input k-map

How to Solve a K-map?

This section outlines the general procedure for solving a K‑map, illustrated first with a simple 2‑input example. Starting with this basic case ensures that anyone can grasp the core concepts, regardless of which page they begin on. More complex examples—matching the number of inputs featured on the page—are introduced afterwards. To explore specific cases in detail, select the relevant page for 2‑, 3‑, 4‑, or 5‑input K‑maps. For an overall introduction to K‑maps, Gray codes, and minterms ordering, refer to their dedicated pages or sections.

The following steps are followed while solving a K-map.

  1. Identify Implicants: Identify groups of adjacent 1s that can be grouped in powers of 2 (1, 2, 4, 8, …).
  2. Make Prime Implicants: Form largest possible groups that collectively include all the relevant minterms.
  3. Determine the Product Term: For each group, determine the variable(s) that remain constant across it.
  4. Write Minimum Cost Solution: Combine terms using OR to generate the solution in SOP form.

In more precise terms, the process of grouping the largest possible sets of minterms in powers of two is essentially the search for prime implicants among all possible implicants. The resulting Sum of Products (SOP) expression is considered to be in its simplest form when it achieves the minimum cost—typically measured in terms of the fewest possible literals or logic gates required for implementation.

Step 1: Identify Implicants

An implicant is simply a product term that describes one or more specific input combinations where the function’s output is 1. The simplest implicants are the individual minterms. However, implicants aren’t limited to single minterms — by combining adjacent implicants in groups whose sizes are powers of two, we can form larger implicants that cover more minterms while still remaining valid.

We will explain the process with the help of a \(\mathsf{2\times{}2}\) 2-inputk-map for ease. Consider the following K‑map:

this image shows an example for understanding implicants and prime implicants

It contains a total of five implicants as highlighted in the figure. Of these, three are individual minterms, while the other two arise from grouping pairs of adjacent 1’s, \(\mathsf{m_0,m_2}\) and \(\mathsf{m_2,m_3}\), each forming a valid implicant.

this image shows the implicants and prime implicants of the given function

Step 2: Make Prime Implicants

A prime implicant is an implicant that cannot be combined with any other implicant to form a larger valid group. In a K‑map, it represents the largest possible block of 1’s that contains no 0’s. It may or may not cover all the 1’s in the map, and in most cases, multiple prime implicants exist. In the above example, the two implicants which are formed by the groupings of \(\mathsf{m_0\textsf{ & }m_2}\), and \(\mathsf{m_2\textsf{ & }m_3}\), are the prime implicants.

Step 3: Determine the Product Term for Each Prime Implicant

To determine the product term for each prime implicant, identify the variables that remain constant across all 1’s in that group. Iteratively check each variable, and drop any literal that changes within the grouping. The remaining literals — whether in complemented or uncomplemented form — represent the constant variables for that largest valid block.

In the example, for the first prime implicant, covering minterms \(\mathsf{m_0}\) and \(\mathsf{m_2}\), input B is fixed at 0 across both minterms, while A changes from 0 in \(\mathsf{m_0}\) to 1 in \(\mathsf{m_2}\). Since A varies, it is dropped. The constant B = 0 corresponds to the literal \(\mathsf{B’}\).

this image shows the first prime implicant in the discussed example

For the second prime implicant, covering minterms \(\mathsf{m_2}\) and \(\mathsf{m_3}\), A remains fixed at 1 in both cases, while B changes. Thus, A = 1 is retained, giving the product term \(\mathsf{A}\).

this image shows the second prime implicant in the discussed example

Step 4: Write Minimum Cost Solution

Once all essential prime implicants have been selected, the final Boolean expression is obtained by combining their corresponding product terms using the OR operator (\(\mathsf{+}\)). If there are remaining prime implicants that can be included in multiple ways at equal minimal cost, any such combination may be chosen, as all yield functionally equivalent minimal solutions. The simplest function is:

\[\mathsf{Z=A+B’}\]

Example 3: Express the given function with 5-inputs in the simplest form \(\mathsf{Z=\sum\left(0,8\right)}\)

We draw the K-map, show the prime implicants (largest possible groupings of adjacent 1s in powers of 2) on it and then write the simplest function. The simplest function comes out to be \(\mathsf{Z=A’C’D’E’}\). This is obtained by joining the minterms \(\mathsf{m_0}\) and \(\mathsf{m_8}\) around the top and bottom edge of the front map, as shown in the picture.

this image shows the largest groupings for the given example

Example 4: Express the given function with 5-inputs in the simplest form \(\mathsf{Z=\sum\left(0,8,16,24\right)}\)

In both the front and back maps, we can initially form two pairs: \(\mathsf{m_0}\) and \(\mathsf{m_8}\) in the front layer, and \(\mathsf{m_{16}}\) and \(\mathsf{m_{24}}\) in the back. However, since these minterms occupy identical positions in their respective maps—and are highlighted with the same background color—they can be grouped together into a single quad. This four-cell grouping spans both layers and reflects adjacency through the fifth variable.

Analyzing the group, we observe that variables \(\mathsf{A}\) and \(\mathsf{B}\) vary across the cells, while \(\mathsf{C,D,\textsf{ and }E}\) remain constant. This yields the simplified output term: \(\mathsf{Z=C’D’E’}\).

this image shows the largest groupings for the given example

Example 5: Express the given function with 5-inputs in the simplest form \(\mathsf{Z=\sum\left(0,2,8,10,\right.}\)\(\mathsf{\left.16,18,26\right)}\) with \(\mathsf{X}\) at \(\mathsf{m_{24}}\)

This function presents an interesting case. Minterms \(\mathsf{m_0,m_2,m_8,}\) and \(\mathsf{m_{10}}\) occupy the four corners of the front map, allowing us to group them into a quad that simplifies to \(\mathsf{A’C’E’}\). On the back map, we can treat the \(\mathsf{X}\) at \(\mathsf{m_{24}}\) as a \(\mathsf{1}\) and combine it with \(\mathsf{m_{16},m_{18},}\) and \(\mathsf{m_{26}}\)—again forming a corner quad, which simplifies to \(\mathsf{AC’E’}\).

Since both quads occupy identical positions across the front and back maps—highlighted by matching background colors—they can be merged into a single octet. This expanded grouping eliminates the variable \(\mathsf{A}\) entirely, leaving us with the final simplified term: \(\mathsf{Z=C’E’}\).

The groupings are illustrated in the figure, showing how spatial symmetry and layer adjacency contribute to deeper simplification.

this image shows the largest groupings for the given example

Example 6: Express the given function with 5-inputs in the simplest form \(\mathsf{Z=\sum\left(6,\right.}\)\(\mathsf{\left.7,\right.}\)\(\mathsf{\left.8,\right.}\)\(\mathsf{\left.9,\right.}\)\(\mathsf{\left.12,\right.}\)\(\mathsf{\left.13,\right.}\)\(\mathsf{\left.22,\right.}\)\(\mathsf{\left.23,\right.}\)\(\mathsf{\left.24,\right.}\)\(\mathsf{\left.25,\right.}\)\(\mathsf{\left.28,\right.}\)\(\mathsf{\left.29\right)}\)

We can form a quad by combining the corresponding octets: \(\mathsf{m_8,m_9,m_{12},}\) and \(\mathsf{m_{13}}\) from the front map with \(\mathsf{m_{24},m_{25},m_{28},}\) and \(\mathsf{m_{29}}\) from the back. Since these minterms align perfectly across both layers, they form a valid group that simplifies to \(\mathsf{BD’}\).

Another quad emerges by joining the pairs \(\mathsf{m_6}\) and \(\mathsf{m_7}\) from the front with \(\mathsf{m_{22}}\) and \(\mathsf{m_{23}}\) from the back. This grouping simplifies to \(\mathsf{B’CD}\).

Together, these two quads yield the final simplified function: \(\mathsf{Z=BD’+B’CD}\).

this image shows the largest groupings for the given example

Frequently Asked Questions

Do we get different final results by using a different layout of K-maps?

No. It should be noted that it’s unnecessary to solve the function in every possible K‑map layout — for instance, both the \(\mathsf{2\times{}4}\) and \(\mathsf{4\times{}2}\) arrangements of a 3‑input K‑map, or \(\mathsf{4\times{}4}\) and \(\mathsf{2\times{}8}\) and \(\mathsf{8\times{}2}\) of a 4-variable K-map or \(\mathsf{2\times{}4\times{}4}\) and \(\mathsf{4\times{}8}\) of a 5-variable K-map. A single correctly applied layout is sufficient, as all valid layouts will produce the same result.

Are there layouts of a 5-input K-map other than the standard \(\mathsf{2\times{}4\times{}4}\) form?

Yes. A 5‑input K‑map, can exist in a \(\mathsf{4\times{}8, 2\times{16},16\times{}2}\) or \(\mathsf{8\times{}4}\) layouts other than the standard \(\mathsf{2\times{}4\times{}4}\) form. However, \(\mathsf{2\times{}4\times{}4}\) layout is the standard shape and easiest to work with. The minterms in a \(\mathsf{4\times{}8}\) layout are shown in the figure.

this image shows the minterms arrangement in a non-standard 4x8 layout of a 5-input k-map
Why is the \(\mathsf{2\times{}4\times{}4}\) the most used layout of 5-input K-maps?

The inherent symmetry of the \(\mathsf{2\times{}4\times{}4}\) layout makes it easier to identify the largest possible groups and extract prime implicants compared to other configurations. The following example illustrates this advantage in practice.

When solving the function \(\mathsf{Z = \sum\left(6,7,8,9,12,13,22,23,24,25,28,29\right)}\) using the standard \(\mathsf{2\times{}4\times{}4}\) Karnaugh map, we previously arrived at the simplified expression:

\[\mathsf{Z = B’D + B’CD}\]

Now, when attempting the same problem using a \(\mathsf{4\times{}8}\) layout, the groupings appear different at first glance. e can form an octet using the minterms \(\mathsf{m_8,m_9,m_{12},m_{13},m_{24},m_{25},m_{28},}\) and \(\mathsf{m_{29}}\) as they are symmetric across the half folds and extend along the outer edges as shown by the pink colored grouping. Then, we can find a quad \(\mathsf{m_6,m_7,m_{22},}\) and \(\mathsf{m_{23}}\) because they are symmetric around the center folds and extend across the top edges.

Thus, the output function we obtain here is again \(\mathsf{Z=B’D + B’CD}\) The \(\mathsf{4\times{}8}\) demands that symmetry around the center- or quarter-folds be kept when forming larger groups, whereas the \(\mathsf{2\times{}4\times{}4}\) layout enables us to group item visually if they are in the same positions on the front and back layers. Thus, itis inherently symmetric and visually intuitive, making it the preferred and most efficient format for solving 5-variable K-maps.

In both layouts, the final simplified function remains:

\[\mathsf{Z=BD+B’D’}\]

this image shows the largest groupings for the given example with alternative prime implicants in 4x8 layout
Can we take the complement of a function using K-maps?

Yes, we can obtain the complement of a function using K‑maps. Instead of grouping 1s, we carry out the usual K‑map simplification process with the 0s. The largest possible groups of 0s, formed in sizes that are powers of two, will yield the complement of the function in sum‑of‑products form.

Example 7: Express the complement of a 5-input function in the simplest form \(\mathsf{Z=\sum\left(6,\right.}\)\(\mathsf{\left.7,\right.}\)\(\mathsf{\left.8,\right.}\)\(\mathsf{\left.9,\right.}\)\(\mathsf{\left.12,\right.}\)\(\mathsf{\left.13,\right.}\)\(\mathsf{\left.22,\right.}\)\(\mathsf{\left.23,\right.}\)\(\mathsf{\left.24,\right.}\)\(\mathsf{\left.25,\right.}\)\(\mathsf{\left.28,\right.}\)\(\mathsf{\left.29\right)}\)

We can identify four octets formed by the 0s, each yielding a prime implicant: \(\mathsf{B’D’,BD,C’D,}\) and \(\mathsf{B’C’}\). These octets span both the front and back layers, with overlapping cells across the maps. To visually represent this, cells that share the same position across layers are given matching background colors, while cells that belong to multiple groupings have their backgrounds adjusted to reflect all relevant group associations.

The final simplified function is: \(\mathsf{Z’=B’D’+BD+}\) either \(\mathsf{C’D}\) or \(\mathsf{B’C’}\).

This ambiguity arises because the 0s at positions \(\mathsf{m_2,m_3,m_{18},}\) and \(\mathsf{m_{19}}\) can be covered by either of the last two implicants—\(\mathsf{C’D}\) or \(\mathsf{B’C’}\)—depending on how the groupings are chosen.

the image shows the process of calculating the complement of a function using minterms, or the function itself using maxterms using k-map
Can we solve a function using maxterms in K-maps?

Yes — the function can also be solved using maxterms in K‑maps. The process mirrors that for minterms, but instead of grouping 1s, we identify the largest possible groupings of 0s. From these, we write the corresponding constant terms in sum form. Each prime implicant equivalent derived in this way is then combined using the AND gate (·) operator.

Example 8: Express the 5-input function in the simplest form using Maxterms \(\mathsf{Z=\sum\left(6,\right.}\)\(\mathsf{\left.7,\right.}\)\(\mathsf{\left.8,\right.}\)\(\mathsf{\left.9,\right.}\)\(\mathsf{\left.12,\right.}\)\(\mathsf{\left.13,\right.}\)\(\mathsf{\left.22,\right.}\)\(\mathsf{\left.23,\right.}\)\(\mathsf{\left.24,\right.}\)\(\mathsf{\left.25,\right.}\)\(\mathsf{\left.28,\right.}\)\(\mathsf{\left.29\right)}\)

We can identify four octets formed by the 0s, each yielding \(\mathsf{B+D,B’+D’,C+D’,}\) and \(\mathsf{B+C}\). These octets span both the front and back layers, with overlapping cells across the maps. To visually represent this, cells that share the same position across layers are given matching background colors, while cells that belong to multiple groupings have their backgrounds adjusted to reflect all relevant group associations.

The final simplified function is: \(\mathsf{Z=\left(B+D\right)\cdot{}\left(B’+D’\right)\cdot{}}\) either \(\mathsf{\left(C+D’\right)}\) or \(\mathsf{\left(B+C\right)}\).

This ambiguity arises because the 0s at positions \(\mathsf{M_2,M_3,M_{18},}\) and \(\mathsf{M_{19}}\) can be covered by either of the last two implicants—\(\mathsf{\left(C+D’\right)}\) or \(\mathsf{\left(B+C\right)}\)—depending on how the groupings are chosen.

the image shows the process of calculating the complement of a function using minterms, or the function itself using maxterms using k-map
Is the solution to Example 8, same as that of Example 6, since we are solving the same function?

\[
\begin{align}
\mathsf{Z\;}&\mathsf{=BD’+B’CD}&\mathsf{\rightarrow{}}\textsf{ solution Example 6}\\
\mathsf{Z\;}&\mathsf{=\left(B+D\right)\cdot{}\left(B’+D’\right)\cdot{}}\textsf{ either }\mathsf{\left(C+D’\right)}\textsf{ or }\mathsf{\left(B+C\right)}&\mathsf{\rightarrow{}}\textsf{ solution Example 8}
\end{align}
\]

Both solutions are equivalent; they differ only in form. We’ll prove the equivalence using Boolean algebra: start with \(\mathsf{\left(C+D’\right)}\) and then incorporate \(\mathsf{\left(B+C\right)}\) to rewrite the expression into the same form as the solution in Example 6.

Using \(\mathsf{\left(C+D’\right)}\):

\[\require{cancel}
\begin{align}
\mathsf{Z\;}&\mathsf{=\left(B+D\right)\cdot{}\left(B’+D’\right)\cdot{}\left(C+D’\right)}\\
\mathsf{Z\;}&\mathsf{=\left(\cancelto{0}{BB’}+BD’+B’D+\cancelto{0}{DD’}\right)\cdot{}\left(C+D’\right)}\\
\mathsf{Z\;}&\mathsf{=\left(BD’+B’D\right)\cdot{}\left(C+D’\right)}\\
\mathsf{Z\;}&\mathsf{=BCD’+B\cancelto{D’}{D’D’}+B’CD+B’\cancelto{0}{DD’}}\\
\mathsf{Z\;}&\mathsf{=BCD’+BD’+B’CD+\cancelto{0}{B’0}}\\
\mathsf{Z\;}&\mathsf{=BD’\left(\cancelto{1}{C+1}\right)+B’CD}\\
\mathsf{Z\;}&\mathsf{=\cancelto{BD’}{BD’\left(1\right)}+B’CD}\\
\mathsf{Z\;}&\mathsf{=BD’+B’CD}\\
\mathsf{Z\;}&\mathsf{=}\textsf{ solution example 6}
\end{align}
\]

Using \(\mathsf{\left(B+C\right)}\):

\[\require{cancel}
\begin{align}
\mathsf{Z\;}&\mathsf{=\left(B+D\right)\cdot{}\left(B’+D’\right)\cdot{}\left(B+C\right)}\\
\mathsf{Z\;}&\mathsf{=\left(\cancelto{0}{BB’}+BD’+B’D+\cancelto{0}{DD’}\right)\cdot{}\left(B+C\right)}\\
\mathsf{Z\;}&\mathsf{=\left(BD’+B’D\right)\cdot{}\left(B+C\right)}\\
\mathsf{Z\;}&\mathsf{=\cancelto{B}{BB}D’+BCD’+\cancelto{0}{BB’}D+B’CD}\\
\mathsf{Z\;}&\mathsf{=BD’+BCD’+\cancelto{0}{0D}+B’CD}\\
\mathsf{Z\;}&\mathsf{=BD’\left(\cancelto{1}{1+C}\right)+B’CD}\\
\mathsf{Z\;}&\mathsf{=\cancelto{BD’}{BD’\left(1\right)}+B’CD}\\
\mathsf{Z\;}&\mathsf{=BD’+B’CD}\\
\mathsf{Z\;}&\mathsf{=}\textsf{ solution example 6}
\end{align}
\]

Therefore, regardless of which prime implicant is selected in the final solution for Example  8, the resulting expression is logically equivalent to that of Example  6. However, the implementation cost may vary depending on the chosen approach.

Can we take the complement of a function using maxterms in K-maps?

Yes — we can find the complement of a function using maxterms in a K‑map. The approach is the same as the standard maxterm method, but instead of grouping 0s to get the original function, we group the 1s instead. The largest possible groups of 1s, formed in powers of two, give the complement in product‑of‑sums form, with each term representing the constant values across the group.

Example 9: Express the complement of the 5-input function in the simplest form using Maxterms \(\mathsf{Z=\sum\left(6,\right.}\)\(\mathsf{\left.7,\right.}\)\(\mathsf{\left.8,\right.}\)\(\mathsf{\left.9,\right.}\)\(\mathsf{\left.12,\right.}\)\(\mathsf{\left.13,\right.}\)\(\mathsf{\left.22,\right.}\)\(\mathsf{\left.23,\right.}\)\(\mathsf{\left.24,\right.}\)\(\mathsf{\left.25,\right.}\)\(\mathsf{\left.28,\right.}\)\(\mathsf{\left.29\right)}\)

An octet can be formed by grouping the 1s at positions \(\mathsf{M8,M9,M_{12},M_{13}}\) on the front map and \(\mathsf{M_{24},M_{25},M_{28},M_{29}}\) on the back. This grouping simplifies to the term \(\mathsf{B’+D}\).

Additionally, a quad can be created by combining \(\mathsf{M_6}\) and \(\mathsf{M_7}\) from the front with \(\mathsf{M_{22}}\) and \(\mathsf{M_{23}}\) from the back. This yields the term \(\mathsf{B+C’+D’}\).

Together, these groupings define the complement of the function as: \(\mathsf{Z’=\left(B’+D\right)\left(B+C’+D’\right)}\).

this image shows the largest groupings for the given example
Is the solution to Example 9, same as that of Example 7, since we are solving the same function?

\[
\begin{align}
\mathsf{Z’\;}&\mathsf{=B’D’+BD+}\textsf{ either }\mathsf{C’D}\textsf{ or }\mathsf{B’C’}&\mathsf{\rightarrow{}}\textsf{ solution Example 7}\\
\mathsf{Z’\;}&\mathsf{=\left(B’+D\right)\left(B+C’+D’\right)}&\mathsf{\rightarrow{}}\textsf{ solution Example 9}\\
\end{align}
\]

Both solutions are equivalent; they differ only in form. We’ll prove the equivalence using Boolean algebra by converting the solution to the Example 9 to the form of Example 7.

\[\require{cancel}
\begin{align}
\mathsf{Z’\;}&\mathsf{=\left(B’+D\right)\left(B+C’+D’\right)}\\
\mathsf{Z’\;}&\mathsf{=\cancelto{0}{BB’}+B’C’+B’D’+BD+C’D+\cancelto{0}{DD’}}\\
\mathsf{Z’\;}&\mathsf{=B’C’+B’D’+BD+C’D}\\
\mathsf{Z’\;}&\mathsf{=B’D’+BD+C’D+B’C’}\\
\mathsf{Z’\;}&\mathsf{=}\textsf{ solution example 7}
\end{align}
\]

When we convert the POS solution from Example 9 to the SOP form used in Example 7, we obtain four terms—the same count as solving directly via minterms. In that set, \(\mathsf{BD}\)BD and \(\mathsf{B’D’}\) are required, and you can choose either \(\mathsf{C’D}\) or \(\mathsf{B’C’}\) to minimize cost. By contrast, converting fully to SOP lists all four terms without that choice, increasing the cost, whereas keeping the original POS form is cheaper. In any case, the functions are logically equivalent; using minterms vs. maxterms changes the final form and its implementation cost.