1 010 101 010 101 000 100 010 101 008 170 Converted to 32 Bit Single Precision IEEE 754 Binary Floating Point Representation Standard

Convert decimal 1 010 101 010 101 000 100 010 101 008 170(10) to 32 bit single precision IEEE 754 binary floating point representation standard (1 bit for sign, 8 bits for exponent, 23 bits for mantissa)

What are the steps to convert decimal number
1 010 101 010 101 000 100 010 101 008 170(10) to 32 bit single precision IEEE 754 binary floating point representation (1 bit for sign, 8 bits for exponent, 23 bits for mantissa)

1. Divide the number repeatedly by 2.

Keep track of each remainder.

We stop when we get a quotient that is equal to zero.


  • division = quotient + remainder;
  • 1 010 101 010 101 000 100 010 101 008 170 ÷ 2 = 505 050 505 050 500 050 005 050 504 085 + 0;
  • 505 050 505 050 500 050 005 050 504 085 ÷ 2 = 252 525 252 525 250 025 002 525 252 042 + 1;
  • 252 525 252 525 250 025 002 525 252 042 ÷ 2 = 126 262 626 262 625 012 501 262 626 021 + 0;
  • 126 262 626 262 625 012 501 262 626 021 ÷ 2 = 63 131 313 131 312 506 250 631 313 010 + 1;
  • 63 131 313 131 312 506 250 631 313 010 ÷ 2 = 31 565 656 565 656 253 125 315 656 505 + 0;
  • 31 565 656 565 656 253 125 315 656 505 ÷ 2 = 15 782 828 282 828 126 562 657 828 252 + 1;
  • 15 782 828 282 828 126 562 657 828 252 ÷ 2 = 7 891 414 141 414 063 281 328 914 126 + 0;
  • 7 891 414 141 414 063 281 328 914 126 ÷ 2 = 3 945 707 070 707 031 640 664 457 063 + 0;
  • 3 945 707 070 707 031 640 664 457 063 ÷ 2 = 1 972 853 535 353 515 820 332 228 531 + 1;
  • 1 972 853 535 353 515 820 332 228 531 ÷ 2 = 986 426 767 676 757 910 166 114 265 + 1;
  • 986 426 767 676 757 910 166 114 265 ÷ 2 = 493 213 383 838 378 955 083 057 132 + 1;
  • 493 213 383 838 378 955 083 057 132 ÷ 2 = 246 606 691 919 189 477 541 528 566 + 0;
  • 246 606 691 919 189 477 541 528 566 ÷ 2 = 123 303 345 959 594 738 770 764 283 + 0;
  • 123 303 345 959 594 738 770 764 283 ÷ 2 = 61 651 672 979 797 369 385 382 141 + 1;
  • 61 651 672 979 797 369 385 382 141 ÷ 2 = 30 825 836 489 898 684 692 691 070 + 1;
  • 30 825 836 489 898 684 692 691 070 ÷ 2 = 15 412 918 244 949 342 346 345 535 + 0;
  • 15 412 918 244 949 342 346 345 535 ÷ 2 = 7 706 459 122 474 671 173 172 767 + 1;
  • 7 706 459 122 474 671 173 172 767 ÷ 2 = 3 853 229 561 237 335 586 586 383 + 1;
  • 3 853 229 561 237 335 586 586 383 ÷ 2 = 1 926 614 780 618 667 793 293 191 + 1;
  • 1 926 614 780 618 667 793 293 191 ÷ 2 = 963 307 390 309 333 896 646 595 + 1;
  • 963 307 390 309 333 896 646 595 ÷ 2 = 481 653 695 154 666 948 323 297 + 1;
  • 481 653 695 154 666 948 323 297 ÷ 2 = 240 826 847 577 333 474 161 648 + 1;
  • 240 826 847 577 333 474 161 648 ÷ 2 = 120 413 423 788 666 737 080 824 + 0;
  • 120 413 423 788 666 737 080 824 ÷ 2 = 60 206 711 894 333 368 540 412 + 0;
  • 60 206 711 894 333 368 540 412 ÷ 2 = 30 103 355 947 166 684 270 206 + 0;
  • 30 103 355 947 166 684 270 206 ÷ 2 = 15 051 677 973 583 342 135 103 + 0;
  • 15 051 677 973 583 342 135 103 ÷ 2 = 7 525 838 986 791 671 067 551 + 1;
  • 7 525 838 986 791 671 067 551 ÷ 2 = 3 762 919 493 395 835 533 775 + 1;
  • 3 762 919 493 395 835 533 775 ÷ 2 = 1 881 459 746 697 917 766 887 + 1;
  • 1 881 459 746 697 917 766 887 ÷ 2 = 940 729 873 348 958 883 443 + 1;
  • 940 729 873 348 958 883 443 ÷ 2 = 470 364 936 674 479 441 721 + 1;
  • 470 364 936 674 479 441 721 ÷ 2 = 235 182 468 337 239 720 860 + 1;
  • 235 182 468 337 239 720 860 ÷ 2 = 117 591 234 168 619 860 430 + 0;
  • 117 591 234 168 619 860 430 ÷ 2 = 58 795 617 084 309 930 215 + 0;
  • 58 795 617 084 309 930 215 ÷ 2 = 29 397 808 542 154 965 107 + 1;
  • 29 397 808 542 154 965 107 ÷ 2 = 14 698 904 271 077 482 553 + 1;
  • 14 698 904 271 077 482 553 ÷ 2 = 7 349 452 135 538 741 276 + 1;
  • 7 349 452 135 538 741 276 ÷ 2 = 3 674 726 067 769 370 638 + 0;
  • 3 674 726 067 769 370 638 ÷ 2 = 1 837 363 033 884 685 319 + 0;
  • 1 837 363 033 884 685 319 ÷ 2 = 918 681 516 942 342 659 + 1;
  • 918 681 516 942 342 659 ÷ 2 = 459 340 758 471 171 329 + 1;
  • 459 340 758 471 171 329 ÷ 2 = 229 670 379 235 585 664 + 1;
  • 229 670 379 235 585 664 ÷ 2 = 114 835 189 617 792 832 + 0;
  • 114 835 189 617 792 832 ÷ 2 = 57 417 594 808 896 416 + 0;
  • 57 417 594 808 896 416 ÷ 2 = 28 708 797 404 448 208 + 0;
  • 28 708 797 404 448 208 ÷ 2 = 14 354 398 702 224 104 + 0;
  • 14 354 398 702 224 104 ÷ 2 = 7 177 199 351 112 052 + 0;
  • 7 177 199 351 112 052 ÷ 2 = 3 588 599 675 556 026 + 0;
  • 3 588 599 675 556 026 ÷ 2 = 1 794 299 837 778 013 + 0;
  • 1 794 299 837 778 013 ÷ 2 = 897 149 918 889 006 + 1;
  • 897 149 918 889 006 ÷ 2 = 448 574 959 444 503 + 0;
  • 448 574 959 444 503 ÷ 2 = 224 287 479 722 251 + 1;
  • 224 287 479 722 251 ÷ 2 = 112 143 739 861 125 + 1;
  • 112 143 739 861 125 ÷ 2 = 56 071 869 930 562 + 1;
  • 56 071 869 930 562 ÷ 2 = 28 035 934 965 281 + 0;
  • 28 035 934 965 281 ÷ 2 = 14 017 967 482 640 + 1;
  • 14 017 967 482 640 ÷ 2 = 7 008 983 741 320 + 0;
  • 7 008 983 741 320 ÷ 2 = 3 504 491 870 660 + 0;
  • 3 504 491 870 660 ÷ 2 = 1 752 245 935 330 + 0;
  • 1 752 245 935 330 ÷ 2 = 876 122 967 665 + 0;
  • 876 122 967 665 ÷ 2 = 438 061 483 832 + 1;
  • 438 061 483 832 ÷ 2 = 219 030 741 916 + 0;
  • 219 030 741 916 ÷ 2 = 109 515 370 958 + 0;
  • 109 515 370 958 ÷ 2 = 54 757 685 479 + 0;
  • 54 757 685 479 ÷ 2 = 27 378 842 739 + 1;
  • 27 378 842 739 ÷ 2 = 13 689 421 369 + 1;
  • 13 689 421 369 ÷ 2 = 6 844 710 684 + 1;
  • 6 844 710 684 ÷ 2 = 3 422 355 342 + 0;
  • 3 422 355 342 ÷ 2 = 1 711 177 671 + 0;
  • 1 711 177 671 ÷ 2 = 855 588 835 + 1;
  • 855 588 835 ÷ 2 = 427 794 417 + 1;
  • 427 794 417 ÷ 2 = 213 897 208 + 1;
  • 213 897 208 ÷ 2 = 106 948 604 + 0;
  • 106 948 604 ÷ 2 = 53 474 302 + 0;
  • 53 474 302 ÷ 2 = 26 737 151 + 0;
  • 26 737 151 ÷ 2 = 13 368 575 + 1;
  • 13 368 575 ÷ 2 = 6 684 287 + 1;
  • 6 684 287 ÷ 2 = 3 342 143 + 1;
  • 3 342 143 ÷ 2 = 1 671 071 + 1;
  • 1 671 071 ÷ 2 = 835 535 + 1;
  • 835 535 ÷ 2 = 417 767 + 1;
  • 417 767 ÷ 2 = 208 883 + 1;
  • 208 883 ÷ 2 = 104 441 + 1;
  • 104 441 ÷ 2 = 52 220 + 1;
  • 52 220 ÷ 2 = 26 110 + 0;
  • 26 110 ÷ 2 = 13 055 + 0;
  • 13 055 ÷ 2 = 6 527 + 1;
  • 6 527 ÷ 2 = 3 263 + 1;
  • 3 263 ÷ 2 = 1 631 + 1;
  • 1 631 ÷ 2 = 815 + 1;
  • 815 ÷ 2 = 407 + 1;
  • 407 ÷ 2 = 203 + 1;
  • 203 ÷ 2 = 101 + 1;
  • 101 ÷ 2 = 50 + 1;
  • 50 ÷ 2 = 25 + 0;
  • 25 ÷ 2 = 12 + 1;
  • 12 ÷ 2 = 6 + 0;
  • 6 ÷ 2 = 3 + 0;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

