5
\$\begingroup\$

I am currently preparing the next semester of my program at university and I am stuck at a question of the "Digital Circuits" class.

Here is the task:

[...] pump P1 runs when the fill-level of the tank falls below 90% (U=0), however only when the opacity sensor gives output (S1=1) at the same time. If the lower fill-level sensor signals with L=0 that the fill-level is below 50%, pump P1 runs (P1=1) independently of the opacity sensor signals (S1), as long as U=0 at the same time. [...]

The task is first to derive the Boolean equation for the combinational logic of the pump controller (output signal).

I ended up with P1 = U'*(S1+L').

We are then to realize the controller using only NAND2 gates with the hint that if 4 NAND2 gates are not sufficient to realize the circuit, we should consider further simplifying the Boolean equation.

This is where my problem lies:

I can only get to realizing the circuit with 5 NAND2 gates:

P1 = U'*(S1+L') = U'*(S1+L')'' = U'*(S1'*L)'

schematic

simulate this circuit – Schematic created using CircuitLab

I don't see any way how I could possibly simplify it any further. Maybe somebody could give me a hint.

Thanks in advace :)

\$\endgroup\$
0
9
\$\begingroup\$

Unless I have made an error (very likely) I believe this can be done with 3 NAND gates. The truth table must look like this: $$\begin{smallmatrix}\begin{array}{rrr|cc} U & S1 & L & P1 & \text{comments}\\ \hline 0 & 0 & 0 & 1 &\\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 \\ 1 & 0 & 0 & x & \text{can't happen}\\ 1 & 0 & 1 & 0\\ 1 & 1 & 0 & x & \text{can't happen}\\ 1 & 1 & 1 & 0\\ \end{array}\end{smallmatrix}$$ Using a Karnaugh map to find the Boolean expression yields a realization that uses 3 2-input NAND-gates.

\$\endgroup\$
10
  • \$\begingroup\$ I am not sure the don't care cases are justified based on the question wording...Although they do make sense, as the tank can't be both filled more than 90% and less than 50%. This is probably the right approach. \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 18:21
  • 3
    \$\begingroup\$ Yeah, added this to comment too, looks like it is the only way to get less than 5 NANDs. Upvoted \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 18:25
  • 2
    \$\begingroup\$ Just a thought. Why would the problem statement writer take the time to say that if L=0 the pump runs independent of S1 only if U=0, too? This extra wording has to mean something. Or else why did they bother saying it? It's too definite to be an accident. \$\endgroup\$
    – jonk
    Jul 29 at 18:56
  • 1
    \$\begingroup\$ Thanks for the elaborations, they helped me and confirmed that the way I understood the question, it is not really possible to get below 5 NAND2 gates. I am sorry that I omitted part of the problem text. It states that a running pump means P1=1. It also states U=1 and L=0 is possible, because the 50% sensor may be defect and in this case the pump shall not run (P1=0). (That's why i used paranthesis (U'*S1)+(U'*L') = U'*(S1+L'). I think the wording is unclear, but its a question from last year (cant ask the prof). more important is that, my basic understanding is correct. So thank you all! :) \$\endgroup\$
    – jesm86
    Jul 29 at 23:14
  • 2
    \$\begingroup\$ I'm pretty sure a double-check for U0 when L0 is low is carried over from a real-world requirement not to overflow the tank in case of a failed sensor. So "can't happen" of this answer ignores a safety requirement, which is... let's say, not ideal. Please do not follow the Boeing example. \$\endgroup\$ Jul 30 at 9:30
2
\$\begingroup\$

Eliminating unnecessary words we get…

pump P1 runs … if U=0 only when S1=1…
pump P1 runs =1 independently of S1 only if U=0
pump P1 runs if L=U=0 and S1=x

  P1 = U’*S1 + L’ = ((U*U)’*S1)’*L)’    
  shows 3 (a*b)‘s meaning 3 NAND’s
\$\endgroup\$
1
  • \$\begingroup\$ This runs the pump for all cases of L0, not only those of L0 & U0. \$\endgroup\$ Jul 30 at 11:14
1
\$\begingroup\$

Why those parentheses? When L=0, output is independent of any other input, right?

