I have this last question for an assignment and I've been stuck on it for hours...
Construct a machine that takes three inputs a, b, and c and has the following output: http://puu.sh/zBqZF/39ab9180ad.png You may only use (two input) AND and OR gates and (one input) NOT gates, or a subset thereof. Use as few gates as possible. Remember that you must find one machine that gives all of these outputs.
I have used this website: https://nrich.maths.org/5974/index to try and find a solution. I have tried atleast 50 combinations and I have no idea how to get it. There must be an easier way to do this instead of testing every possible solution. I just can't find it and I'm really frustrated, may I have some help please and thank you!
Generally problems such as these are approached through k-maps. We start by assembling the basic grid:
$$ \begin{array}{c|lcr} \frac{a,b}{c} & \text{00} & \text{01} & \text{11} & \text{10}\\ \hline 0 & 0 & 0 & 1 & 0\\ 1 & 0 & 1 & 1 & 1\\ \end{array} $$
In this case, the top row indicates the truth values of $a$ and $b$, and the left column indicates the truth values of $c$. The rest of the table indicates the output given the specified truth values. From there, we must group together the 1's in the array such that they're the largest groupings as possible, and each grouping's number of elements (order) is a power of two.
$$ \begin{array}{c|lcr} \frac{a,b}{c} & \text{00} & \text{01} & \text{11} & \text{10}\\ \hline 0 & 0 & 0 & \color{blue}{1} & 0\\ 1 & 0 & \color{red}{1} & \color{silver}{1} & \color{green}{1}\\ \end{array} $$
The groupings here are the blue-silver, red-silver, and green-silver clusters. With that in mind, we can now construct our logic gates, by examining the clusters.
The blue-silver grouping is true when $A$ and $B$ are true, and true regardless of the value of $C$. Hence, we have out first cluster- $A \land B$. The second, red-silver clustering is true when $C$ and $B$ are true, regardless of the value of $A$. Hence, it is $B \land C$. By the same process, the green-silver cluster is $A \land C$. Together, we have our logic gate setup: $(A \land B)\lor(A\land C)\lor(B\land C)$.
EDIT: As the answer below helpfully points out, we can then use the distributive law: $(A \land (B \lor C))\lor(B\land C)$.