2. Demonstrate that the NAND gate is universal by constructing AND, OR, and NOT gates from two-input NANDs.
You will be provided with a version of the simulator which includes Nand2, a 2-input NAND, as a primitive (see link below). You are to define classes And2, Or2, and Not:3. Using AND, OR, NOT, and NAND, create Modules for exclusive-OR, a 2-input multiplexer, and a full adder.
Not (Wire out, Wire in)
And2 (Wire out, Wire in0, Wire in1)
Or2 (Wire out, Wire in0, Wire in1)
You are to define additional classes Xor2, Mpxr2, and FullAdder:You should send email to firstname.lastname@example.org which contains the proof of DeMorgan's theorem in the body of the message and a single attachment containing the definitions of the 6 Java classes. The subject line of the message should be "Assignment 1". It will be easier for me if the attachment file name is yourname.java.
Xor2 (Wire out, Wire in0, Wire in1)
Mpxr2 (Wire out, Wire in0, Wire in1, Wire sel)
[here if sel=0 then out=in0; if sel=1 then out=in1]
FullAdder (Wire Cout, Wire S, Wire A, Wire B, Wire Cin)
This assignment is due February 25th, and is worth 7 points towards your final grade. There is a penalty of 1/2 point for each school day the assignment is late.
Extra credit (2 points): suppose you are given only Mpxr2 as a primitive. Show how Not, And2, and Or2 can be built from this primitive. You must write the Mpxr2 Primitive class definition (modeled on the Nand2 Primitive in the supplied simulator) and class definitions for Not, And2, and Or2 using this primitive. If you do the extra credit, send it as a separate mail message, with subject line 'Assignment 1 - extra credit' and a single attachment with file name yournameX.java containing the four class definitions.
Simulator for Assignment 1: release 1.0