Table of Contents

Full_ADDER Class

FULL_ADDER Class implements a working full adder circuit for use in the CPU Simulator

FULL_ADDER() Constructor

 FULL_ADDER myFullAdder; 
Function Parameter(s) Return Value
FULL_ADDER() none instantiation of newly allocated FULL_ADDER object

FULL_ADDER() is the parameterless constructor that is responsible for creating a new instance of a FULL_ADDER circuit.

set(bool, bool, bool)

Takes 3 parameters and sets a, b, and carryI to those values. The sum is then achieved by sending a and b as inputs into an xor gate. The result of this first xor gate and the carry in are then used as input into a second xor gate. The sum is the result of the second xor gate.

Now the carry out is calculated. The carry out is achieved by first sending a and b as inputs to an xor gate. The result of the xor and the carry in are then sent, as inputs, to an and gate. a and b are also used as inputs to another and gate. The results of the two and gates are then used as inputs to an or gate, which outputs the carry out.

 myFullAdder.set(true, true, true); 
Function Parameter(s) Return Value
void set() bool, bool, bool none

getSum()

Returns 1 of the two outputs of the full adder, the sum.

 myFullAdder.getSum(); 
Function Parameter(s) Return Value
bool getSum() none bool

getCarryOut

Returns 1 of the two outputs of the full adder, the carry out.

 myFullAdder.getCarryOut() 
Function Parameter(s) Return Value
bool getCarryOut() none bool