/* File: FullAdder.java For Lab4a, CMSC 220, Fall 1998, U.Wolz, Oct. 1998 */ // Read through this code and add appropriate comments. public class FullAdder { private boolean bit1; private boolean bit2; private boolean carryBit; public FullAdder(boolean b1, boolean b2, boolean c) { bit1 = b1; bit2 = b2; carryBit = c; } // Insert the boolean function that should be returned for the sum. public boolean sum () { } // Insert the boolean function that should be returned for the carry. public boolean carry() { return ((!carryBit && bit1 && bit2) || (carryBit && !bit1 && bit2) || (carryBit && bit1 && !bit2) || (carryBit && bit1 && bit2)); } private boolean XOR(boolean x, boolean y) { return (!x && y) || (x && !y); } public void setBits(boolean b1, boolean b2, boolean c) { bit1 = b1; bit2 = b2; carryBit = c; } }