Sunday, August 12, 2012

Create all basic gates using NANDs

I've always known that you can use several NAND gates to create all the other gates, but never gave much thought as to how it would actually look like.  Here is a picture that I exported from LogiSim.  I created the logic in LogiSim to verify that it is equivalent.


---
VHDL
---
function "AND" (A,B:std_logic) return std_logic is
begin
     return (A NAND B)NAND(A NAND B);
end;
---
function "OR" (A,B:std_logic) return std_logic is
begin
     return (A NAND A)NAND(B NAND B);
end;
---
function "NOT" (A:std_logic) return std_logic is
begin
     return (A NAND A);
end;

No comments:

Post a Comment