Math & ScienceLong Division with Binary Numbers

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Bzzz
Posts: 1
Joined: Mon Apr 28, 2014 5:55 pm

Long Division with Binary Numbers

Post by Bzzz »

Could you tell me please, how to do in latex the following division --> http://postimg.org/image/c5cejszvf/

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

alainremillard
Posts: 45
Joined: Fri Mar 16, 2012 8:22 pm

Long Division with Binary Numbers

Post by alainremillard »

May not be the best solution, but using the \array environment and removing the separation between column.

Code: Select all

\documentclass{article}

\begin{document}

\[\setlength{\arraycolsep}{0pt}
\begin{array}[t]{*{16}{l}}
	1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1\\
	1&1&0&0&1&\\ \cline{1-5}
	&1&0&0&1&0\\
	&1&1&0&0&1&&&&&&&&&&\\\cline{2-6}
	&&1&0&1&1&0&&&&&&&&&\\
	&&1&1&0&0&1&&&&&&&&&\\\cline{3-7}
	&&&1&1&1&1&0&&&&&&&&\\
	&&&1&1&0&0&1&&&&&&&&\\\cline{4-8}
	&&&&&1&1&1&0&0&&&&&&\\
	&&&&&1&1&0&0&1&&&&&&\\\cline{6-10}
	&&&&&&&1&0&1&0&0&&&&\\
	&&&&&&&1&1&0&0&1&&&&\\\cline{8-12}
	&&&&&&&&1&1&0&1&0&&&\\
	&&&&&&&&1&1&0&0&1&&&\\\cline{9-13}
	&&&&&&&&&&&1&1&0&0&1\\
	&&&&&&&&&&&1&1&0&0&1\\\cline{12-16}
	&&&&&&&&&&&&&&&0\\
\end{array}:11001=11110101001
\]


\end{document}
Have a nice day
Post Reply