\documentclass[11pt]{book} \usepackage{amsmath} \usepackage{needspace} \newenvironment{solution}[1]% {\needspace{4\baselineskip}\noindent\textbf{Exercise #1.}}{} \newenvironment{solnlist}% {\renewcommand{\labelenumi}{(\alph{enumi})}\begin{enumerate}}% {\end{enumerate}} \newcommand\cin{c_{\operatorname{in}}} \newcommand\cout{c_{\operatorname{out}}} \begin{document} \setcounter{chapter}{2} \chapter{Logic} \begin{solution}{3.13} \begin{solnlist} \item The truth table for the full adder is as follows: \begin{center} \begin{tabular}{ccc|cc} $x$&$y$&$\cin$&$\cout$&$s$\\ \hline 0&0&0&0&0\\ 0&1&0&0&1\\ 1&0&0&0&1\\ 1&1&0&1&0\\ 0&0&1&0&1\\ 0&1&1&1&0\\ 1&0&1&1&0\\ 1&1&1&1&1\\ \end{tabular} \end{center} \item Here is the truth table for the conjectured expression for~$\cout$: \begin{center} \begin{tabular}{ccc|cc|ccc} $x$&$y$&$\cin$&$x\land y$& $\cin\land(x\oplus y)$& $(x\land y)\lor(\cin\land(x\oplus y))$\\ \hline 0&0&0&0&0&0\\ 0&0&1&0&0&0\\ 0&1&0&0&0&0\\ 0&1&1&0&1&1\\ 1&0&0&0&0&0\\ 1&0&1&0&1&1\\ 1&1&0&1&0&1\\ 1&1&1&1&0&1 \end{tabular} \end{center} Here is the truth table for the conjectured expression for~$s$: \begin{center} \begin{tabular}{ccc|cc} $x$&$y$&$\cin$&$x\oplus y$& $x\oplus y\oplus \cin$\\ \hline 0&0&0&0&0\\ 0&0&1&0&1\\ 0&1&0&1&1\\ 0&1&1&1&0\\ 1&0&0&1&1\\ 1&0&1&1&0\\ 1&1&0&0&0\\ 1&1&1&0&1 \end{tabular} \end{center} \end{solnlist} \end{solution} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: