0

Let me be clear, by this I don't just mean convert 1.01 * 2 ^ 010 to "5". I'm talking about the exponent as well. This is the true challenge. The mantissa is fairly easy to convert, just find the trailing bit and then pass it through a basic Binary to BCD converter. That would be it for the mantissa, but I don't want that. I want to convert the exponent as well.

People told me to just pass it through a binary to BCD decoder, but this makes no sense, because if we literally translated 1.01 * 2 ^ 010 to 5 * 2 ^ 2, that would be incorrect. 2 ^ 0 is 8, and 5 * 8 is 40. I am talking about real base conversion here. I want to turn 1.01 * 2 ^ 010 into 5 * 10 ^ 0. But how? I am required to do this in order to replicate the Versuchsmodell 1. Please, I need this. Thank you very much.

Sorry the edit is because I messed up the shifts. I meant to type 010, not 011. That would be 10, sorry

  • Could you include MathJax formatting? It makes your question more readable. – AryanSonwatikar Nov 17 '18 at 16:24
  • What do you mean by 1.01 * 2 ^ 011 if not $(1+0\times 1/2+1/4)\times 2^3?$ Why do you think it s $5?$ – gammatester Nov 17 '18 at 16:24
  • gammatester. 1.01 shifted left 3 times. That is what the exponent means, how many times to shift the number. I only place the 2 because it is the base and it is ignored in the actual machine – Konrad Zuse Nov 17 '18 at 16:28
  • @AryanSonwatikar what is mathjax? – Konrad Zuse Nov 17 '18 at 16:28
  • @gammatester actually sorry lmao I messed up with the shifts. That would be 1010, or 10. I meant to type the exponent to be 10 – Konrad Zuse Nov 17 '18 at 16:30
  • MathJax helps you write stuff in mathematical language on the internet. For example, if you see the comment by @gammatester, you notice the difference between the"font". – AryanSonwatikar Nov 17 '18 at 16:33
  • A tutorial of sorts: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference – AryanSonwatikar Nov 17 '18 at 16:34
  • After your edit it is still unclear what your are asking. It is as easy as writing $5=5\times 10^0$. You cannot separately convert the signficand and exponent if the new base is not a power of the original. – gammatester Nov 17 '18 at 16:39
  • @gammatester You can. The Versuchsmodell 1 did it in 1936. I am looking for a base conversion algorithm. 1.01 * 2 ^ 011 is the same as 5 * 10 ^ 0. But we know that because we are humans and we can use both number systems. Computers only use binary which makes it hard to get conversion. Another example would be 2.56 * 10 ^ 2. In floating point that would be 1.00000000 * 2 ^ 1001. But how can we convert the different exponents so that it makes sense? Isn't that how calculators do it? When you type 5 * 10 ^ 0 + 3 * 10 ^ 0, you get 8 * 10 ^ 0, not 8 * 2 ^ 3. – Konrad Zuse Nov 17 '18 at 16:53
  • No you can't. At least with not the current day definitions of floating point format (e.g. IEEE double precision). There are numbers that cannot by excactly converted from finite precision decimal to binary and vice versa say with 20 places in the significand: e.g. $1\times 10^{-1}$ from decimal to binary, or $2^{-40}$ from binary to decimal. – gammatester Nov 17 '18 at 17:12
  • @gammatester I am not using the IEEE 754 format. I'm using a 24 bit format from 1936. It does not have the bias or that fancy format thingies. The format is pretty straight forward: 1 bit sign, 7 bit exponent, 16 bit mantissa. That is all. The exponent dictates how many times to shift the mantissa so that there is always a leading one. The sign is just the sign. But if scientific pocket calculators can convert it, why isn't there an algorithm for it? – Konrad Zuse Nov 17 '18 at 17:37
  • (So you have no negative exponents?) Of course there is an algorithm: If the binary number is $(1 + \sum_{k=1}^{16} b_k 2^{-k})\times 2^e$ just compute this in base-10 arithmethic in two loops (the first from $1$ to $16$ then second from $1$ to $e$. (I will not post further comments, if you do not better explain what you want to achieve.) – gammatester Nov 17 '18 at 18:39
  • 1.01 binary is 1.25 and not 5! – Moti Nov 17 '18 at 19:36
  • @Moti 1.25 * 2 ^ 2 – Konrad Zuse Nov 17 '18 at 19:39
  • You wrote 5 and not 1.25 – Moti Nov 18 '18 at 08:41

0 Answers0