Skip to main content

Exercises 18.6 Programming Exercises

1.

A Boolean or switching function on \(n\) variables is a map \(f : \{O, I\}^n \rightarrow \{ 0, I\}\text{.}\) A Boolean polynomial is a special type of Boolean function: it is any type of Boolean expression formed from a finite combination of variables \(x_1, \ldots, x_n\) together with \(O\) and \(I\text{,}\) using the operations \(\vee\text{,}\) \(\wedge\text{,}\) and \('\text{.}\) The values of the functions are defined in TableĀ 18.33. Write a program to evaluate Boolean polynomials.

Table 18.33. Boolean polynomials
\(x\) \(y\) \(x'\) \(x \vee y\) \(x \wedge y\)
\(0\) \(0\) \(1\) \(0\) \(0\)
\(0\) \(1\) \(1\) \(1\) \(0\)
\(1\) \(0\) \(0\) \(1\) \(0\)
\(1\) \(1\) \(0\) \(1\) \(1\)