data out: out
== Constants ========================================================
+ABS:
+NEG:
+INV:
+INC:
+DEC:
+
== TeX ==============================================================
== Fleeterpreter ====================================================
public void service() {
== Constants ========================================================
ADD: add the two arguments; treat link as carry
SUB: subtract the two arguments; treat link as carry
+MUL:
+DIV:
+MOD:
+REM:
+MAX:
+MIN:
+SORT: output min(in1,in2) followed by max(in1,in2) (FIXME: redundant?)
== TeX ==============================================================
This ship is a two-input arithmetic unit. It features several
opcodes, such as {\tt ADD} and {\tt SUB}. In my opinion, it is
niftycool.
+FIXME: implement all the link bit stuff
+
+Use carry-in bit to create a selector? Perhaps a waste of an ALU.
+
+Carry-save / carry completion stuff.
+
+Flags: zero, negative, overflow, ?
+
== Fleeterpreter ====================================================
public void service() {
if (box_in1.dataReadyForShip() &&
data out: out
== Constants ========================================================
+
== TeX ==============================================================
+
+This ship implements a {\bf L}ook {\bf U}p {\bf T}able. The least
+significant eight bits of the {\tt inLut} value form a truth table
+with two inputs and one output (FIXME: specify the layout).
+
+When values are available at all three inputs they are consumed and a
+value is produced at {\tt out}. Each bit of {\tt out} is produced by
+looking up the corresponding bits of {\tt in1} and {\tt in2} in the
+{\tt inLut} truth table.
+
== Fleeterpreter ====================================================
public void service() {
- if (box_in1.dataReadyForShip() && box_in2.dataReadyForShip() && box_inLut.dataReadyForShip()) {
+ if (box_in1.dataReadyForShip() &&
+ box_in2.dataReadyForShip() &&
+ box_inLut.dataReadyForShip()) {
int a = box_in1.removeDataForShip();
int b = box_in2.removeDataForShip();
int lut = box_inLut.removeDataForShip();
data out: out
== Constants ========================================================
+
== TeX ==============================================================
+To Do:
+- deal with sign-extension
+- rotate (in addition to shift)?
+- rotate, shift, and sign-extend subfields of a word?
+- scan for lowest/highest bit which is set/clear?
+
== Fleeterpreter ====================================================
public void service() {
if (box_in.dataReadyForShip() && box_inShift.dataReadyForShip()) {