Base ten decimal number 0.000 000 000 000 000 000 000 008 converted to 32 bit single precision IEEE 754 binary floating point standard

How to convert the decimal number 0.000 000 000 000 000 000 000 008(10)
to
32 bit single precision IEEE 754 binary floating point
(1 bit for sign, 8 bits for exponent, 23 bits for mantissa)

1. First, convert to binary (base 2) the integer part: 0. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:

  • division = quotient + remainder;
  • 0 ÷ 2 = 0 + 0;

2. Construct the base 2 representation of the integer part of the number, by taking all the remainders starting from the bottom of the list constructed above:

0(10) =


0(2)

3. Convert to binary (base 2) the fractional part: 0.000 000 000 000 000 000 000 008. Multiply it repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:

  • #) multiplying = integer + fractional part;
  • 1) 0.000 000 000 000 000 000 000 008 × 2 = 0 + 0.000 000 000 000 000 000 000 016;
  • 2) 0.000 000 000 000 000 000 000 016 × 2 = 0 + 0.000 000 000 000 000 000 000 032;
  • 3) 0.000 000 000 000 000 000 000 032 × 2 = 0 + 0.000 000 000 000 000 000 000 064;
  • 4) 0.000 000 000 000 000 000 000 064 × 2 = 0 + 0.000 000 000 000 000 000 000 128;
  • 5) 0.000 000 000 000 000 000 000 128 × 2 = 0 + 0.000 000 000 000 000 000 000 256;
  • 6) 0.000 000 000 000 000 000 000 256 × 2 = 0 + 0.000 000 000 000 000 000 000 512;
  • 7) 0.000 000 000 000 000 000 000 512 × 2 = 0 + 0.000 000 000 000 000 000 001 024;
  • 8) 0.000 000 000 000 000 000 001 024 × 2 = 0 + 0.000 000 000 000 000 000 002 048;
  • 9) 0.000 000 000 000 000 000 002 048 × 2 = 0 + 0.000 000 000 000 000 000 004 096;
  • 10) 0.000 000 000 000 000 000 004 096 × 2 = 0 + 0.000 000 000 000 000 000 008 192;
  • 11) 0.000 000 000 000 000 000 008 192 × 2 = 0 + 0.000 000 000 000 000 000 016 384;
  • 12) 0.000 000 000 000 000 000 016 384 × 2 = 0 + 0.000 000 000 000 000 000 032 768;
  • 13) 0.000 000 000 000 000 000 032 768 × 2 = 0 + 0.000 000 000 000 000 000 065 536;
  • 14) 0.000 000 000 000 000 000 065 536 × 2 = 0 + 0.000 000 000 000 000 000 131 072;
  • 15) 0.000 000 000 000 000 000 131 072 × 2 = 0 + 0.000 000 000 000 000 000 262 144;
  • 16) 0.000 000 000 000 000 000 262 144 × 2 = 0 + 0.000 000 000 000 000 000 524 288;
  • 17) 0.000 000 000 000 000 000 524 288 × 2 = 0 + 0.000 000 000 000 000 001 048 576;
  • 18) 0.000 000 000 000 000 001 048 576 × 2 = 0 + 0.000 000 000 000 000 002 097 152;
  • 19) 0.000 000 000 000 000 002 097 152 × 2 = 0 + 0.000 000 000 000 000 004 194 304;
  • 20) 0.000 000 000 000 000 004 194 304 × 2 = 0 + 0.000 000 000 000 000 008 388 608;
  • 21) 0.000 000 000 000 000 008 388 608 × 2 = 0 + 0.000 000 000 000 000 016 777 216;
  • 22) 0.000 000 000 000 000 016 777 216 × 2 = 0 + 0.000 000 000 000 000 033 554 432;
  • 23) 0.000 000 000 000 000 033 554 432 × 2 = 0 + 0.000 000 000 000 000 067 108 864;
  • 24) 0.000 000 000 000 000 067 108 864 × 2 = 0 + 0.000 000 000 000 000 134 217 728;
  • 25) 0.000 000 000 000 000 134 217 728 × 2 = 0 + 0.000 000 000 000 000 268 435 456;
  • 26) 0.000 000 000 000 000 268 435 456 × 2 = 0 + 0.000 000 000 000 000 536 870 912;
  • 27) 0.000 000 000 000 000 536 870 912 × 2 = 0 + 0.000 000 000 000 001 073 741 824;
  • 28) 0.000 000 000 000 001 073 741 824 × 2 = 0 + 0.000 000 000 000 002 147 483 648;
  • 29) 0.000 000 000 000 002 147 483 648 × 2 = 0 + 0.000 000 000 000 004 294 967 296;
  • 30) 0.000 000 000 000 004 294 967 296 × 2 = 0 + 0.000 000 000 000 008 589 934 592;
  • 31) 0.000 000 000 000 008 589 934 592 × 2 = 0 + 0.000 000 000 000 017 179 869 184;
  • 32) 0.000 000 000 000 017 179 869 184 × 2 = 0 + 0.000 000 000 000 034 359 738 368;
  • 33) 0.000 000 000 000 034 359 738 368 × 2 = 0 + 0.000 000 000 000 068 719 476 736;
  • 34) 0.000 000 000 000 068 719 476 736 × 2 = 0 + 0.000 000 000 000 137 438 953 472;
  • 35) 0.000 000 000 000 137 438 953 472 × 2 = 0 + 0.000 000 000 000 274 877 906 944;
  • 36) 0.000 000 000 000 274 877 906 944 × 2 = 0 + 0.000 000 000 000 549 755 813 888;
  • 37) 0.000 000 000 000 549 755 813 888 × 2 = 0 + 0.000 000 000 001 099 511 627 776;
  • 38) 0.000 000 000 001 099 511 627 776 × 2 = 0 + 0.000 000 000 002 199 023 255 552;
  • 39) 0.000 000 000 002 199 023 255 552 × 2 = 0 + 0.000 000 000 004 398 046 511 104;
  • 40) 0.000 000 000 004 398 046 511 104 × 2 = 0 + 0.000 000 000 008 796 093 022 208;
  • 41) 0.000 000 000 008 796 093 022 208 × 2 = 0 + 0.000 000 000 017 592 186 044 416;
  • 42) 0.000 000 000 017 592 186 044 416 × 2 = 0 + 0.000 000 000 035 184 372 088 832;
  • 43) 0.000 000 000 035 184 372 088 832 × 2 = 0 + 0.000 000 000 070 368 744 177 664;
  • 44) 0.000 000 000 070 368 744 177 664 × 2 = 0 + 0.000 000 000 140 737 488 355 328;
  • 45) 0.000 000 000 140 737 488 355 328 × 2 = 0 + 0.000 000 000 281 474 976 710 656;
  • 46) 0.000 000 000 281 474 976 710 656 × 2 = 0 + 0.000 000 000 562 949 953 421 312;
  • 47) 0.000 000 000 562 949 953 421 312 × 2 = 0 + 0.000 000 001 125 899 906 842 624;
  • 48) 0.000 000 001 125 899 906 842 624 × 2 = 0 + 0.000 000 002 251 799 813 685 248;
  • 49) 0.000 000 002 251 799 813 685 248 × 2 = 0 + 0.000 000 004 503 599 627 370 496;
  • 50) 0.000 000 004 503 599 627 370 496 × 2 = 0 + 0.000 000 009 007 199 254 740 992;
  • 51) 0.000 000 009 007 199 254 740 992 × 2 = 0 + 0.000 000 018 014 398 509 481 984;
  • 52) 0.000 000 018 014 398 509 481 984 × 2 = 0 + 0.000 000 036 028 797 018 963 968;
  • 53) 0.000 000 036 028 797 018 963 968 × 2 = 0 + 0.000 000 072 057 594 037 927 936;
  • 54) 0.000 000 072 057 594 037 927 936 × 2 = 0 + 0.000 000 144 115 188 075 855 872;
  • 55) 0.000 000 144 115 188 075 855 872 × 2 = 0 + 0.000 000 288 230 376 151 711 744;
  • 56) 0.000 000 288 230 376 151 711 744 × 2 = 0 + 0.000 000 576 460 752 303 423 488;
  • 57) 0.000 000 576 460 752 303 423 488 × 2 = 0 + 0.000 001 152 921 504 606 846 976;
  • 58) 0.000 001 152 921 504 606 846 976 × 2 = 0 + 0.000 002 305 843 009 213 693 952;
  • 59) 0.000 002 305 843 009 213 693 952 × 2 = 0 + 0.000 004 611 686 018 427 387 904;
  • 60) 0.000 004 611 686 018 427 387 904 × 2 = 0 + 0.000 009 223 372 036 854 775 808;
  • 61) 0.000 009 223 372 036 854 775 808 × 2 = 0 + 0.000 018 446 744 073 709 551 616;
  • 62) 0.000 018 446 744 073 709 551 616 × 2 = 0 + 0.000 036 893 488 147 419 103 232;
  • 63) 0.000 036 893 488 147 419 103 232 × 2 = 0 + 0.000 073 786 976 294 838 206 464;
  • 64) 0.000 073 786 976 294 838 206 464 × 2 = 0 + 0.000 147 573 952 589 676 412 928;
  • 65) 0.000 147 573 952 589 676 412 928 × 2 = 0 + 0.000 295 147 905 179 352 825 856;
  • 66) 0.000 295 147 905 179 352 825 856 × 2 = 0 + 0.000 590 295 810 358 705 651 712;
  • 67) 0.000 590 295 810 358 705 651 712 × 2 = 0 + 0.001 180 591 620 717 411 303 424;
  • 68) 0.001 180 591 620 717 411 303 424 × 2 = 0 + 0.002 361 183 241 434 822 606 848;
  • 69) 0.002 361 183 241 434 822 606 848 × 2 = 0 + 0.004 722 366 482 869 645 213 696;
  • 70) 0.004 722 366 482 869 645 213 696 × 2 = 0 + 0.009 444 732 965 739 290 427 392;
  • 71) 0.009 444 732 965 739 290 427 392 × 2 = 0 + 0.018 889 465 931 478 580 854 784;
  • 72) 0.018 889 465 931 478 580 854 784 × 2 = 0 + 0.037 778 931 862 957 161 709 568;
  • 73) 0.037 778 931 862 957 161 709 568 × 2 = 0 + 0.075 557 863 725 914 323 419 136;
  • 74) 0.075 557 863 725 914 323 419 136 × 2 = 0 + 0.151 115 727 451 828 646 838 272;
  • 75) 0.151 115 727 451 828 646 838 272 × 2 = 0 + 0.302 231 454 903 657 293 676 544;
  • 76) 0.302 231 454 903 657 293 676 544 × 2 = 0 + 0.604 462 909 807 314 587 353 088;
  • 77) 0.604 462 909 807 314 587 353 088 × 2 = 1 + 0.208 925 819 614 629 174 706 176;
  • 78) 0.208 925 819 614 629 174 706 176 × 2 = 0 + 0.417 851 639 229 258 349 412 352;
  • 79) 0.417 851 639 229 258 349 412 352 × 2 = 0 + 0.835 703 278 458 516 698 824 704;
  • 80) 0.835 703 278 458 516 698 824 704 × 2 = 1 + 0.671 406 556 917 033 397 649 408;
  • 81) 0.671 406 556 917 033 397 649 408 × 2 = 1 + 0.342 813 113 834 066 795 298 816;
  • 82) 0.342 813 113 834 066 795 298 816 × 2 = 0 + 0.685 626 227 668 133 590 597 632;
  • 83) 0.685 626 227 668 133 590 597 632 × 2 = 1 + 0.371 252 455 336 267 181 195 264;
  • 84) 0.371 252 455 336 267 181 195 264 × 2 = 0 + 0.742 504 910 672 534 362 390 528;
  • 85) 0.742 504 910 672 534 362 390 528 × 2 = 1 + 0.485 009 821 345 068 724 781 056;
  • 86) 0.485 009 821 345 068 724 781 056 × 2 = 0 + 0.970 019 642 690 137 449 562 112;
  • 87) 0.970 019 642 690 137 449 562 112 × 2 = 1 + 0.940 039 285 380 274 899 124 224;
  • 88) 0.940 039 285 380 274 899 124 224 × 2 = 1 + 0.880 078 570 760 549 798 248 448;
  • 89) 0.880 078 570 760 549 798 248 448 × 2 = 1 + 0.760 157 141 521 099 596 496 896;
  • 90) 0.760 157 141 521 099 596 496 896 × 2 = 1 + 0.520 314 283 042 199 192 993 792;
  • 91) 0.520 314 283 042 199 192 993 792 × 2 = 1 + 0.040 628 566 084 398 385 987 584;
  • 92) 0.040 628 566 084 398 385 987 584 × 2 = 0 + 0.081 257 132 168 796 771 975 168;
  • 93) 0.081 257 132 168 796 771 975 168 × 2 = 0 + 0.162 514 264 337 593 543 950 336;
  • 94) 0.162 514 264 337 593 543 950 336 × 2 = 0 + 0.325 028 528 675 187 087 900 672;
  • 95) 0.325 028 528 675 187 087 900 672 × 2 = 0 + 0.650 057 057 350 374 175 801 344;
  • 96) 0.650 057 057 350 374 175 801 344 × 2 = 1 + 0.300 114 114 700 748 351 602 688;
  • 97) 0.300 114 114 700 748 351 602 688 × 2 = 0 + 0.600 228 229 401 496 703 205 376;
  • 98) 0.600 228 229 401 496 703 205 376 × 2 = 1 + 0.200 456 458 802 993 406 410 752;
  • 99) 0.200 456 458 802 993 406 410 752 × 2 = 0 + 0.400 912 917 605 986 812 821 504;
  • 100) 0.400 912 917 605 986 812 821 504 × 2 = 0 + 0.801 825 835 211 973 625 643 008;

