Searched Projects

Tags: Arithmetic and Logical Unit

project.name
0 Stars     15 Views

This is a replication of an ALU (Arithmetic and Logical Unit) containing a Full Adder, logical gates to invert both inputs separately, to make both inputs zero separately, to invert the output, to add both inputs or to get the logical result of AND (X, Y).

Instructions on how to use:
Double click on the main 3 bit inputs to set their value individually. Beware that any input of less or more than 3 bits will make the ALU malfunction. Also only input binary values. Inputs are signed in the 'Two's complement' method.
Click once on the control values to set them alternatively on '0' or '1'.
Outputs are read-only.

Values:
Input values are X and Y. They are 3 bits inputs.
Control values are ZX, NX, ZY, NY, F and NO. They are 1 bit inputs.
ZX = 1 means X input is '000', otherwise it is simply X.
NX = 1 means X input gets inverted (NOT(X)), otherwise it is simply X. This inverter happens after X has (or not) been set to zero.
ZY = 1 means Y input is '000', otherwise it is simply Y.
NX = 1 means Y input gets inverted (NOT(Y)), otherwise it is simply Y. This inverter happens after Y has (or not) been set to zero.
F = 1 means the full adder is selected for the ouput, otherwise the AND (X, Y) method is selected.
NO = 1 means the ouput will be inverted (NOT(OUT)), otherwise it is simply OUT. This happens after either the full adder or the AND logical gate.
Used gates are NOT, AND, OR, MUX.
Ouput is in three bits.
Flag outputs are ZR and NG.
ZR = 1 means the output is '000', otherwise it is any other combination of 3 bits
NG = 1 means the output is negative ('1xx'), otherwise it is positive ('0xx').
A light green line means the value it carries is '1', dark green means '0'.
Intermediate carries of added bits have been output in the circuit for a better understanding of how it works and are labeled R0, R1, R2 and R3

Possible circuits are:
ADD(X, Y)
ADD(NOT(X), Y)
ADD(X, NOT(Y))
ADD(NOT(X), NOT(Y))
ADD(0, Y)
ADD(X, 0)
ADD(0, 0)
ADD(NOT(0), Y)
ADD(NOT(X), 0)
ADD(NOT(0), 0)
ADD(0, NOT(Y))
ADD(X, NOT(0))
ADD(0, NOT(0))
ADD(NOT(0), NOT(Y))
ADD(NOT(X), NOT(0))
ADD(NOT(0), NOT(0))

AND(X, Y)
AND(NOT(X), Y)
AND(X, NOT(Y))
AND(NOT(X), NOT(Y))
AND(NOT(0), Y)
AND(NOT(X), 0)
AND(NOT(0), 0)
AND(0, NOT(Y))
AND(X, NOT(0))
AND(0, NOT(0))
AND(NOT(0), NOT(Y))
AND(NOT(X), NOT(0))
AND(NOT(0), NOT(0))

NOT(ADD(X, Y))
NOT(ADD(NOT(X), Y))
NOT(ADD(X, NOT(Y)))
NOT(ADD(NOT(X), NOT(Y)))
NOT(ADD(0, Y))
NOT(ADD(X, 0))
NOT(ADD(0, 0))
NOT(ADD(NOT(0), Y))
NOT(ADD(NOT(X), 0))
NOT(ADD(NOT(0), 0))
NOT(ADD(0, NOT(Y)))
NOT(ADD(X, NOT(0)))
NOT(ADD(0, NOT(0)))
NOT(ADD(NOT(0), NOT(Y)))
NOT(ADD(NOT(X), NOT(0)))
NOT(ADD(NOT(0), NOT(0)))

NOT(AND(X, Y))
NOT(AND(NOT(X), Y))
NOT(AND(X, NOT(Y)))
NOT(AND(NOT(X), NOT(Y)))
NOT(AND(NOT(0), Y))
NOT(AND(NOT(X), 0))
NOT(AND(NOT(0), 0))
NOT(AND(0, NOT(Y)))
NOT(AND(X, NOT(0)))
NOT(AND(0, NOT(0)))
NOT(AND(NOT(0), NOT(Y)))
NOT(AND(NOT(X), NOT(0)))
NOT(AND(NOT(0), NOT(0)))