Class: Adder

Adder(line1, line2, cIn, result, cOut)

A full adder for two tri objects. Takes the sum of the two input lines and sums this result with the carry in line. The output line is set to the result of this operation and the carry out line is set to ANY of the carry out of the first and second additions which are the intermediate carry terms.

Constructor

new Adder(line1, line2, cIn, result, cOut)

Wire up a the full adder with the specified input and output locations
Parameters:
Name Type Description
line1 Tri Tri to read first input from
line2 Tri Tri to read second input from
cIn Tri Tri to read carry in from
result Tri Tri to output sum to
cOut Tri Tri to output carry out to
Properties:
Name Type Description
line1 Tri the first input line
line2 Tri the second input line
cIn Tri the carry in line
result Tri the output line
cOut Tri the carry out line
hAdd_lines HalfAdder the half adder for the input lines
hAdd_cIn HalfAdder the half adder for the result and carry in
inter_c_1 Tri the intermediate carry term for the input lines
inter_c_2 Tri the intermediate carry term for the result and carry in
Source:

Classes

Adder

Methods

compute()

Computes the sum and carry out of the two input lines and the carry in line. The result is stored in the output line and the carry out is stored in the specified carry out line.
Source: