1

****

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

5
  • 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. – user11232 Oct 16 '15 at 6:46
  • You can also try looking arround: tex.stackexchange.com/questions/107637/… – Ignasi Oct 16 '15 at 7:00
  • BTW, that is decimal to octal conversion. Binary would be 100110111. – John Kormylo Oct 16 '15 at 15:03
  • 1
    Does tex.stackexchange.com/questions/96399/… help? – egreg Oct 17 '15 at 7: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
5

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.

3
  • Not sure if the OP was looking for the actual conversion or the graphical algorithm, but this is a good answer anyway :-) – Johannes_B Oct 17 '15 at 7:22
  • 2
    @Johannes_B maybe not, but then he/she should put a bit more effort in the question. And in fact, egreg's pointer gets you to an example to calculate and display – Frank Mittelbach Oct 17 '15 at 8:50
  • :-) I fully agree. – Johannes_B Oct 17 '15 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.