We didn't get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit) and at least one integer that was different from zero => FULL STOP (losing precision...)

4. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the multiplying operations, starting from the top of the constructed list above:

0.000 000 000 000 000 000 000 008(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1001 1010 1011 1110 0001 0100(2)

Positive number before normalization:

0.000 000 000 000 000 000 000 008(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1001 1010 1011 1110 0001 0100(2)

5. Normalize the binary representation of the number, shifting the decimal mark 77 positions to the right so that only one non zero digit remains to the left of it:

0.000 000 000 000 000 000 000 008(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1001 1010 1011 1110 0001 0100(2) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1001 1010 1011 1110 0001 0100(2) × 20 =


1.0011 0101 0111 1100 0010 100(2) × 2-77

Up to this moment, there are the following elements that would feed into the 32 bit single precision IEEE 754 binary floating point representation:

Sign: 0 (a positive number)


Exponent (unadjusted): -77


Mantissa (not normalized): 1.0011 0101 0111 1100 0010 100

6. Adjust the exponent in 8 bit excess/bias notation and then convert it from decimal (base 10) to 8 bit binary, by using the same technique of repeatedly dividing by 2:

Exponent (adjusted) =


Exponent (unadjusted) + 2(8-1) - 1 =


-77 + 2(8-1) - 1 =


(-77 + 127)(10) =


50(10)


  • division = quotient + remainder;
  • 50 ÷ 2 = 25 + 0;
  • 25 ÷ 2 = 12 + 1;
  • 12 ÷ 2 = 6 + 0;
  • 6 ÷ 2 = 3 + 0;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

Exponent (adjusted) =


50(10) =


0011 0010(2)

7. Normalize mantissa, remove the leading (the leftmost) bit, since it's allways 1 (and the decimal point, if the case) then adjust its length to 23 bits, only if necessary (not the case here):

Mantissa (normalized) =


1. 001 1010 1011 1110 0001 0100 =


001 1010 1011 1110 0001 0100

Conclusion:

The three elements that make up the number's 32 bit single precision IEEE 754 binary floating point representation:

Sign (1 bit) =
0 (a positive number)


Exponent (8 bits) =
0011 0010


Mantissa (23 bits) =
001 1010 1011 1110 0001 0100

Number 0.000 000 000 000 000 000 000 008, a decimal, converted from decimal system (base 10)
to
32 bit single precision IEEE 754 binary floating point:


0 - 0011 0010 - 001 1010 1011 1110 0001 0100

(32 bits IEEE 754)
  • Sign (1 bit):

    • 0

      31
  • Exponent (8 bits):

    • 0

      30
    • 0

      29
    • 1

      28
    • 1

      27
    • 0

      26
    • 0

      25
    • 1

      24
    • 0

      23
  • Mantissa (23 bits):

    • 0

      22
    • 0

      21
    • 1

      20
    • 1

      19
    • 0

      18
    • 1

      17
    • 0

      16
    • 1

      15
    • 0

      14
    • 1

      13
    • 1

      12
    • 1

      11
    • 1

      10
    • 1

      9
    • 0

      8
    • 0

      7
    • 0

      6
    • 0

      5
    • 1

      4
    • 0

      3
    • 1

      2
    • 0

      1
    • 0

      0

Convert decimal numbers from base ten to 32 bit single precision IEEE 754 binary floating point standard

A number in 32 bit single precision IEEE 754 binary floating point standard representation requires three building elements: sign (it takes 1 bit and it's either 0 for positive or 1 for negative numbers), exponent (8 bits), mantissa (23 bits)

Latest decimal numbers converted from base ten to 32 bit single precision IEEE 754 floating point binary standard representation

How to convert decimal numbers from base ten to 32 bit single precision IEEE 754 binary floating point standard

Follow the steps below to convert a base 10 decimal number to 32 bit single precision IEEE 754 binary floating point:

  • 1. If the number to be converted is negative, start with its the positive version.
  • 2. First convert the integer part. Divide repeatedly by 2 the base ten positive representation of the integer number that is to be converted to binary, until we get a quotient that is equal to zero, keeping track of each remainder.
  • 3. Construct the base 2 representation of the positive integer part of the number, by taking all the remainders of the previous dividing operations, starting from the bottom of the list constructed above. Thus, the last remainder of the divisions becomes the first symbol (the leftmost) of the base two number, while the first remainder becomes the last symbol (the rightmost).
  • 4. Then convert the fractional part. Multiply the number repeatedly by 2, until we get a fractional part that is equal to zero, keeping track of each integer part of the results.
  • 5. Construct the base 2 representation of the fractional part of the number by taking all the integer parts of the previous multiplying operations, starting from the top of the constructed list above (they should appear in the binary representation, from left to right, in the order they have been calculated).
  • 6. Normalize the binary representation of the number, by shifting the decimal point (or if you prefer, the decimal mark) "n" positions either to the left or to the right, so that only one non zero digit remains to the left of the decimal point.
  • 7. Adjust the exponent in 8 bit excess/bias notation and then convert it from decimal (base 10) to 8 bit binary, by using the same technique of repeatedly dividing by 2, as shown above:
    Exponent (adjusted) = Exponent (unadjusted) + 2(8-1) - 1
  • 8. Normalize mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal sign if the case) and adjust its length to 23 bits, either by removing the excess bits from the right (losing precision...) or by adding extra '0' bits to the right.
  • 9. Sign (it takes 1 bit) is either 1 for a negative or 0 for a positive number.

Example: convert the negative number -25.347 from decimal system (base ten) to 32 bit single precision IEEE 754 binary floating point:

  • 1. Start with the positive version of the number:

    |-25.347| = 25.347

  • 2. First convert the integer part, 25. Divide it repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:
    • division = quotient + remainder;
    • 25 ÷ 2 = 12 + 1;
    • 12 ÷ 2 = 6 + 0;
    • 6 ÷ 2 = 3 + 0;
    • 3 ÷ 2 = 1 + 1;
    • 1 ÷ 2 = 0 + 1;
    • We have encountered a quotient that is ZERO => FULL STOP
  • 3. Construct the base 2 representation of the integer part of the number by taking all the remainders of the previous dividing operations, starting from the bottom of the list constructed above:

    25(10) = 1 1001(2)

  • 4. Then convert the fractional part, 0.347. Multiply repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:
    • #) multiplying = integer + fractional part;
    • 1) 0.347 × 2 = 0 + 0.694;
    • 2) 0.694 × 2 = 1 + 0.388;
    • 3) 0.388 × 2 = 0 + 0.776;
    • 4) 0.776 × 2 = 1 + 0.552;
    • 5) 0.552 × 2 = 1 + 0.104;
    • 6) 0.104 × 2 = 0 + 0.208;
    • 7) 0.208 × 2 = 0 + 0.416;
    • 8) 0.416 × 2 = 0 + 0.832;
    • 9) 0.832 × 2 = 1 + 0.664;
    • 10) 0.664 × 2 = 1 + 0.328;
    • 11) 0.328 × 2 = 0 + 0.656;
    • 12) 0.656 × 2 = 1 + 0.312;
    • 13) 0.312 × 2 = 0 + 0.624;
    • 14) 0.624 × 2 = 1 + 0.248;
    • 15) 0.248 × 2 = 0 + 0.496;
    • 16) 0.496 × 2 = 0 + 0.992;
    • 17) 0.992 × 2 = 1 + 0.984;
    • 18) 0.984 × 2 = 1 + 0.968;
    • 19) 0.968 × 2 = 1 + 0.936;
    • 20) 0.936 × 2 = 1 + 0.872;
    • 21) 0.872 × 2 = 1 + 0.744;
    • 22) 0.744 × 2 = 1 + 0.488;
    • 23) 0.488 × 2 = 0 + 0.976;
    • 24) 0.976 × 2 = 1 + 0.952;
    • We didn't get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit = 23) and at least one integer part that was different from zero => FULL STOP (losing precision...).
  • 5. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the previous multiplying operations, starting from the top of the constructed list above:

    0.347(10) = 0.0101 1000 1101 0100 1111 1101(2)

  • 6. Summarizing - the positive number before normalization:

    25.347(10) = 1 1001.0101 1000 1101 0100 1111 1101(2)

  • 7. Normalize the binary representation of the number, shifting the decimal point 4 positions to the left so that only one non-zero digit stays to the left of the decimal point:

    25.347(10) =
    1 1001.0101 1000 1101 0100 1111 1101(2) =
    1 1001.0101 1000 1101 0100 1111 1101(2) × 20 =
    1.1001 0101 1000 1101 0100 1111 1101(2) × 24

  • 8. Up to this moment, there are the following elements that would feed into the 32 bit single precision IEEE 754 binary floating point:

    Sign: 1 (a negative number)

    Exponent (unadjusted): 4

    Mantissa (not-normalized): 1.1001 0101 1000 1101 0100 1111 1101

  • 9. Adjust the exponent in 8 bit excess/bias notation and then convert it from decimal (base 10) to 8 bit binary (base 2), by using the same technique of repeatedly dividing it by 2, as already demonstrated above:

    Exponent (adjusted) = Exponent (unadjusted) + 2(8-1) - 1 = (4 + 127)(10) = 131(10) =
    1000 0011(2)

  • 10. Normalize the mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal point) and adjust its length to 23 bits, by removing the excess bits from the right (losing precision...):

    Mantissa (not-normalized): 1.1001 0101 1000 1101 0100 1111 1101

    Mantissa (normalized): 100 1010 1100 0110 1010 0111

  • Conclusion:

    Sign (1 bit) = 1 (a negative number)

    Exponent (8 bits) = 1000 0011

    Mantissa (23 bits) = 100 1010 1100 0110 1010 0111

  • Number -25.347, converted from the decimal system (base 10) to 32 bit single precision IEEE 754 binary floating point =


    1 - 1000 0011 - 100 1010 1100 0110 1010 0111