So it is P1 = U'*S1+L' and it can be realized with 4 nands.

\$\endgroup\$
5
  • \$\begingroup\$ When L=0, output is independent of any other input, right - As long as U=0.... Not quite independent \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 19:17
  • \$\begingroup\$ Yes, but I mean it is dictated by external factors. \$\endgroup\$
    – Ayhan
    Jul 29 at 19:19
  • \$\begingroup\$ U is an input, not an external factor. \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 19:20
  • 1
    \$\begingroup\$ When it is under 50%, it is always under %90. So when L=0, U is always 0. External factor is that they being tied by physical reality. \$\endgroup\$
    – Ayhan
    Jul 29 at 19:31
  • 1
    \$\begingroup\$ This physical reality is reflected by "don't cares" in Carl's answer. I didn't check the equivalence of your final expression to his, maybe they are equivalent. But these steps should be elaborated. \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 19:33
0
\$\begingroup\$

Try starting with a complemented output to reduce the number of inversions you need:

P1' = U + S1'*L

If you look at the Karnaugh map for P1, you can see that it's easier to simplify P1' than P1.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ I don't think it helps to reduce the number of NANDs \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 17:36
  • \$\begingroup\$ @EugeneSh. Changing things so that the pump is ON when the output is 0 does improve things over saying that the pump is ON when the output is 1. So complementing the output does impact the result. \$\endgroup\$
    – jonk
    Jul 29 at 19:15
  • \$\begingroup\$ @jonk Of course, you can redefine the signals to their complements (not only output but the inputs too). But it is not what the problem is asking to do. \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 19:16
  • \$\begingroup\$ @EugeneSh. Does the problem statement say anything about the output logic value with respect to pump operation? If so, I may have missed it. Otherwise, I'm not sure I understand the "But it is not what the problem is asking to do." Could you elaborate? \$\endgroup\$
    – jonk
    Jul 29 at 19:18
  • \$\begingroup\$ @jonk Actually, you are right. The cited text does not mention the polarity of P1 \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 19:19
0
\$\begingroup\$

There's an active discussion here about the problem statement and its interpretation. I'm taking the position that:

  1. You reflected the problem statement to us, accurately.
  2. The writer could not possibly have accidentally written the part about the pump ignoring S1 when L=0 only if U=0, as well.

A careful reading of the problem statement suggests that it may not be making an explicit statement about the logic level required for the pump to be ON. It does appear to state that P1 is the pump. Then it also appears to say that P1=1 when the pump is ON. So there is a conflation of two things -- the pump itself is called P1 and also a logic symbol P1 is suggested, too.

But if one either must figure that the content writer accidentally added that indication about U or else is allowing you to make the choice about a logic level distinct from the pump state, I'd go with the latter.

And no, I don't find a lot of shelter in that argument. But I do find at least a little. Also, you noted that the question went on to suggest "simplifying the logic" if you cannot get to four NANDs. I'll take that as an added clue or suggestion, as well.

Therefore, you have your answer. Don't assume that the pump is ON when the output is 1. Instead, plan that the output is 0 when the pump is ON.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ It appears that it does state the logic level for the pump: "pump P1 runs (P1=1)" \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 19:24
  • \$\begingroup\$ @EugeneSh. You may be right. Let me see if I can develop a counter-argument! Hmm. Okay. Is P1 necessarily the output I must develop just because they say that P1 is 1 when the pump is ON? Maybe P1 is just an abstract variable, not necessarily the logic I must use. I might instead choose to create /P1 (P1'). But yeah. I'm feeling less certain, again. I'll edit to reflect it. \$\endgroup\$
    – jonk
    Jul 29 at 19:25
  • \$\begingroup\$ I guess if you develop a controller box with predefined interfaces... \$\endgroup\$
    – Eugene Sh.
    Jul 29 at 19:27
  • \$\begingroup\$ @EugeneSh. I added some comments. One thing about P1 is that it is conflated. They use P1 to label the pump itself. They then use P1 as a logic symbol. A pump is not a logic symbol. These are distinctly different. You cannot set P1=1 if P1 is a pump. ;) I find some (not much) shelter in that. \$\endgroup\$
    – jonk
    Jul 29 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.