Solving NAND Boolean Logic Homework w/ Q=A+B+C+D

  • Thread starter Thread starter thomas49th
  • Start date Start date
  • Tags Tags
    Logic
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
10 replies · 7K views
thomas49th
Messages
645
Reaction score
0

Homework Statement


Taking the statement Q = A + B + C + D

Rewrite using only NAND (2 inp) and NOT gates


Homework Equations



Well I want to do it all in NAND gates - because we can easily tie NAND inputs to make it a NOT


[tex]\overline{AA} = \overline{A}[/tex]

The Attempt at a Solution



At the moment Q is equal to true if A OR B OR C OR D is true.

I can change OR into a NAND gate quite easily.

[tex]\overline{\overline{(x+y)}} = \overline{\overline{x}\bullet\overline{y}}[/tex]

which is

[tex]x+y = \overline{\overline{x}\bullet\overline{y}}[/tex]

this means I obtain

[tex]\overline{\overline{A}\bullet\overline{B}\bullet\overline{C}\bullet\overline{D}}[/tex]

But this has NOTs and AND logic in, not NAND. I need expressions in NAND which is [tex]\overline{AB}[/tex]

Any hints?

Thanks
Thomas
 
Last edited:
Physics news on Phys.org
Still get to the same place:


[tex](A+B)+(C+D)[/tex]

[tex]\overline{\overline{A}\bullet\overline{B}} + \overline{\overline{C}\bullet\overline{D}}[/tex]

[tex]\overline{\overline{\overline{\overline{A}\bullet\overline{B}}} + \overline{\overline{\overline{C}\bullet\overline{D}}}}[/tex]

[tex] \overline{\overline{A}\bullet\overline{B}\bullet\overline{C}\bullet\overline{D}}[/tex]

Hmmm :(

Was I meant to perform some other manipulation part way?

Thanks
Thomas :)
 
Here's how I sometimes think of these things. Let's denote the nand function of A and B by n(A,B). So

[tex]n(A,B) = \overline{A\cdot B}[/tex]

So your equation
[tex] <br /> x+y = \overline{\overline{x}\bullet\overline{y}}<br /> [/tex]

becomes

[tex]A + B = n(\overline A,\overline B)[/tex]

or "the sum becomes the nand of the complements" (DeMorgans rule). This gives

[tex](A+B) + (C + D) = n(\overline{A+B},\overline{C+D})[/tex]

Now apply the same rule to the sums on the right side. This will leave you an expression with only nands and complements, which can be expressed with inverters.
 
[tex] (A+B) + (C + D) = n(\overline{n(\overline{A},\overline{B}}),\overline{n(\overline{C},\overline{D}})[/tex]

Which is the same as

[tex] \overline{\overline{\overline{\overline{A}\bullet\overline{B}}} + \overline{\overline{\overline{C}\bullet\overline{D }}}}[/tex]
 
thomas49th said:
[tex] (A+B) + (C + D) = n(\overline{n(\overline{A},\overline{B}}),\overline{n(\overline{C},\overline{D}})[/tex]

Yes. So are we done here? Do you see how to implement it as a nand and inverter circuit?

Which is the same as

[tex] \overline{\overline{\overline{\overline{A}\bullet\overline{B}}} + \overline{\overline{\overline{C}\bullet\overline{D }}}}[/tex]
 
LCKurtz said:
Yes. So are we done here? Do you see how to implement it as a nand and inverter circuit?
I think so

[tex] <br /> \overline{\overline{A}\bullet\overline{B} + \overline{C}\bullet\overline{D}}<br /> [/tex]

is the same as

[tex] <br /> (A+B) + (C + D) = n(\overline{n(\overline{A},\overline{B}}),\overline {n(\overline{C},\overline{D}})<br /> [/tex]

I just can't see how to get into the NAND form: [tex]\overline{A \bullet B}[/tex]
instead of using the new implementation you use n(\overline{A},\overline{B}})

Thank
Thomas
 
thomas49th said:
[tex] <br /> (A+B) + (C + D) = n(\overline{n(\overline{A},\overline{B}}),\overline {n(\overline{C},\overline{D}})<br /> [/tex]

I just can't see how to get into the NAND form: [tex]\overline{A \bullet B}[/tex]

Thank
Thomas

I think all the overlines get very confusing. But you can use that n form to immediately draw a nand and inverter circuit. The outside n gives you the nand of two things. What two things? The invert of the two inside nands. So I would start by drawing the output nand gate with inverters at its two inputs. What is on the inputs of these inverters? The inside nands. So put a nand in front of each inverter with their inputs which are the inverted A,B,C, and D inputs.
 
To express it as in logic notation in terms of just nands and complements, the n expression could be written like this:

[tex]\overline{\left(\overline{\left(\overline{\overline A \cdot \overline B}\right)}\right)<br /> \cdot \left(\overline{\left(\overline{\overline C \cdot \overline D}\right)}\right)}[/tex]

Here the big parentheses with the complement over them represent a nand gate, and its inputs are the complments of the nand gates represented by the inner parentheses. The second level nands have the complents of A,B,C, and D for inputs.
 
Last edited:
[tex]\overline{\left(\overline{\left(\overline{\overline A \cdot \overline B}\right)}\right) \cdot \left(\overline{\left(\overline{\overline C \cdot \overline D}\right)}\right)}[/tex]

is the same as

[tex]\overline{\overline{\overline{\overline{A}\bullet\overline{B}}} + \overline{\overline{\overline{C}\bullet\overline{D }}}}[/tex]

You've just put brackets in seperating the complements that COULD cancel?

Right.
Excellent :)
 
thomas49th said:
[tex]\overline{\left(\overline{\left(\overline{\overline A \cdot \overline B}\right)}\right) \cdot \left(\overline{\left(\overline{\overline C \cdot \overline D}\right)}\right)}[/tex]

is the same as

[tex]\overline{\overline{\overline{\overline{A}\bullet\overline{B}}} + \overline{\overline{\overline{C}\bullet\overline{D }}}}[/tex]

You've just put brackets in seperating the complements that COULD cancel?

Right.
Excellent :)

You don't want to cancel the complements. Your expression has a "+" in it which represents OR. It may be logically equivalent but it doesn't give a nand and inverter representation any more than A + B + C + D does.