3 == Ports ===========================================================
11 == Constants ========================================================
13 == TeX ==============================================================
15 This ship implements a {\bf L}ook {\bf U}p {\bf T}able. The least
16 significant eight bits of the {\tt inLut} value form a truth table
17 with two inputs and one output (FIXME: specify the layout).
19 When values are available at all three inputs they are consumed and a
20 value is produced at {\tt out}. Each bit of {\tt out} is produced by
21 looking up the corresponding bits of {\tt in1} and {\tt in2} in the
22 {\tt inLut} truth table.
24 == Fleeterpreter ====================================================
25 public void service() {
26 if (box_in1.dataReadyForShip() &&
27 box_in2.dataReadyForShip() &&
28 box_inLut.dataReadyForShip()) {
29 int a = box_in1.removeDataForShip();
30 int b = box_in2.removeDataForShip();
31 int lut = box_inLut.removeDataForShip();
33 if ((lut & 1) != 0) ret |= (~a) & (~b);
34 if ((lut & 2) != 0) ret |= (a) & (~b);
35 if ((lut & 4) != 0) ret |= (~a) & (b);
36 if ((lut & 8) != 0) ret |= a & b;
37 box_out.addDataFromShip(ret);
41 == FleetSim ==============================================================
42 == FPGA ==============================================================
43 // not implemented FIXME
45 == Contributors =========================================================
46 Adam Megacz <megacz@cs.berkeley.edu>