# 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.

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!

-
Is the question about how to draw on paper a truth table for an $n$-ary function when $n > 2$ (e.g. $n=4$?) I'm not sure that there is a standard way to do this. It seems like a typography question and not a math question. – Trevor Wilson Jan 22 '13 at 5:33
No, it is actually related to computer science (I would use Stack Overflow but this question is not exactly related to programming). It would be like given the output values of the boolean function, fill in the truth table. So more like a backward process in solving a truth table. – JT9 Jan 22 '13 at 5:48
As far as I know a truth table is just a way of writing down a function $\{0,1\}^n \to \{0,1\}$. It seems like you know what the function is and you just want to know how to write it on paper. Isn't this just a matter of taste? One way would be to have two columns, the left column containing elements of $\{0,1\}^4$ and the right column containing the corresponding element of $\{0,1\}$ (or $\{T,F\}$.) – Trevor Wilson Jan 22 '13 at 5:51

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}$$