Class: ALU

ALU(DBIn1, DBIn2, signal_lines)

The ALU is a combinational logic device which performs arithmetic and tritwise operations on two input busses. The ALU is controlled by a set of control signals which determine which operation is performed and are specified by the CPU control unit. The ALU has output bus is set to the output of a mux, which selects from the output of an internal shifter/rotater block, an fblock which computes tritwise operations, and an adder/subtractor block.

Constructor

new ALU(DBIn1, DBIn2, signal_lines)

Create a new ALU
Parameters:
Name Type Description
DBIn1 IOBus the first input data bus
DBIn2 IOBus the second input data bus
signal_lines Array.<Tri> the control signals from the CPU control unit
Properties:
Name Type Description
signal_lines Array.<Tri> the control signals from the CPU control unit
addsub AddSub the adder/subtractor block
fblock FBlock the fblock
shiftRot ShiftRotate the shifter/rotater block
mux ThreeOne the mux which selects the output of the ALU
Source:

Extends

Classes

ALU

Methods

compute()

Compute the output of the ALU
Source:

writeInstruction(instruction)

Set the control signals for the ALU to the values in the given instruction
Parameters:
Name Type Description
instruction Array.<Tri> the control signals from the CPU control unit
Source: