How to convert a boolean function to CNF?

984 Views Asked by At

Consider the boolean function: $$f (x, y, z) = (x + \overline y) (y + \overline z) (z + \overline x)$$

I have converted it to DNF which is $xyz + \overline y \,\overline z \,\overline x$, but I have problem with converting it to CNF.

I have no clue at all how to solve this problem. Any help would be very much appreciated. :)

1

There are 1 best solutions below

0
On BEST ANSWER

Write the truth table for it.

\begin{matrix} x & y & z & f(x,y,z)\\ 1 & 1 & 1 & 1\\ 1 & 1 & 0 & 0\\ 1 & 0 & 1 & 0\\ 1 & 0 & 0 & 0\\ 0 & 1 & 1 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{matrix} Then read the one NF from the $1$ rows: $$ f(x,y,z) \quad\Longleftrightarrow\quad xyz + \overline{x}\,\overline{y}\,\overline{z} $$ and read the other NF from the $0$ rows $$ f(x,y,z)\quad\Longleftrightarrow\quad (\overline{x}+\overline{y}+z)(\overline{x}+y+\overline{z})(\overline{x}+y+z) (x+\overline{y}+\overline{z})(x+\overline{y}+z)(x+y+\overline{z}) $$

In general, there is no "short" way to compute CNF. The problem is NP hard.