Search code examples
booleanboolean-logicboolean-expression

How to convert a boolean expression from AND and OR to only NAND


I have a task that's driving me crazy because i have no clue where to start.

The task is the following: Convert the given boolean expression so that it only contains NAND operations and no negations.

c * b * a + /c * b * /a

I assume that it's possible, :D but i have no idea how to do it and spent several hours just for spinning in circles.

Could someone please point me in the right direction?

Best regards,
askin

Update:

thanks to the answers I think I found the solution:

c*b*a = /(/(c*b*a)*/(c*b*a)) = A; 

/c*b*/a = /(/(/(a*a)*b*/(c*c))*/(/(a*a)*b*/(c*c))) = B; 

c*b*a+/c*b*/a = A + B = /(/(A*A)*/(B*B))

Solution

  • This has a breakdown of how to build other logic gates via NAND. Should be a straightforward application:

    http://en.wikipedia.org/wiki/NAND_logic

    E.g. C = A AND B is equivalent to

    C = NOT (A NAND B)  
    or
    C' = (A NAND B)
    C = C' NAND C'   (effectively NOT'ing A NAND B)