1

****

How can I make like this...plz help!

  • 1
    Welcome to the site. Please post the code which you have tried so far and where are you struck exactly. As of now, this is a do it for me kind of question. –  Oct 16 '15 at 06:46
  • You can also try looking arround: http://tex.stackexchange.com/questions/107637/repeated-division-converting-from-base-10-to-another-base/114005#114005 – Ignasi Oct 16 '15 at 07:00
  • BTW, that is decimal to octal conversion. Binary would be 100110111. – John Kormylo Oct 16 '15 at 15:03
  • 1
    Does http://tex.stackexchange.com/questions/96399/how-can-i-illustrate-decimal-to-binary-conversion help? – egreg Oct 17 '15 at 07:59
  • Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – Martin Schröder Oct 17 '15 at 16:01

1 Answers1

6

Try

\documentclass{article}

\usepackage{expl3}

\ExplSyntaxOn
\cs_new:Npn \displayasdecimal#1 {(#1) \sb {10}}
\cs_new:Npn \displayasoctal #1 {(\int_to_oct:n{#1}) \sb 8}
\cs_new:Npn \displayasbinary #1 {(\int_to_bin:n{#1}) \sb 2}
\ExplSyntaxOff

\begin{document}

$\displayasdecimal{311}=\displayasoctal{311}=\displayasbinary{311}$

\end{document}

This gets you

enter image description here

If you actually want to do the calculation automatically and dislay it as in the top of your picture then that would be possible too using expl3.