2. Construct the base 2 representation of the positive number.

Take all the remainders starting from the bottom of the list constructed above.

1 010 101 010 101 000 100 010 101 008 170(10) =


1100 1011 1111 1100 1111 1111 1000 1110 0111 0001 0000 1011 1010 0000 0011 1001 1100 1111 1100 0011 1111 0110 0111 0010 1010(2)


3. Normalize the binary representation of the number.

Shift the decimal mark 99 positions to the left, so that only one non zero digit remains to the left of it:


1 010 101 010 101 000 100 010 101 008 170(10) =


1100 1011 1111 1100 1111 1111 1000 1110 0111 0001 0000 1011 1010 0000 0011 1001 1100 1111 1100 0011 1111 0110 0111 0010 1010(2) =


1100 1011 1111 1100 1111 1111 1000 1110 0111 0001 0000 1011 1010 0000 0011 1001 1100 1111 1100 0011 1111 0110 0111 0010 1010(2) × 20 =


1.1001 0111 1111 1001 1111 1111 0001 1100 1110 0010 0001 0111 0100 0000 0111 0011 1001 1111 1000 0111 1110 1100 1110 0101 010(2) × 299


4. 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): 99


Mantissa (not normalized):
1.1001 0111 1111 1001 1111 1111 0001 1100 1110 0010 0001 0111 0100 0000 0111 0011 1001 1111 1000 0111 1110 1100 1110 0101 010


