Hmm....funny how time goes by. Also, I had wrote down my solution to the
boolean problem from last time, but then I lost it, and I kept on putting off working it out agian.
Anyway, lets work it out here. First, let us assume that we have managed to construct a series of boolean objects T
0, T
1, T
01, T
23, and so on, where T
0 is true if exactly 0 of (A,B,C) are true, and T
12 is true if exactly 1 or 2 of (A,B,C) are true and so on for the other T's. So there are in principle 16 such objects, we won't be needing them all, but I just wanted to define the general notation.
If we had these objects then we could easily express NOT A as follows:
NOT A = T0 OR (T1 AND (B OR C)) OR (T2 AND B AND C)
We can see this because exactly 1 of T
0, T
1, T
2, T
3 will be true. If T
0 is true, NOT A must be true. If T
1 is true, NOT A will be true if B or C is true, and false otherwise. If T
2 is true, NOT A will only be true if both B and C are true. Finally if T
3 is true, then NOT A is just false. Note also that we can make similar expressions for NOT B and NOT C just by permutation.
Alright, how do we go about constructing as many of these T's as possible without using more than 2 NOT gates? Well, we have some of them for free, namely:
T3 = A AND B AND C
T23 = (A AND B) OR (A AND C) OR (B AND C)
T123 = A OR B OR C
Next, we can make T
01, costing us 1 NOT gate:
T01 = NOT T23
T
1 and T
013 are now available:
T1 = T123 AND T01
T013 = T01 OR T3
and T
13T13 = T013 AND T123
Finally we can bring out our other NOT gate
T02 = NOT T13
At last we construct T
0 and T
2:
T0 = T02 AND T013
T2 = T02 AND T23
This completes the construction of T
0, T
1, and T
2, finishing the problem.
No comments:
Post a Comment