multiply the number to 8 in the
k-step,
k-leading digits and subtract the result from (
k+1)-leading digits. If the binary number contains
k digit, then the process will be completed by
k-1 steps
10001101
2 -> 141
10
1.0001101
- 8 (1*8=8)
-------------
2.001101
- 16 (2*8=16)
------------
4.01101
- 32 (4*8=32)
----------
8.1101
- 64 (8*8=64)
---------
17.101
-136 (17*8=136)
---------
35.01
- 280 (35*8=280)
-------
70.1
- 560 (70*8=560)
------
141
that makes no sense to me :lol:
where do the decimal points come from ?
maybe provide some explanation for each step
Hi,
dedndave!
it is not a decimal point, it is to separate the next digit to multiply, at each step, we move the point to next digit
conversion of a decimal number of to binary
remember power of 2 (2
10=1024, 2
9=512, ... 2
3=8). For example, convert decimal number 147 to binary, 2
7=128<147<2
8=512
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
147/128=1 remainder 19 | 1 | | | | | | | |
19/64=0 remainder 19 | 1 | 0 | | | | | | |
19/32=0 remainder 19 | 1 | 0 | 0 | | | | | |
19/16=1 remainder 3 | 1 | 0 | 0 | 1 | | | | |
3/8=0 remainder 3 | 1 | 0 | 0 | 1 | 0 | | | |
3/4=0 remainder 3 | 1 | 0 | 0 | 1 | 0 | 0 | | |
3/2=1 remainder 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | |
1/1=1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 | 0 | 1 | 12 |
division is slow - work it in the opposite direction
but, you are just assigning a value for each bit - nothing new, there
dedndave,
of course, nothing new, because there is a built-in Windows calculator (http://www.cyberforum.ru/images/smilies/ap.gif)
if you want to work on base conversion between any bases, google for "horner's rule base conversion"
Quote from: dedndavegoogle for "horner's rule base conversion"
dedndave,
thank you, but I know it (http://www.cyberforum.ru/images/smilies/yes.gif)