ok ı see but how can ı think with truth table of this circuit and ı have 3 input but ı have lots of output when we think x=4 our f(x)=21 and our output for 4 is like a 10101how can we use this at truth table and karnough map
Hi again,
You first have to write out the truth table:
Code:
000 00001
001 00011
010 00111
011 01101
100 10101
and i'll label the bits:
Code:
210 43210 (input and output bit enumerations)
000 00001
001 00011
010 00111
011 01101
100 10101
From the above you can see we have an extremely small entropy, which probably means a very simple solution.
The easiest way to think about this is in terms of each output bit, taken alone without the other output bits. The reason for this is because the decision making for any bit will required one decision making element such as a gate, or possibly even simpler.
Lets start by looking at ONLY the zeroth bit of the output:
Code:
210 0 (bit enumerations)
000 1
001 1
010 1
011 1
100 1
From the above, we see that the zeroth bit of the output is ALWAYS a '1', regardless what the input is. This means we dont even need a gate for bit 0, we can wire that directly to the high logic level supply voltage (in theory). Thus the zeroth output bit becomes simply a wire to the supply voltage and no gate is required.
Now lets do the next output bit, the bit 1 of the output:
Code:
210 1 (bit enumerations)
000 0
001 1
010 1
011 0
100 0
From the above we can see that the output (bit 1) is a '1' ONLY when either bit 1 is a '1' and bit 0 is a '0', or vice versa, and is a '0' only when either bit 1 and bit 0 are both 1's or both 0's, and that function is accomplished by use of an exclusive OR gate, and that completely characterizes that one bit perfectly without the need to consider any other input bits. So now we've done bit 0 and bit 1 of the output. You would do the other bits the same way.
We'll skip now to the last bit (bit 4) of the output and you can do the other bits yourself...
Code:
210 4 (bit enumerations)
000 0
001 0
010 0
011 0
100 1
From the above we can see that the only time we get a '1' for the output is when the bit 2 of the input is high (a '1'), and that is enough to completely characterize the output bit 4 without considering any other bits. Thus, we wire bit 2 of the input directly to bit 4 of the output (or if you prefer, through a buffer). This also does not required a logic gate (unless you want a buffer).
So already we've reduced two of the bits to a direct wiring, and the other three bits required logic gates one of which we've already figured out, so now you should be able to figure out the other two required logic gates by following the same method as shown for the other output bit that needed a logic gate.
See if you can take it from here.