From: adam Date: Tue, 13 Feb 2007 04:48:53 +0000 (+0100) Subject: added comments to ship files X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=52622713837a1a617b4a7e8545aa8955a38282aa;p=fleet.git added comments to ship files --- diff --git a/ships/Alu1.ship b/ships/Alu1.ship index a16ffd8..7ee1de9 100644 --- a/ships/Alu1.ship +++ b/ships/Alu1.ship @@ -7,6 +7,12 @@ data in: inOp data out: out == Constants ======================================================== +ABS: +NEG: +INV: +INC: +DEC: + == TeX ============================================================== == Fleeterpreter ==================================================== public void service() { diff --git a/ships/Alu2.ship b/ships/Alu2.ship index 4e12ea5..5e944b9 100644 --- a/ships/Alu2.ship +++ b/ships/Alu2.ship @@ -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() && diff --git a/ships/Lut.ship b/ships/Lut.ship index f33c43e..4ae7953 100644 --- a/ships/Lut.ship +++ b/ships/Lut.ship @@ -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(); diff --git a/ships/Shift.ship b/ships/Shift.ship index a2f6655..bbe50be 100644 --- a/ships/Shift.ship +++ b/ships/Shift.ship @@ -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()) {