added comments to ship files
authoradam <adam@megacz.com>
Tue, 13 Feb 2007 04:48:53 +0000 (05:48 +0100)
committeradam <adam@megacz.com>
Tue, 13 Feb 2007 04:48:53 +0000 (05:48 +0100)
ships/Alu1.ship
ships/Alu2.ship
ships/Lut.ship
ships/Shift.ship

index a16ffd8..7ee1de9 100644 (file)
@@ -7,6 +7,12 @@ data  in:   inOp
 data  out:  out
 
 == Constants ========================================================
+ABS:
+NEG:
+INV:
+INC:
+DEC:
+
 == TeX ==============================================================
 == Fleeterpreter ====================================================
     public void service() {
index 4e12ea5..5e944b9 100644 (file)
@@ -10,12 +10,27 @@ data  out:  out
 == 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() &&
index f33c43e..4ae7953 100644 (file)
@@ -8,10 +8,23 @@ data  in:   inLut
 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();
index a2f6655..bbe50be 100644 (file)
@@ -6,7 +6,14 @@ data in:  inShift
 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()) {