5. Adjust the exponent.

Use the 8 bit excess/bias notation:


Exponent (adjusted) =


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


99 + 2(8-1) - 1 =


(99 + 127)(10) =


226(10)


6. Convert the adjusted exponent from the decimal (base 10) to 8 bit binary.

Use the same technique of repeatedly dividing by 2:


  • division = quotient + remainder;
  • 226 ÷ 2 = 113 + 0;
  • 113 ÷ 2 = 56 + 1;
  • 56 ÷ 2 = 28 + 0;
  • 28 ÷ 2 = 14 + 0;
  • 14 ÷ 2 = 7 + 0;
  • 7 ÷ 2 = 3 + 1;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

7. Construct the base 2 representation of the adjusted exponent.

Take all the remainders starting from the bottom of the list constructed above.


Exponent (adjusted) =


226(10) =


1110 0010(2)


8. Normalize the mantissa.

a) Remove the leading (the leftmost) bit, since it's allways 1, and the decimal point, if the case.


b) Adjust its length to 23 bits, by removing the excess bits, from the right (if any of the excess bits is set on 1, we are losing precision...).


Mantissa (normalized) =


1. 100 1011 1111 1100 1111 1111 1000 1110 0111 0001 0000 1011 1010 0000 0011 1001 1100 1111 1100 0011 1111 0110 0111 0010 1010 =


100 1011 1111 1100 1111 1111


9. 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) =
1110 0010


Mantissa (23 bits) =
100 1011 1111 1100 1111 1111


Decimal number 1 010 101 010 101 000 100 010 101 008 170 converted to 32 bit single precision IEEE 754 binary floating point representation:

0 - 1110 0010 - 100 1011 1111 1100 1111 1111


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