Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
An irrigation valve opens on the rule X = (A XOR B) OR (NOT C), where C = 1 means it is raining.
P = A XOR B and Q = NOT C, and count how often the valve opens.Three inputs give 8 rows, from 0 0 0 to 1 1 1 in binary order. Add a working column for each inner gate, then the output column. Check a row or two by hand.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Step 1. The table.
| A B C | P Q | X |
|---|---|---|
| 0 0 0 | 0 1 | 1 |
| 0 0 1 | 0 0 | 0 |
| 0 1 0 | 1 1 | 1 |
| 0 1 1 | 1 0 | 1 |
| 1 0 0 | 1 1 | 1 |
| 1 0 1 | 1 0 | 1 |
| 1 1 0 | 0 1 | 1 |
| 1 1 1 | 0 0 | 0 |
Step 2. Count. The 4 rows with C = 0 give 1. Of the rows with C = 1, two have A different from B. That is rows.
Step 3. All inputs 1. P = 1 XOR 1 = 0 and Q = 0, so X = .
Answer: (a) . (b) .
Log in to join the discussion.
Loading…