\documentclass[fleqn,12pt]{article}
\usepackage[figuresright]{rotating}
\usepackage{epsfig}
% \setlength{\topmargin}{-8mm}
\setlength{\oddsidemargin}{7mm}
\setlength{\textheight}{216mm}
\setlength{\textwidth}{152mm}
\newcommand{\postscript}[2] 
{\setlength{\epsfxsize}{#2\hsize}
\centerline{\epsfbox{#1}}}
\setlength{\unitlength}{1mm}

\begin{document}

\subsection{XTCD - 6-bin XTC Output Bank}
The 6-bin XTC2 card has implemented level 2 buffers from which the
data sent to the finders can be retrieved.  The XTCD bank is formatted
by the TDC crate controller, but because access to the level 2 buffers
is not done by block VME reads, it is likely that this bank will not be
constructed for other than diagnostic purposes.

Each TDC instruments 96 channels corresponding to 8 consecutive cells.
The structure of the XTCD bank is shown in table~\ref{tab-xtcd}.
\begin{table}
  \begin{center}
    \begin{tabular}{|c|}\hline
      ``XTCD'' \\ \hline
      Bank number \\ \hline
      Bank version \\ \hline
      Bank length \\ \hline
      Bank type (I*4) \\  \hline\hline
      Number of blocks (=20) \\ \hline
Pointer to block 0  \\ \hline
Pointer to block 1 \\ \hline
  ... \\ \hline
Pointer to block 19 \\ \hline
  Pointer to end of data \\ \hline\hline
Block 0: Number of cards (=6) \\ \hline
Pointer to card 0             \\ \hline
  ... \\ \hline
Pointer to card 5             \\ \hline
Pointer to end of block       \\ \hline
XTC data       \\ \hline
  ... \\ \hline
XTC data       \\ \hline\hline
  ... \\ \hline\hline
Block 19: Number of cards (=3) \\ \hline
Pointer to card 0             \\ \hline
  ... \\ \hline
Pointer to card 2             \\ \hline
Pointer to end of block       \\ \hline
XTC data       \\ \hline
  ... \\ \hline
XTC data       \\ \hline
\end{tabular}
\end{center}
\caption{\label{tab-xtcd}Structure of the XTCD bank.  The number of cards
per block varies from 3 to 10 depending on how many TDC's are used to
instrument the stereo superlayers.}
\end{table}
Data from each XTC card is stored in the format shown in
Table~\ref{tab-xtcdword} in which the first word identifies the module
from which the data was obtained, and the subsequent words contain the
data from level 2 buffers on the XTC2 card.  The module identifier will
be the same the one in the COTD bank fragment containing data from the TDC
on which the XTC2 daughter board is mounted.
\begin{table}
  \begin{center}
    \begin{tabular}{|c|c|c|c|}\hline
\multicolumn{4}{|c|}{Module identifier} \\ \hline
$w^{(0)}_{ 3}$ & $w^{(0)}_{ 2}$ & $w^{(0)}_{ 1}$ & $w^{(0)}_{ 0}$ \\ \hline
$w^{(0)}_{ 7}$ & $w^{(0)}_{ 6}$ & $w^{(0)}_{ 5}$ & $w^{(0)}_{ 4}$ \\ \hline
$w^{(0)}_{ 11}$ & $w^{(0)}_{ 10}$ & $w^{(0)}_{9}$ & $w^{(0)}_{ 8}$ \\ \hline
$w^{(1)}_{ 3}$ & $w^{(1)}_{ 2}$ & $w^{(1)}_{ 1}$ & $w^{(1)}_{ 0}$ \\ \hline
$w^{(1)}_{ 7}$ & $w^{(1)}_{ 6}$ & $w^{(1)}_{ 5}$ & $w^{(1)}_{ 4}$ \\ \hline
$w^{(1)}_{ 11}$ & $w^{(1)}_{ 10}$ & $w^{(1)}_{9}$ & $w^{(1)}_{ 8}$ \\ \hline
\multicolumn{4}{ c }{...} \\ \hline
$w^{(5)}_{ 3}$ & $w^{(5)}_{ 2}$ & $w^{(5)}_{ 1}$ & $w^{(5)}_{ 0}$ \\ \hline
$w^{(5)}_{ 7}$ & $w^{(5)}_{ 6}$ & $w^{(5)}_{ 5}$ & $w^{(5)}_{ 4}$ \\ \hline
$w^{(5)}_{ 11}$ & $w^{(5)}_{ 10}$ & $w^{(5)}_{9}$ & $w^{(5)}_{ 8}$ \\ \hline
\end{tabular}
\end{center}
\caption{\label{tab-xtcdword}XTC data words.}
\end{table}
Each XTC2 card has 72 8-bit level 2 buffers, the contents of which
are stored in order in the 18 32-bit words that follow the header word.
The first 12 bytes contain data from time bin 0, the second set of 12 bytes
contains data from time bin 1, and so on.  Within a group of bytes
corresponding to a single time bin, each bit represents the data associated
with that time bin for a single TDC channel.  The order in which the TDC
channels are stored is related to the order in which the data is transmitted
from the TDC transition module to the finder modules which is not purely
sequential.  Table~\ref{tab-xtcdorder} describes the mapping between TDC
channels and bit XTC2 buffer bit numbers.
\begin{table}
  \begin{center}
    \begin{tabular}{|c|c|} \hline
XTC2 bit & TDC channel \\ \hline\hline
0-15 & 0-15 \\ \hline
16-31 & 48-63 \\ \hline
32-47 & 16-31 \\ \hline
48-63 & 64-79 \\ \hline
64-79 & 32-47 \\ \hline
80-95 & 80-95 \\ \hline
\end{tabular}
\end{center}
\caption{\label{tab-xtcdorder}Mapping betwixt XTCD data word bits and TDC channels.}
\end{table}

\subsection{XSFD - Stereo Finder Data}
The stereo finders receive data over optical fibers from the transition boards
on TDC's that read out the outermost 3 stereo superlayers.  The bank format
is shown in Table~\ref{tab-xsfd}.
\begin{table}
  \begin{center}
    \begin{tabular}{|c|}\hline
      ``XSFD'' \\ \hline
      Bank number \\ \hline
      Bank version \\ \hline
      Bank length \\ \hline
      Bank type (I*4) \\  \hline\hline
      Number of blocks (=2) \\ \hline
Pointer to block 0 \\ \hline
Pointer to block 1 \\ \hline
  Pointer to end of data \\ \hline\hline
Block 0: Number of cards (=18) \\ \hline
Pointer to card 0             \\ \hline
  ... \\ \hline
Pointer to card 17             \\ \hline
Pointer to end of block       \\ \hline
Finder data       \\ \hline
  ... \\ \hline
Finder data       \\ \hline\hline
  ... \\ \hline\hline
Block 1: Number of cards (=18) \\ \hline
Pointer to card 0             \\ \hline
  ... \\ \hline
Pointer to card 17             \\ \hline
Pointer to end of block       \\ \hline
Finder data       \\ \hline
  ... \\ \hline
Finder data       \\ \hline
\end{tabular}
\end{center}
\caption{\label{tab-xsfd}Structure of the XSFD bank.}
\end{table}

Stereo finder data words are mapped directly from the stereo finder VME
address space for the Level 2 buffers.  There will be a total of 141 32-bit
words of data, consisting of a 32-bit header word, 20 32-bit words of
segment information and 120 32-bit words of wire data from the input buffers.
The order with which wire data is stored in the bank will be fully specified
at a later date.

\end{document}
