What does "preserving the logic expression" mean?

I already asked a similar question here but didn't get an answer that explained the reasoning. Now the question is I'm asked to find which of the circuits below preserves the logic expression, but I don't know what is meant by "preserves the logic expression". What I know is when we make the truth table just for the bottom NAND Gate for all cases (connecting the unused input to ground/+5V/E), only the case where we connect it to the ground (!(D&E&G) where G=0) we don't get 0 as an output. In the other cases we can get 1, and 0 as an output. Does this make the circuit with the ground connection, not preservative? I would appreciate it if I could get an explanation (FYI what I mean by "unused input" is the Pin 1 on the bottom NAND Gate).

Thanks in advance.

CIRCUIT WHERE THE UNUSED INPUT IS CONNECTED TO THE +5V POWER SUPPLY

• Does this answer your question? Where can I connect the unused input to preserve the logic expression? Commented Oct 30, 2020 at 14:59
• I assume it means which ones generate the same truth table. Commented Oct 30, 2020 at 14:59
• Andy aka, that was the question I already asked but unfortunately I got some answers I wanted but didn't fully get the explanation for this specific question. I've been trying to figure out the explanation for days, but can't find anything on the Internet. Commented Oct 30, 2020 at 15:07
• You never state in that question that you're tripping on the phrase "preserve the logic expression". Commented Oct 30, 2020 at 15:08
• vicatcu, connecting to E or connecting to the +5V power supply results in the same truth table. Commented Oct 30, 2020 at 15:09

2 Answers

Consider U2. It's a three input NAND gate. It's truth table is shown below.

13   1   2   Out
----------------
0   0   0    1
0   0   1    1
0   1   0    1
0   1   1    1
1   0   0    1
1   0   1    1
1   1   0    1
1   1   1    0


Now consider: Does it matter which state pin 1 is in? Will the other pins have any affect on the output if pin 1 is high or pin 1 is low?

• Correct. So which two of the three circuits are equivalent? Commented Oct 30, 2020 at 16:00
• If the pin 1 is low, then that NAND Gate won't output 0. !(D&E&G) where G=0 never outputs 0. When pin 1 is high, other pins can affect the output. So does this mean connecting it to ground does not preserve the logic expression? (Sorry accidentally deleted the comment.) Commented Oct 30, 2020 at 16:01
• The circuits where we connect it to E, and where we connect it to the +5V are equivalent. Commented Oct 30, 2020 at 16:02
• I think you've got it. You should be able to find an online simulator to prove it to yourself. Try logic.ly, for example. Commented Oct 30, 2020 at 16:03
• Thanks for your answer, but isn't this if we only look at the bottom NAND Gate? When we look at the whole circuit, all three circuits output 0 or 1. So only one gate not working properly in a circuit breaks the whole circuit's logic expression? Commented Oct 30, 2020 at 16:06

The wording is strange, but: all of these circuits implement a function $$\F = f\left(A, B, C, D, E\right)\$$. If two circuits implement the same function $$\f\$$, then they are "preserving the logic expression".

When you build a truth table for a logic function, that truth table is enumerating the output of the function for each given input. If you enumerate all possible inputs (i.e., for the five-input function here, if you enumerate all 32 possible combinations of the five boolean input variables), then your truth table fully defines the function.

So equal truth tables means equivalent functions.

• Sorry for any confusion. So if two of the circuits above have the exact same truth table, does that mean they preserve the logic expression? Commented Oct 30, 2020 at 15:13
• Also when we make the truth table just for the bottom NAND Gate for all cases (connecting to ground/+5V/E), only the case where we connect it to the ground (!(D&E&G) where we look for G = 0) we don't get 0 as an output. On the other cases we can get 1, and 0 as an output. Does this also make the circuit with the ground connection not preservative. Commented Oct 30, 2020 at 15:43
• Could you take your truth table question above and include it in the text of your question, please -- it's a stackexchange thing, where they want the relevant questions all in the question, rather than scattered among the comments. Commented Oct 30, 2020 at 16:03
• Thanks for you answer, yes I will add this part on the question. Commented Oct 30, 2020 at 16:07