在一个大得多的文档的一小部分中,我正在使用 minipage 构建一个穷人的两列布局,但运行时间很短。但是,右列字节字段的位头似乎正在逃离其 minipage,我不明白为什么?
梅威瑟:
\documentclass{article}
\usepackage[layout=letterpaper,margin=1in]{geometry}
\usepackage{rotating}
\usepackage[endianness=big]{bytefield}
\begin{document}
\subsection{Functional Unit Addresses}
This section describes\ldots
\subsubsection{{\tt 0b1000}: CTR Layer (Registers)}
\begin{tabular}{r l}
Address & Function (32~bit Data) \\ \hline
\tt 0b0XX0 & Non-INT Register (\#0 -- \#3) \\
\tt 0b1XX0 & INT Register (and wake) (\#0 -- \#3) \\
\end{tabular}
\bigskip\noindent
\begin{minipage}{\linewidth}
\begin{minipage}{.5\linewidth}
\subsubsection{{\tt 0b1010}: CTR Layer (DMA)}
\begin{tabular}{r l}
Address & Function (32~bit Data) \\ \hline
\tt 0b1000 & DMA Data \\
\tt 0b1010 & {\em DMA Control Message} \\
\end{tabular}
\subsubsection{{\tt 0b1001}: DSP Layer (Registers)}
\begin{tabular}{r l}
Address & Function (32~bit Data) \\ \hline
\tt 0b0000 & Reg 0: Status Register \\
\tt 0b0010 & Reg 1: General Purpose \\
\tt 0b0100 & Reg 2: General Purpose \\
\tt 0b0110 & Reg 3: General Purpose \\
\tt 0b1000 & DMA Data \\
\tt 0b1010 & {\em DMA Control Message} \\
\tt 0b1100 & 32 bit data for CPU (IRQ0) \\
\tt 0b1110 & 32 bit data for CPU (IRQ1) \\
\end{tabular}
\end{minipage}
\begin{minipage}{.5\linewidth}
{\bf DMA Control Message}:
\bigskip
\begin{bytefield}[bitwidth=1.5em,bitheight=3em]{16}
\bitheader{16-31} \\
\bitbox{1}{\begin{sideways}{\tiny TX RQ}\end{sideways}}
\bitbox{1}{\begin{sideways}{\tiny RX RQ}\end{sideways}}
\bitbox{1}{\begin{sideways}{\tiny DONE}\end{sideways}}
\bitbox{13}{\# of words (TX RQ)}
\\
\bitheader{0-15} \\
\bitbox{2}{\tiny TX Dest}
\bitbox{14}{Start word addr}
\end{bytefield}
{\em TX Dest:} 00 DSP, 01 R-SRAM, 10 RF, 11 Imager
\end{minipage}
\end{minipage}
\end{document}
第 31-16 位的位头不应该位于左列...:
答案1
您必须知道bytefield
什么是最低有效位;两列格式与此无关。
\documentclass{article}
\usepackage[layout=letterpaper,margin=1in]{geometry}
\usepackage{rotating}
\usepackage[endianness=big]{bytefield}
\begin{document}
\begin{bytefield}[bitwidth=1.5em,bitheight=3em]{16}
\bitheader[lsb=16]{16-31} \\
\bitbox{1}{\begin{sideways}{\tiny TX RQ}\end{sideways}}
\bitbox{1}{\begin{sideways}{\tiny RX RQ}\end{sideways}}
\bitbox{1}{\begin{sideways}{\tiny DONE}\end{sideways}}
\bitbox{13}{\# of words (TX RQ)}
\\
\bitheader{0-15} \\
\bitbox{2}{\tiny TX Dest}
\bitbox{14}{Start word addr}
\end{bytefield}
\end{document}