-0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7 Converted to 32 Bit Single Precision IEEE 754 Binary Floating Point Representation Standard

Convert decimal -0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7(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
-0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7(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. Start with the positive version of the number:

|-0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7| = 0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7


2. First, convert to binary (in base 2) the integer part: 0.
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;
  • 0 ÷ 2 = 0 + 0;

3. Construct the base 2 representation of the integer part of the number.

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

0(10) =


0(2)


4. Convert to binary (base 2) the fractional part: 0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7.

Multiply it repeatedly by 2.


Keep track of each integer part of the results.


Stop when we get a fractional part that is equal to zero.


  • #) multiplying = integer + fractional part;
  • 1) 0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7 × 2 = 0 + 0.000 000 000 000 000 000 054 365 636 560 000 002 801 277 505 4;
  • 2) 0.000 000 000 000 000 000 054 365 636 560 000 002 801 277 505 4 × 2 = 0 + 0.000 000 000 000 000 000 108 731 273 120 000 005 602 555 010 8;
  • 3) 0.000 000 000 000 000 000 108 731 273 120 000 005 602 555 010 8 × 2 = 0 + 0.000 000 000 000 000 000 217 462 546 240 000 011 205 110 021 6;
  • 4) 0.000 000 000 000 000 000 217 462 546 240 000 011 205 110 021 6 × 2 = 0 + 0.000 000 000 000 000 000 434 925 092 480 000 022 410 220 043 2;
  • 5) 0.000 000 000 000 000 000 434 925 092 480 000 022 410 220 043 2 × 2 = 0 + 0.000 000 000 000 000 000 869 850 184 960 000 044 820 440 086 4;
  • 6) 0.000 000 000 000 000 000 869 850 184 960 000 044 820 440 086 4 × 2 = 0 + 0.000 000 000 000 000 001 739 700 369 920 000 089 640 880 172 8;
  • 7) 0.000 000 000 000 000 001 739 700 369 920 000 089 640 880 172 8 × 2 = 0 + 0.000 000 000 000 000 003 479 400 739 840 000 179 281 760 345 6;
  • 8) 0.000 000 000 000 000 003 479 400 739 840 000 179 281 760 345 6 × 2 = 0 + 0.000 000 000 000 000 006 958 801 479 680 000 358 563 520 691 2;
  • 9) 0.000 000 000 000 000 006 958 801 479 680 000 358 563 520 691 2 × 2 = 0 + 0.000 000 000 000 000 013 917 602 959 360 000 717 127 041 382 4;
  • 10) 0.000 000 000 000 000 013 917 602 959 360 000 717 127 041 382 4 × 2 = 0 + 0.000 000 000 000 000 027 835 205 918 720 001 434 254 082 764 8;
  • 11) 0.000 000 000 000 000 027 835 205 918 720 001 434 254 082 764 8 × 2 = 0 + 0.000 000 000 000 000 055 670 411 837 440 002 868 508 165 529 6;
  • 12) 0.000 000 000 000 000 055 670 411 837 440 002 868 508 165 529 6 × 2 = 0 + 0.000 000 000 000 000 111 340 823 674 880 005 737 016 331 059 2;
  • 13) 0.000 000 000 000 000 111 340 823 674 880 005 737 016 331 059 2 × 2 = 0 + 0.000 000 000 000 000 222 681 647 349 760 011 474 032 662 118 4;
  • 14) 0.000 000 000 000 000 222 681 647 349 760 011 474 032 662 118 4 × 2 = 0 + 0.000 000 000 000 000 445 363 294 699 520 022 948 065 324 236 8;
  • 15) 0.000 000 000 000 000 445 363 294 699 520 022 948 065 324 236 8 × 2 = 0 + 0.000 000 000 000 000 890 726 589 399 040 045 896 130 648 473 6;
  • 16) 0.000 000 000 000 000 890 726 589 399 040 045 896 130 648 473 6 × 2 = 0 + 0.000 000 000 000 001 781 453 178 798 080 091 792 261 296 947 2;
  • 17) 0.000 000 000 000 001 781 453 178 798 080 091 792 261 296 947 2 × 2 = 0 + 0.000 000 000 000 003 562 906 357 596 160 183 584 522 593 894 4;
  • 18) 0.000 000 000 000 003 562 906 357 596 160 183 584 522 593 894 4 × 2 = 0 + 0.000 000 000 000 007 125 812 715 192 320 367 169 045 187 788 8;
  • 19) 0.000 000 000 000 007 125 812 715 192 320 367 169 045 187 788 8 × 2 = 0 + 0.000 000 000 000 014 251 625 430 384 640 734 338 090 375 577 6;
  • 20) 0.000 000 000 000 014 251 625 430 384 640 734 338 090 375 577 6 × 2 = 0 + 0.000 000 000 000 028 503 250 860 769 281 468 676 180 751 155 2;
  • 21) 0.000 000 000 000 028 503 250 860 769 281 468 676 180 751 155 2 × 2 = 0 + 0.000 000 000 000 057 006 501 721 538 562 937 352 361 502 310 4;
  • 22) 0.000 000 000 000 057 006 501 721 538 562 937 352 361 502 310 4 × 2 = 0 + 0.000 000 000 000 114 013 003 443 077 125 874 704 723 004 620 8;
  • 23) 0.000 000 000 000 114 013 003 443 077 125 874 704 723 004 620 8 × 2 = 0 + 0.000 000 000 000 228 026 006 886 154 251 749 409 446 009 241 6;
  • 24) 0.000 000 000 000 228 026 006 886 154 251 749 409 446 009 241 6 × 2 = 0 + 0.000 000 000 000 456 052 013 772 308 503 498 818 892 018 483 2;
  • 25) 0.000 000 000 000 456 052 013 772 308 503 498 818 892 018 483 2 × 2 = 0 + 0.000 000 000 000 912 104 027 544 617 006 997 637 784 036 966 4;
  • 26) 0.000 000 000 000 912 104 027 544 617 006 997 637 784 036 966 4 × 2 = 0 + 0.000 000 000 001 824 208 055 089 234 013 995 275 568 073 932 8;
  • 27) 0.000 000 000 001 824 208 055 089 234 013 995 275 568 073 932 8 × 2 = 0 + 0.000 000 000 003 648 416 110 178 468 027 990 551 136 147 865 6;
  • 28) 0.000 000 000 003 648 416 110 178 468 027 990 551 136 147 865 6 × 2 = 0 + 0.000 000 000 007 296 832 220 356 936 055 981 102 272 295 731 2;
  • 29) 0.000 000 000 007 296 832 220 356 936 055 981 102 272 295 731 2 × 2 = 0 + 0.000 000 000 014 593 664 440 713 872 111 962 204 544 591 462 4;
  • 30) 0.000 000 000 014 593 664 440 713 872 111 962 204 544 591 462 4 × 2 = 0 + 0.000 000 000 029 187 328 881 427 744 223 924 409 089 182 924 8;
  • 31) 0.000 000 000 029 187 328 881 427 744 223 924 409 089 182 924 8 × 2 = 0 + 0.000 000 000 058 374 657 762 855 488 447 848 818 178 365 849 6;
  • 32) 0.000 000 000 058 374 657 762 855 488 447 848 818 178 365 849 6 × 2 = 0 + 0.000 000 000 116 749 315 525 710 976 895 697 636 356 731 699 2;
  • 33) 0.000 000 000 116 749 315 525 710 976 895 697 636 356 731 699 2 × 2 = 0 + 0.000 000 000 233 498 631 051 421 953 791 395 272 713 463 398 4;
  • 34) 0.000 000 000 233 498 631 051 421 953 791 395 272 713 463 398 4 × 2 = 0 + 0.000 000 000 466 997 262 102 843 907 582 790 545 426 926 796 8;
  • 35) 0.000 000 000 466 997 262 102 843 907 582 790 545 426 926 796 8 × 2 = 0 + 0.000 000 000 933 994 524 205 687 815 165 581 090 853 853 593 6;
  • 36) 0.000 000 000 933 994 524 205 687 815 165 581 090 853 853 593 6 × 2 = 0 + 0.000 000 001 867 989 048 411 375 630 331 162 181 707 707 187 2;
  • 37) 0.000 000 001 867 989 048 411 375 630 331 162 181 707 707 187 2 × 2 = 0 + 0.000 000 003 735 978 096 822 751 260 662 324 363 415 414 374 4;
  • 38) 0.000 000 003 735 978 096 822 751 260 662 324 363 415 414 374 4 × 2 = 0 + 0.000 000 007 471 956 193 645 502 521 324 648 726 830 828 748 8;
  • 39) 0.000 000 007 471 956 193 645 502 521 324 648 726 830 828 748 8 × 2 = 0 + 0.000 000 014 943 912 387 291 005 042 649 297 453 661 657 497 6;
  • 40) 0.000 000 014 943 912 387 291 005 042 649 297 453 661 657 497 6 × 2 = 0 + 0.000 000 029 887 824 774 582 010 085 298 594 907 323 314 995 2;
  • 41) 0.000 000 029 887 824 774 582 010 085 298 594 907 323 314 995 2 × 2 = 0 + 0.000 000 059 775 649 549 164 020 170 597 189 814 646 629 990 4;
  • 42) 0.000 000 059 775 649 549 164 020 170 597 189 814 646 629 990 4 × 2 = 0 + 0.000 000 119 551 299 098 328 040 341 194 379 629 293 259 980 8;
  • 43) 0.000 000 119 551 299 098 328 040 341 194 379 629 293 259 980 8 × 2 = 0 + 0.000 000 239 102 598 196 656 080 682 388 759 258 586 519 961 6;
  • 44) 0.000 000 239 102 598 196 656 080 682 388 759 258 586 519 961 6 × 2 = 0 + 0.000 000 478 205 196 393 312 161 364 777 518 517 173 039 923 2;
  • 45) 0.000 000 478 205 196 393 312 161 364 777 518 517 173 039 923 2 × 2 = 0 + 0.000 000 956 410 392 786 624 322 729 555 037 034 346 079 846 4;
  • 46) 0.000 000 956 410 392 786 624 322 729 555 037 034 346 079 846 4 × 2 = 0 + 0.000 001 912 820 785 573 248 645 459 110 074 068 692 159 692 8;
  • 47) 0.000 001 912 820 785 573 248 645 459 110 074 068 692 159 692 8 × 2 = 0 + 0.000 003 825 641 571 146 497 290 918 220 148 137 384 319 385 6;
  • 48) 0.000 003 825 641 571 146 497 290 918 220 148 137 384 319 385 6 × 2 = 0 + 0.000 007 651 283 142 292 994 581 836 440 296 274 768 638 771 2;
  • 49) 0.000 007 651 283 142 292 994 581 836 440 296 274 768 638 771 2 × 2 = 0 + 0.000 015 302 566 284 585 989 163 672 880 592 549 537 277 542 4;
  • 50) 0.000 015 302 566 284 585 989 163 672 880 592 549 537 277 542 4 × 2 = 0 + 0.000 030 605 132 569 171 978 327 345 761 185 099 074 555 084 8;
  • 51) 0.000 030 605 132 569 171 978 327 345 761 185 099 074 555 084 8 × 2 = 0 + 0.000 061 210 265 138 343 956 654 691 522 370 198 149 110 169 6;
  • 52) 0.000 061 210 265 138 343 956 654 691 522 370 198 149 110 169 6 × 2 = 0 + 0.000 122 420 530 276 687 913 309 383 044 740 396 298 220 339 2;
  • 53) 0.000 122 420 530 276 687 913 309 383 044 740 396 298 220 339 2 × 2 = 0 + 0.000 244 841 060 553 375 826 618 766 089 480 792 596 440 678 4;
  • 54) 0.000 244 841 060 553 375 826 618 766 089 480 792 596 440 678 4 × 2 = 0 + 0.000 489 682 121 106 751 653 237 532 178 961 585 192 881 356 8;
  • 55) 0.000 489 682 121 106 751 653 237 532 178 961 585 192 881 356 8 × 2 = 0 + 0.000 979 364 242 213 503 306 475 064 357 923 170 385 762 713 6;
  • 56) 0.000 979 364 242 213 503 306 475 064 357 923 170 385 762 713 6 × 2 = 0 + 0.001 958 728 484 427 006 612 950 128 715 846 340 771 525 427 2;
  • 57) 0.001 958 728 484 427 006 612 950 128 715 846 340 771 525 427 2 × 2 = 0 + 0.003 917 456 968 854 013 225 900 257 431 692 681 543 050 854 4;
  • 58) 0.003 917 456 968 854 013 225 900 257 431 692 681 543 050 854 4 × 2 = 0 + 0.007 834 913 937 708 026 451 800 514 863 385 363 086 101 708 8;
  • 59) 0.007 834 913 937 708 026 451 800 514 863 385 363 086 101 708 8 × 2 = 0 + 0.015 669 827 875 416 052 903 601 029 726 770 726 172 203 417 6;
  • 60) 0.015 669 827 875 416 052 903 601 029 726 770 726 172 203 417 6 × 2 = 0 + 0.031 339 655 750 832 105 807 202 059 453 541 452 344 406 835 2;
  • 61) 0.031 339 655 750 832 105 807 202 059 453 541 452 344 406 835 2 × 2 = 0 + 0.062 679 311 501 664 211 614 404 118 907 082 904 688 813 670 4;
  • 62) 0.062 679 311 501 664 211 614 404 118 907 082 904 688 813 670 4 × 2 = 0 + 0.125 358 623 003 328 423 228 808 237 814 165 809 377 627 340 8;
  • 63) 0.125 358 623 003 328 423 228 808 237 814 165 809 377 627 340 8 × 2 = 0 + 0.250 717 246 006 656 846 457 616 475 628 331 618 755 254 681 6;
  • 64) 0.250 717 246 006 656 846 457 616 475 628 331 618 755 254 681 6 × 2 = 0 + 0.501 434 492 013 313 692 915 232 951 256 663 237 510 509 363 2;
  • 65) 0.501 434 492 013 313 692 915 232 951 256 663 237 510 509 363 2 × 2 = 1 + 0.002 868 984 026 627 385 830 465 902 513 326 475 021 018 726 4;
  • 66) 0.002 868 984 026 627 385 830 465 902 513 326 475 021 018 726 4 × 2 = 0 + 0.005 737 968 053 254 771 660 931 805 026 652 950 042 037 452 8;
  • 67) 0.005 737 968 053 254 771 660 931 805 026 652 950 042 037 452 8 × 2 = 0 + 0.011 475 936 106 509 543 321 863 610 053 305 900 084 074 905 6;
  • 68) 0.011 475 936 106 509 543 321 863 610 053 305 900 084 074 905 6 × 2 = 0 + 0.022 951 872 213 019 086 643 727 220 106 611 800 168 149 811 2;
  • 69) 0.022 951 872 213 019 086 643 727 220 106 611 800 168 149 811 2 × 2 = 0 + 0.045 903 744 426 038 173 287 454 440 213 223 600 336 299 622 4;
  • 70) 0.045 903 744 426 038 173 287 454 440 213 223 600 336 299 622 4 × 2 = 0 + 0.091 807 488 852 076 346 574 908 880 426 447 200 672 599 244 8;
  • 71) 0.091 807 488 852 076 346 574 908 880 426 447 200 672 599 244 8 × 2 = 0 + 0.183 614 977 704 152 693 149 817 760 852 894 401 345 198 489 6;
  • 72) 0.183 614 977 704 152 693 149 817 760 852 894 401 345 198 489 6 × 2 = 0 + 0.367 229 955 408 305 386 299 635 521 705 788 802 690 396 979 2;
  • 73) 0.367 229 955 408 305 386 299 635 521 705 788 802 690 396 979 2 × 2 = 0 + 0.734 459 910 816 610 772 599 271 043 411 577 605 380 793 958 4;
  • 74) 0.734 459 910 816 610 772 599 271 043 411 577 605 380 793 958 4 × 2 = 1 + 0.468 919 821 633 221 545 198 542 086 823 155 210 761 587 916 8;
  • 75) 0.468 919 821 633 221 545 198 542 086 823 155 210 761 587 916 8 × 2 = 0 + 0.937 839 643 266 443 090 397 084 173 646 310 421 523 175 833 6;
  • 76) 0.937 839 643 266 443 090 397 084 173 646 310 421 523 175 833 6 × 2 = 1 + 0.875 679 286 532 886 180 794 168 347 292 620 843 046 351 667 2;
  • 77) 0.875 679 286 532 886 180 794 168 347 292 620 843 046 351 667 2 × 2 = 1 + 0.751 358 573 065 772 361 588 336 694 585 241 686 092 703 334 4;
  • 78) 0.751 358 573 065 772 361 588 336 694 585 241 686 092 703 334 4 × 2 = 1 + 0.502 717 146 131 544 723 176 673 389 170 483 372 185 406 668 8;
  • 79) 0.502 717 146 131 544 723 176 673 389 170 483 372 185 406 668 8 × 2 = 1 + 0.005 434 292 263 089 446 353 346 778 340 966 744 370 813 337 6;
  • 80) 0.005 434 292 263 089 446 353 346 778 340 966 744 370 813 337 6 × 2 = 0 + 0.010 868 584 526 178 892 706 693 556 681 933 488 741 626 675 2;
  • 81) 0.010 868 584 526 178 892 706 693 556 681 933 488 741 626 675 2 × 2 = 0 + 0.021 737 169 052 357 785 413 387 113 363 866 977 483 253 350 4;
  • 82) 0.021 737 169 052 357 785 413 387 113 363 866 977 483 253 350 4 × 2 = 0 + 0.043 474 338 104 715 570 826 774 226 727 733 954 966 506 700 8;
  • 83) 0.043 474 338 104 715 570 826 774 226 727 733 954 966 506 700 8 × 2 = 0 + 0.086 948 676 209 431 141 653 548 453 455 467 909 933 013 401 6;
  • 84) 0.086 948 676 209 431 141 653 548 453 455 467 909 933 013 401 6 × 2 = 0 + 0.173 897 352 418 862 283 307 096 906 910 935 819 866 026 803 2;
  • 85) 0.173 897 352 418 862 283 307 096 906 910 935 819 866 026 803 2 × 2 = 0 + 0.347 794 704 837 724 566 614 193 813 821 871 639 732 053 606 4;
  • 86) 0.347 794 704 837 724 566 614 193 813 821 871 639 732 053 606 4 × 2 = 0 + 0.695 589 409 675 449 133 228 387 627 643 743 279 464 107 212 8;
  • 87) 0.695 589 409 675 449 133 228 387 627 643 743 279 464 107 212 8 × 2 = 1 + 0.391 178 819 350 898 266 456 775 255 287 486 558 928 214 425 6;
  • 88) 0.391 178 819 350 898 266 456 775 255 287 486 558 928 214 425 6 × 2 = 0 + 0.782 357 638 701 796 532 913 550 510 574 973 117 856 428 851 2;

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 - the converted number we get in the end will be just a very good approximation of the initial one).


