|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.croesch.micro_debug.mic1.alu.Alu
public final class Alu
This class represents an ALU for 32 bit values. It is based on the verilog code for 'interconnection of 1-Bit-ALUs to one 32-bit-ALU' in the script of the lecture 'Rechnertechnik' of Karl Stroetmann.
| Constructor Summary | |
|---|---|
Alu()
Initialises all the one-bit-ALUs. |
|
| Method Summary | |
|---|---|
void |
calculate()
Performs calculation of the output signals based on the current values of input signals. |
int |
getOut()
Returns the calculated output. |
boolean |
isN()
Returns the whether the calculated output is negative. |
boolean |
isZ()
Returns the whether the calculated output is zero. |
Alu |
setA(int a)
Sets the value for the input value A. |
Alu |
setB(int b)
Sets the value for the input value B. |
Alu |
setEnA(boolean enA)
Sets the value for the signal ENA. |
Alu |
setEnB(boolean enB)
Sets the value for the signal ENB. |
Alu |
setF0(boolean f0)
Sets the value for the signal F0. |
Alu |
setF1(boolean f1)
Sets the value for the signal F1. |
Alu |
setInc(boolean inC)
Sets the value for the signal Carry in. |
Alu |
setInvA(boolean invA)
Sets the value for the signal INVA. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Alu()
| Method Detail |
|---|
public int getOut()
public boolean isN()
true, if the number calculated by this ALU is less than zero.public boolean isZ()
true, if the number calculated by this ALU is zero.public Alu setA(int a)
a - the value of A, to calculate with
Alu to allow a fluent API.public Alu setB(int b)
b - the value of B, to calculate with
Alu to allow a fluent API.public Alu setF0(boolean f0)
f0 - true, if the signal should be set, false otherwise.
Alu to allow a fluent API.public Alu setF1(boolean f1)
f1 - true, if the signal should be set, false otherwise.
Alu to allow a fluent API.public Alu setEnA(boolean enA)
enA - true, if the signal should be set, false otherwise.
Alu to allow a fluent API.public Alu setEnB(boolean enB)
enB - true, if the signal should be set, false otherwise.
Alu to allow a fluent API.public Alu setInvA(boolean invA)
invA - true, if the signal should be set, false otherwise.
Alu to allow a fluent API.public Alu setInc(boolean inC)
inC - true, if the signal should be set, false otherwise.
Alu to allow a fluent API.public void calculate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||