updates to ship documentation
[fleet.git] / ships / BitFifo.ship
index 0012316..60de543 100644 (file)
@@ -18,63 +18,76 @@ data  out:  out
 
 == TeX ==============================================================
 
-+------+   +--------------+   +-------+
-|inData|---|              |---|outData|
-+------+   |              |   +-------+
-           |              |
-+------+   |              |   +-------+
-| inOp |---|              |---| outOp |
-+------+   +--------------+   +-------+
+\begin{verbatim}
++-------------+   +---------------+   +------------+
+| inEnqueue   |-->|               |-->| outDequeue |
++-------------+   |               |   +------------+
+                  |    BitFifo    |
++-------------+   |               |   +-------------+
+| inEnqueueOp |-->|               |<--| inDequeueOp |
++-------------+   +---------------+   +-------------+
+\end{verbatim}
 
-inOp
-+---+
-|   |  -- reverse before enqueue
-+---+
-|   |  -- count := (37-offset-count)
-+---+
-|   |  -- count (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
-|   |  -- offset (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
+\section*{inEnqueueOp}
+\setlength{\bitwidth}{6mm}
+{\tt\footnotesize
+\begin{bytefield}{14}
+  \bitheader[b]{0,5,6,11,12,13}\\
+  \bitbox{1}{Rev} 
+  \bitbox{1}{Inv} 
+  \bitbox{6}{Count} 
+  \bitbox{6}{Offset} 
+\end{bytefield}
+}
+
+\begin{itemize}
+   \item [\tt Rev]    ({\bf Reverse Before Enqueue})
+   \item [\tt Inv]    ({\bf Invert Count}) -- treat {\tt Count} as {\tt 37-Offset-Count}
+   \item [\tt Count]  ({\bf Count of Bits To Enqueue})
+   \item [\tt Offset] ({\bf Offset of Bits To Enqueue})
+\end{itemize}
+
+By default, bits are enqueued {\it most significant bit first} (bits
+in Sun byte order).  If {\tt Rev=1}, the bits are reversed before
+performing the directions below.
+
+If {\tt Inv=1}, then the {\tt Count} field is treated as if its value
+was actually {\tt 37-Offset-Count} for all directions below.
+
+
+
+\pagebreak
+
+\section*{inDequeueOp}
+\setlength{\bitwidth}{6mm}
+{\tt\scriptsize
+\begin{bytefield}{23}
+  \bitheader[b]{0,5,6,11-21,22}\\
+  \bitbox{2}{Until} 
+  \bitbox{1}{Sort} 
+  \bitbox{1}{Get} 
+  \bitbox{1}{Rev} 
+  \bitbox{1}{Inv} 
+  \bitbox{1}{Rst} 
+  \bitbox{2}{Left\\ Fill} 
+  \bitbox{2}{Right\\ Fill} 
+  \bitbox{6}{Count} 
+  \bitbox{6}{Offset} 
+\end{bytefield}
+}
 
-outOp
-+---+
-|   |  -- shift until you see a "Z" (2 bits)
-+---+
-|   |  -- sort the digits
-+---+
-|   |  -- give me the count
-+---+
-|   |  -- reverse after dequeue
-+---+
-|   |  -- count := 37-off-count
-+---+
-|   |  -- reset the counter before operation
-+---+
-|   |  -- fill left with (1,0,sign)  (2 bits)
-+---+
-|   |  -- fill right with (1,0,sign)  (2 bits)
-+---+
-|   |  -- count (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
-|   |  -- offset (6 bits)
-|   |
-|   |
-|   |
-|   |
-+---+
+\begin{itemize}
+   \item [\tt Until]  ({\bf Shift until you see a (0, 1)})
+   \item [\tt Sort]   ({\bf Sort the Bits})
+   \item [\tt Get]    ({\bf Get the value of the counter})
+   \item [\tt Rev]    ({\bf Reverse Before Enqueue})
+   \item [\tt Inv]    ({\bf Invert Count}) -- treat {\tt Count} as {\tt 37-Offset-Count}
+   \item [\tt Rst]    ({\bf Reset Counter Before Operation})
+   \item [\tt Left Fill]  ({\bf Left Fill (0, 1, sign)})
+   \item [\tt Right Fill]  ({\bf Right Fill (0, 1, sign)})
+   \item [\tt Count]  ({\bf Count of Bits To Enqueue})
+   \item [\tt Offset] ({\bf Offset of Bits To Enqueue})
+\end{itemize}
 
 
 == Fleeterpreter ====================================================