5. Construct the base 2 representation of the fractional part of the number.

Take all the integer parts of the multiplying operations, starting from the top of the constructed list above:


0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1000 0000 0101 1110 0000 0010(2)

6. Positive number before normalization:

0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1000 0000 0101 1110 0000 0010(2)

7. Normalize the binary representation of the number.

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


0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1000 0000 0101 1110 0000 0010(2) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1000 0000 0101 1110 0000 0010(2) × 20 =


1.0000 0000 1011 1100 0000 010(2) × 2-65


8. 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 1 (a negative number)


Exponent (unadjusted): -65


Mantissa (not normalized):
1.0000 0000 1011 1100 0000 010


9. Adjust the exponent.

Use the 8 bit excess/bias notation:


Exponent (adjusted) =


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


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


(-65 + 127)(10) =


62(10)


10. 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;
  • 62 ÷ 2 = 31 + 0;
  • 31 ÷ 2 = 15 + 1;
  • 15 ÷ 2 = 7 + 1;
  • 7 ÷ 2 = 3 + 1;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

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

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


Exponent (adjusted) =


62(10) =


0011 1110(2)


12. 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, only if necessary (not the case here).


Mantissa (normalized) =


1. 000 0000 0101 1110 0000 0010 =


000 0000 0101 1110 0000 0010


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

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


Exponent (8 bits) =
0011 1110


Mantissa (23 bits) =
000 0000 0101 1110 0000 0010


Decimal number -0.000 000 000 000 000 000 027 182 818 280 000 001 400 638 752 7 converted to 32 bit single precision IEEE 754 binary floating point representation:

1 - 0011 1110 - 000 0000 0101 1110 0000 0010

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