The input represent a 4-bit unsigned binary number, the output W, is 1 if the number is multiple of 2 or 3 but not both.

1.9k Views Asked by At

I completely understand how to make a truth table and the entire concept of boolean algebra. However, I am confused how to make the truth table for the above information. Because the input is a 4-bit binary number, the available list of number will be 0 through 15 (2^n - 1). I know the values that make the function false will be 0, 1, 5, 6, 7, 11, 12, and 13. The values that make it true will be 2, 3, 4, 8, 9, 10, 14, and 15. I also know how to represent each number in binary form. Please help! Thanks!

1

There are 1 best solutions below

0
On

I’m really not sure what the difficulty is, but here’s how I’d do it. The notation $d\mid n$ means that $d$ divides $n$, i.e., that $n$ is a multiple of $d$. If $p(n)$ is the statement $2\mid n$, and $q(n)$ is $3\mid n$, you want $$\big(p(n)\lor q(n)\big)\land\neg\big(p(n)\land q(n)\big)$$ or, using $\veebar$ to represent exclusive OR, $p(n)\veebar q(n)$:

$$\begin{array}{r|c|c|c|c} n&n_{\text{two}}&p(n)&q(n)&p(n)\veebar q(n)\\ \hline 0&0000&1&1&0\\ 1&0001&0&0&0\\ 2&0010&1&0&1\\ 3&0011&0&1&1\\ 4&0100&1&0&1\\ 5&0101&0&0&0\\ 6&0110&1&1&0\\ 7&0111&0&0&0\\ 8&1000&1&0&1\\ 9&1001&0&1&1\\ 10&1010&1&0&1\\ 11&1011&0&0&0\\ 12&1100&1&1&0\\ 13&1101&0&0&0\\ 14&1110&1&0&1\\ 15&1111&0&1&1 \end{array}$$