i_madini said:
Y= (A'B'C)+(A'BC')+(AB'C')+ (A'B'C')
But how to drive it ? I mean the output at each NAND ?
I am going to tell you a secret that I haven't seen formally taught in textbooks. I'd like to hear if anyone knows differently.
It's about understanding active high and active low logic.
A NAND gate, when drawn, looks like an AND with a bubble on the output. This is because it takes two active high inputs (no bubbles), ANDs them and generates an active low output (a bubble). Active high means 1s are high voltage and 0s are low voltage. Active low means 1s are low voltage and 0s are high voltage. You can see this from the truth table, which works on voltages:
A B NAND
0 0 1 (0 active low)
0 1 1 (0 active low)
1 0 1 (0 active low)
1 1 0 (1 active high)
See how it's just a straight AND gate if you interpret the output voltages as active low logic? So when you draw the NAND circuit symbol, you can interpret it as performing AND with active high inputs and active low outputs.
We can also apply DeMorgan's Law to a NAND gate. !(A AND B) = !A OR !B
The meaning of this: take two active low inputs OR together to make an active high output.
We're still using the NAND gate to implement this function so we still have the same truth table but this time we are going to interpret the high and low voltages differently:
A B NAND
0 (1 active low) 0 (1 active low) 1 (active high)
0 (1 active low ) 1 (0 active low) 1 (active high)
1 (0 active low) 0 (1 active low) 1 (active high)
1 (0 active low) 1 (0 active low) 0 (active high)
Just by interpretting the inputs to the NAND gate as active low and the output as active high, using the *same* gate we have found an OR function.
The last missing ingredient is an inverter, which is simply tying both inputs together (check with a truth table).
So now with a NAND gate we can make inverters, OR, AND if we interpret the voltage levels appropriately (active high or active low) and this can be summarized with graphical circuit symbols.
AND:
Draw an AND gate with no bubbles on the input and a bubble on the output (ie the usual NAND symbol). The interpretation is active high inputs are ANDed together to form an active low output.
OR:
Draw an OR gate with bubbles on both inputs and no bubble on the output. The interpretation is two active low inputs are ORed together to form an active high output.
NOT:
Draw like a regular inverter. The inverter is the same in active low or active high logic; you can draw the bubbles on either side of the buffer symbol.
It may sound confusing at first but an actual application will show how easy it is. The implementation strategy being used is called pushing bubbles around the circuit.
Your equation:
Y= (A'B'C)+(A'BC')+(AB'C')+ (A'B'C')
We are ORing together four things. You only have two input NAND gates so you need to use two gates to OR two things and then another gate to OR the results together. A nand OR gate looks like an OR gate with bubbles on the input and no bubbles on the output. I have attached a really bad drawing of four terms A,B,C,D being ORed together using NAND gates.
The top drawing, I have not connected the last OR gate because there is an active high / active low incompatibility. The outputs from the first OR gate are active high but the inputs to the last OR gate are active low. So what I did was push the bubbles through the first OR gates to make a NAND gate with a bubble on the output. Now I can connect that last OR gate because the logic levels are correct. Changing the OR to NAND is allowed because the same NAND gate does both, logically; in the process of changing the symbol I have changed the inputs to active high logic. But I need the inputs to be active low to implement the correct function. So I have put bars over them to indicate they are active low. The bars can indicate /A active high or A active low.
See if you can proceed from there and fill in the rest for A,B,C,D.