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