Every year I teach a introductory course on computer architecture and I always begin the course with a review of decimal arithmetic to demonstrate the general principles of radix representation and arithmetic.
I also wanted to represent the carry in binary addition but my solution uses a Tikz matrix of math nodes. A minimal example below shows my solution.
\documentclass{article}
\usepackage{lmodern}
\renewcommand*\familydefault{\sfdefault}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newcommand{\addend}{\text{\textsl{\color{gray}{Addend}}}}
\newcommand{\augend}{\text{\textsl{\color{gray}{Augend}}}}
\newcommand{\sumOut}{\text{\textsl{\color{gray}{Sum}}}}
\begin{document}
Calculate the binary sum $0001\;0011\;1101+0000\;1011\;0111$.
\begin{equation}
\begin{tikzpicture}[
row 1/.style={font=\textsl,font=\scriptsize,black!85, anchor=west,
inner sep=1.5pt},
every node/.style={column sep=.5mm,row sep=1mm}]
\matrix (m) [matrix of math nodes,
nodes in empty cells,
%nodes=draw
]
{
& & & & & & 1 & 1 & 1 & 1 & 1 & 1 & & \\
& 0 & 0 & 0 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 1 &[10mm] \addend \\
+ & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 1 & 0 & 1 & 1 & 1 & \augend \\
& 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 0 & 1 & 0 & 0 & \sumOut \\
};
\draw[-,color=black,semithick] (m-3-2.south west) -- (m-3-13.south east);
\end{tikzpicture}
\label{binary_integer_addition}
\end{equation}
\end{document}
Which outputs:
Because each digit is a node it is possible to enhance the presentation of the sum by drawing colored arrows between the nodes (which can be useful in explaining borrowing in in binary subtraction for example).
\overset{1}{1}. – Qrrbrbirlbel Jan 29 '13 at 04:19polynompackage? It has some very nice features. – A.Ellett Jan 29 '13 at 04:35