Base ten decimal number 1 111 010 100 001 100 011 010 111 111 010 111 110 101 converted to 64 bit double precision IEEE 754 binary floating point standard

How to convert the decimal number 1 111 010 100 001 100 011 010 111 111 010 111 110 101(10)
to
64 bit double precision IEEE 754 binary floating point
(1 bit for sign, 11 bits for exponent, 52 bits for mantissa)

1. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:

  • division = quotient + remainder;
  • 1 111 010 100 001 100 011 010 111 111 010 111 110 101 ÷ 2 = 555 505 050 000 550 005 505 055 555 505 055 555 050 + 1;
  • 555 505 050 000 550 005 505 055 555 505 055 555 050 ÷ 2 = 277 752 525 000 275 002 752 527 777 752 527 777 525 + 0;
  • 277 752 525 000 275 002 752 527 777 752 527 777 525 ÷ 2 = 138 876 262 500 137 501 376 263 888 876 263 888 762 + 1;
  • 138 876 262 500 137 501 376 263 888 876 263 888 762 ÷ 2 = 69 438 131 250 068 750 688 131 944 438 131 944 381 + 0;
  • 69 438 131 250 068 750 688 131 944 438 131 944 381 ÷ 2 = 34 719 065 625 034 375 344 065 972 219 065 972 190 + 1;
  • 34 719 065 625 034 375 344 065 972 219 065 972 190 ÷ 2 = 17 359 532 812 517 187 672 032 986 109 532 986 095 + 0;
  • 17 359 532 812 517 187 672 032 986 109 532 986 095 ÷ 2 = 8 679 766 406 258 593 836 016 493 054 766 493 047 + 1;
  • 8 679 766 406 258 593 836 016 493 054 766 493 047 ÷ 2 = 4 339 883 203 129 296 918 008 246 527 383 246 523 + 1;
  • 4 339 883 203 129 296 918 008 246 527 383 246 523 ÷ 2 = 2 169 941 601 564 648 459 004 123 263 691 623 261 + 1;
  • 2 169 941 601 564 648 459 004 123 263 691 623 261 ÷ 2 = 1 084 970 800 782 324 229 502 061 631 845 811 630 + 1;
  • 1 084 970 800 782 324 229 502 061 631 845 811 630 ÷ 2 = 542 485 400 391 162 114 751 030 815 922 905 815 + 0;
  • 542 485 400 391 162 114 751 030 815 922 905 815 ÷ 2 = 271 242 700 195 581 057 375 515 407 961 452 907 + 1;
  • 271 242 700 195 581 057 375 515 407 961 452 907 ÷ 2 = 135 621 350 097 790 528 687 757 703 980 726 453 + 1;
  • 135 621 350 097 790 528 687 757 703 980 726 453 ÷ 2 = 67 810 675 048 895 264 343 878 851 990 363 226 + 1;
  • 67 810 675 048 895 264 343 878 851 990 363 226 ÷ 2 = 33 905 337 524 447 632 171 939 425 995 181 613 + 0;
  • 33 905 337 524 447 632 171 939 425 995 181 613 ÷ 2 = 16 952 668 762 223 816 085 969 712 997 590 806 + 1;
  • 16 952 668 762 223 816 085 969 712 997 590 806 ÷ 2 = 8 476 334 381 111 908 042 984 856 498 795 403 + 0;
  • 8 476 334 381 111 908 042 984 856 498 795 403 ÷ 2 = 4 238 167 190 555 954 021 492 428 249 397 701 + 1;
  • 4 238 167 190 555 954 021 492 428 249 397 701 ÷ 2 = 2 119 083 595 277 977 010 746 214 124 698 850 + 1;
  • 2 119 083 595 277 977 010 746 214 124 698 850 ÷ 2 = 1 059 541 797 638 988 505 373 107 062 349 425 + 0;
  • 1 059 541 797 638 988 505 373 107 062 349 425 ÷ 2 = 529 770 898 819 494 252 686 553 531 174 712 + 1;
  • 529 770 898 819 494 252 686 553 531 174 712 ÷ 2 = 264 885 449 409 747 126 343 276 765 587 356 + 0;
  • 264 885 449 409 747 126 343 276 765 587 356 ÷ 2 = 132 442 724 704 873 563 171 638 382 793 678 + 0;
  • 132 442 724 704 873 563 171 638 382 793 678 ÷ 2 = 66 221 362 352 436 781 585 819 191 396 839 + 0;
  • 66 221 362 352 436 781 585 819 191 396 839 ÷ 2 = 33 110 681 176 218 390 792 909 595 698 419 + 1;
  • 33 110 681 176 218 390 792 909 595 698 419 ÷ 2 = 16 555 340 588 109 195 396 454 797 849 209 + 1;
  • 16 555 340 588 109 195 396 454 797 849 209 ÷ 2 = 8 277 670 294 054 597 698 227 398 924 604 + 1;
  • 8 277 670 294 054 597 698 227 398 924 604 ÷ 2 = 4 138 835 147 027 298 849 113 699 462 302 + 0;
  • 4 138 835 147 027 298 849 113 699 462 302 ÷ 2 = 2 069 417 573 513 649 424 556 849 731 151 + 0;
  • 2 069 417 573 513 649 424 556 849 731 151 ÷ 2 = 1 034 708 786 756 824 712 278 424 865 575 + 1;
  • 1 034 708 786 756 824 712 278 424 865 575 ÷ 2 = 517 354 393 378 412 356 139 212 432 787 + 1;
  • 517 354 393 378 412 356 139 212 432 787 ÷ 2 = 258 677 196 689 206 178 069 606 216 393 + 1;
  • 258 677 196 689 206 178 069 606 216 393 ÷ 2 = 129 338 598 344 603 089 034 803 108 196 + 1;
  • 129 338 598 344 603 089 034 803 108 196 ÷ 2 = 64 669 299 172 301 544 517 401 554 098 + 0;
  • 64 669 299 172 301 544 517 401 554 098 ÷ 2 = 32 334 649 586 150 772 258 700 777 049 + 0;
  • 32 334 649 586 150 772 258 700 777 049 ÷ 2 = 16 167 324 793 075 386 129 350 388 524 + 1;
  • 16 167 324 793 075 386 129 350 388 524 ÷ 2 = 8 083 662 396 537 693 064 675 194 262 + 0;
  • 8 083 662 396 537 693 064 675 194 262 ÷ 2 = 4 041 831 198 268 846 532 337 597 131 + 0;
  • 4 041 831 198 268 846 532 337 597 131 ÷ 2 = 2 020 915 599 134 423 266 168 798 565 + 1;
  • 2 020 915 599 134 423 266 168 798 565 ÷ 2 = 1 010 457 799 567 211 633 084 399 282 + 1;
  • 1 010 457 799 567 211 633 084 399 282 ÷ 2 = 505 228 899 783 605 816 542 199 641 + 0;
  • 505 228 899 783 605 816 542 199 641 ÷ 2 = 252 614 449 891 802 908 271 099 820 + 1;
  • 252 614 449 891 802 908 271 099 820 ÷ 2 = 126 307 224 945 901 454 135 549 910 + 0;
  • 126 307 224 945 901 454 135 549 910 ÷ 2 = 63 153 612 472 950 727 067 774 955 + 0;
  • 63 153 612 472 950 727 067 774 955 ÷ 2 = 31 576 806 236 475 363 533 887 477 + 1;
  • 31 576 806 236 475 363 533 887 477 ÷ 2 = 15 788 403 118 237 681 766 943 738 + 1;
  • 15 788 403 118 237 681 766 943 738 ÷ 2 = 7 894 201 559 118 840 883 471 869 + 0;
  • 7 894 201 559 118 840 883 471 869 ÷ 2 = 3 947 100 779 559 420 441 735 934 + 1;
  • 3 947 100 779 559 420 441 735 934 ÷ 2 = 1 973 550 389 779 710 220 867 967 + 0;
  • 1 973 550 389 779 710 220 867 967 ÷ 2 = 986 775 194 889 855 110 433 983 + 1;
  • 986 775 194 889 855 110 433 983 ÷ 2 = 493 387 597 444 927 555 216 991 + 1;
  • 493 387 597 444 927 555 216 991 ÷ 2 = 246 693 798 722 463 777 608 495 + 1;
  • 246 693 798 722 463 777 608 495 ÷ 2 = 123 346 899 361 231 888 804 247 + 1;
  • 123 346 899 361 231 888 804 247 ÷ 2 = 61 673 449 680 615 944 402 123 + 1;
  • 61 673 449 680 615 944 402 123 ÷ 2 = 30 836 724 840 307 972 201 061 + 1;
  • 30 836 724 840 307 972 201 061 ÷ 2 = 15 418 362 420 153 986 100 530 + 1;
  • 15 418 362 420 153 986 100 530 ÷ 2 = 7 709 181 210 076 993 050 265 + 0;
  • 7 709 181 210 076 993 050 265 ÷ 2 = 3 854 590 605 038 496 525 132 + 1;
  • 3 854 590 605 038 496 525 132 ÷ 2 = 1 927 295 302 519 248 262 566 + 0;
  • 1 927 295 302 519 248 262 566 ÷ 2 = 963 647 651 259 624 131 283 + 0;
  • 963 647 651 259 624 131 283 ÷ 2 = 481 823 825 629 812 065 641 + 1;
  • 481 823 825 629 812 065 641 ÷ 2 = 240 911 912 814 906 032 820 + 1;
  • 240 911 912 814 906 032 820 ÷ 2 = 120 455 956 407 453 016 410 + 0;
  • 120 455 956 407 453 016 410 ÷ 2 = 60 227 978 203 726 508 205 + 0;
  • 60 227 978 203 726 508 205 ÷ 2 = 30 113 989 101 863 254 102 + 1;
  • 30 113 989 101 863 254 102 ÷ 2 = 15 056 994 550 931 627 051 + 0;
  • 15 056 994 550 931 627 051 ÷ 2 = 7 528 497 275 465 813 525 + 1;
  • 7 528 497 275 465 813 525 ÷ 2 = 3 764 248 637 732 906 762 + 1;
  • 3 764 248 637 732 906 762 ÷ 2 = 1 882 124 318 866 453 381 + 0;
  • 1 882 124 318 866 453 381 ÷ 2 = 941 062 159 433 226 690 + 1;
  • 941 062 159 433 226 690 ÷ 2 = 470 531 079 716 613 345 + 0;
  • 470 531 079 716 613 345 ÷ 2 = 235 265 539 858 306 672 + 1;
  • 235 265 539 858 306 672 ÷ 2 = 117 632 769 929 153 336 + 0;
  • 117 632 769 929 153 336 ÷ 2 = 58 816 384 964 576 668 + 0;
  • 58 816 384 964 576 668 ÷ 2 = 29 408 192 482 288 334 + 0;
  • 29 408 192 482 288 334 ÷ 2 = 14 704 096 241 144 167 + 0;
  • 14 704 096 241 144 167 ÷ 2 = 7 352 048 120 572 083 + 1;
  • 7 352 048 120 572 083 ÷ 2 = 3 676 024 060 286 041 + 1;
  • 3 676 024 060 286 041 ÷ 2 = 1 838 012 030 143 020 + 1;
  • 1 838 012 030 143 020 ÷ 2 = 919 006 015 071 510 + 0;
  • 919 006 015 071 510 ÷ 2 = 459 503 007 535 755 + 0;
  • 459 503 007 535 755 ÷ 2 = 229 751 503 767 877 + 1;
  • 229 751 503 767 877 ÷ 2 = 114 875 751 883 938 + 1;
  • 114 875 751 883 938 ÷ 2 = 57 437 875 941 969 + 0;
  • 57 437 875 941 969 ÷ 2 = 28 718 937 970 984 + 1;
  • 28 718 937 970 984 ÷ 2 = 14 359 468 985 492 + 0;
  • 14 359 468 985 492 ÷ 2 = 7 179 734 492 746 + 0;
  • 7 179 734 492 746 ÷ 2 = 3 589 867 246 373 + 0;
  • 3 589 867 246 373 ÷ 2 = 1 794 933 623 186 + 1;
  • 1 794 933 623 186 ÷ 2 = 897 466 811 593 + 0;
  • 897 466 811 593 ÷ 2 = 448 733 405 796 + 1;
  • 448 733 405 796 ÷ 2 = 224 366 702 898 + 0;
  • 224 366 702 898 ÷ 2 = 112 183 351 449 + 0;
  • 112 183 351 449 ÷ 2 = 56 091 675 724 + 1;
  • 56 091 675 724 ÷ 2 = 28 045 837 862 + 0;
  • 28 045 837 862 ÷ 2 = 14 022 918 931 + 0;
  • 14 022 918 931 ÷ 2 = 7 011 459 465 + 1;
  • 7 011 459 465 ÷ 2 = 3 505 729 732 + 1;
  • 3 505 729 732 ÷ 2 = 1 752 864 866 + 0;
  • 1 752 864 866 ÷ 2 = 876 432 433 + 0;
  • 876 432 433 ÷ 2 = 438 216 216 + 1;
  • 438 216 216 ÷ 2 = 219 108 108 + 0;
  • 219 108 108 ÷ 2 = 109 554 054 + 0;
  • 109 554 054 ÷ 2 = 54 777 027 + 0;
  • 54 777 027 ÷ 2 = 27 388 513 + 1;
  • 27 388 513 ÷ 2 = 13 694 256 + 1;
  • 13 694 256 ÷ 2 = 6 847 128 + 0;
  • 6 847 128 ÷ 2 = 3 423 564 + 0;
  • 3 423 564 ÷ 2 = 1 711 782 + 0;
  • 1 711 782 ÷ 2 = 855 891 + 0;
  • 855 891 ÷ 2 = 427 945 + 1;
  • 427 945 ÷ 2 = 213 972 + 1;
  • 213 972 ÷ 2 = 106 986 + 0;
  • 106 986 ÷ 2 = 53 493 + 0;
  • 53 493 ÷ 2 = 26 746 + 1;
  • 26 746 ÷ 2 = 13 373 + 0;
  • 13 373 ÷ 2 = 6 686 + 1;
  • 6 686 ÷ 2 = 3 343 + 0;
  • 3 343 ÷ 2 = 1 671 + 1;
  • 1 671 ÷ 2 = 835 + 1;
  • 835 ÷ 2 = 417 + 1;
  • 417 ÷ 2 = 208 + 1;
  • 208 ÷ 2 = 104 + 0;
  • 104 ÷ 2 = 52 + 0;
  • 52 ÷ 2 = 26 + 0;
  • 26 ÷ 2 = 13 + 0;
  • 13 ÷ 2 = 6 + 1;
  • 6 ÷ 2 = 3 + 0;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

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:

1 111 010 100 001 100 011 010 111 111 010 111 110 101(10) =


11 0100 0011 1101 0100 1100 0011 0001 0011 0010 0101 0001 0110 0111 0000 1010 1101 0011 0010 1111 1110 1011 0010 1100 1001 1110 0111 0001 0110 1011 1011 1101 0101(2)

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

1 111 010 100 001 100 011 010 111 111 010 111 110 101(10) =


11 0100 0011 1101 0100 1100 0011 0001 0011 0010 0101 0001 0110 0111 0000 1010 1101 0011 0010 1111 1110 1011 0010 1100 1001 1110 0111 0001 0110 1011 1011 1101 0101(2) =


11 0100 0011 1101 0100 1100 0011 0001 0011 0010 0101 0001 0110 0111 0000 1010 1101 0011 0010 1111 1110 1011 0010 1100 1001 1110 0111 0001 0110 1011 1011 1101 0101(2) × 20 =


1.1010 0001 1110 1010 0110 0001 1000 1001 1001 0010 1000 1011 0011 1000 0101 0110 1001 1001 0111 1111 0101 1001 0110 0100 1111 0011 1000 1011 0101 1101 1110 1010 1(2) × 2129

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

Sign: 0 (a positive number)


Exponent (unadjusted): 129


Mantissa (not normalized): 1.1010 0001 1110 1010 0110 0001 1000 1001 1001 0010 1000 1011 0011 1000 0101 0110 1001 1001 0111 1111 0101 1001 0110 0100 1111 0011 1000 1011 0101 1101 1110 1010 1

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

Exponent (adjusted) =


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


129 + 2(11-1) - 1 =


(129 + 1 023)(10) =


1 152(10)


  • division = quotient + remainder;
  • 1 152 ÷ 2 = 576 + 0;
  • 576 ÷ 2 = 288 + 0;
  • 288 ÷ 2 = 144 + 0;
  • 144 ÷ 2 = 72 + 0;
  • 72 ÷ 2 = 36 + 0;
  • 36 ÷ 2 = 18 + 0;
  • 18 ÷ 2 = 9 + 0;
  • 9 ÷ 2 = 4 + 1;
  • 4 ÷ 2 = 2 + 0;
  • 2 ÷ 2 = 1 + 0;
  • 1 ÷ 2 = 0 + 1;

Exponent (adjusted) =


1152(10) =


100 1000 0000(2)

5. 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 52 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. 1010 0001 1110 1010 0110 0001 1000 1001 1001 0010 1000 1011 0011 1 0000 1010 1101 0011 0010 1111 1110 1011 0010 1100 1001 1110 0111 0001 0110 1011 1011 1101 0101 =


1010 0001 1110 1010 0110 0001 1000 1001 1001 0010 1000 1011 0011

Conclusion:

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

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


Exponent (11 bits) =
100 1000 0000


Mantissa (52 bits) =
1010 0001 1110 1010 0110 0001 1000 1001 1001 0010 1000 1011 0011

Number 1 111 010 100 001 100 011 010 111 111 010 111 110 101, a decimal, converted from decimal system (base 10)
to
64 bit double precision IEEE 754 binary floating point:


0 - 100 1000 0000 - 1010 0001 1110 1010 0110 0001 1000 1001 1001 0010 1000 1011 0011

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

    • 0

      63
  • Exponent (11 bits):

    • 1

      62
    • 0

      61
    • 0

      60
    • 1

      59
    • 0

      58
    • 0

      57
    • 0

      56
    • 0

      55
    • 0

      54
    • 0

      53
    • 0

      52
  • Mantissa (52 bits):

    • 1

      51
    • 0

      50
    • 1

      49
    • 0

      48
    • 0

      47
    • 0

      46
    • 0

      45
    • 1

      44
    • 1

      43
    • 1

      42
    • 1

      41
    • 0

      40
    • 1

      39
    • 0

      38
    • 1

      37
    • 0

      36
    • 0

      35
    • 1

      34
    • 1

      33
    • 0

      32
    • 0

      31
    • 0

      30
    • 0

      29
    • 1

      28
    • 1

      27
    • 0

      26
    • 0

      25
    • 0

      24
    • 1

      23
    • 0

      22
    • 0

      21
    • 1

      20
    • 1

      19
    • 0

      18
    • 0

      17
    • 1

      16
    • 0

      15
    • 0

      14
    • 1

      13
    • 0

      12
    • 1

      11
    • 0

      10
    • 0

      9
    • 0

      8
    • 1

      7
    • 0

      6
    • 1

      5
    • 1

      4
    • 0

      3
    • 0

      2
    • 1

      1
    • 1

      0

Convert decimal numbers from base ten to 64 bit double precision IEEE 754 binary floating point standard

A number in 64 bit double 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 (11 bits), mantissa (52 bits)

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

1 111 010 100 001 100 011 010 111 111 010 111 110 101 = 0 - 100 1000 0000 - 1010 0001 1110 1010 0110 0001 1000 1001 1001 0010 1000 1011 0011 Sep 18 07:37 UTC (GMT)
-19.25 = 1 - 100 0000 0011 - 0011 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:37 UTC (GMT)
-102.561 7 = 1 - 100 0000 0101 - 1001 1010 0011 1111 0010 1110 0100 1000 1110 1000 1010 0111 0001 Sep 18 07:35 UTC (GMT)
85.125 = 0 - 100 0000 0101 - 0101 0100 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:34 UTC (GMT)
170 207 032 = 0 - 100 0001 1010 - 0100 0100 1010 0100 1110 0111 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:34 UTC (GMT)
1 152 = 0 - 100 0000 1001 - 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:33 UTC (GMT)
432 = 0 - 100 0000 0111 - 1011 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:33 UTC (GMT)
-1 000 = 1 - 100 0000 1000 - 1111 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:32 UTC (GMT)
129.563 8 = 0 - 100 0000 0110 - 0000 0011 0010 0000 1010 1010 0110 0100 1100 0010 1111 1000 0011 Sep 18 07:31 UTC (GMT)
876 = 0 - 100 0000 1000 - 1011 0110 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:27 UTC (GMT)
8.347 = 0 - 100 0000 0010 - 0000 1011 0001 1010 1001 1111 1011 1110 0111 0110 1100 1000 1011 Sep 18 07:26 UTC (GMT)
128.125 = 0 - 100 0000 0110 - 0000 0000 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:24 UTC (GMT)
103 = 0 - 100 0000 0101 - 1001 1100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 Sep 18 07:23 UTC (GMT)
All base ten decimal numbers converted to 64 bit double precision IEEE 754 binary floating point

How to convert numbers from the decimal system (base ten) to 64 bit double precision IEEE 754 binary floating point standard

Follow the steps below to convert a base 10 decimal number to 64 bit double 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 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 from the previous 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 multiplying operations, starting from the top of the list constructed 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, shifting the decimal mark (the decimal point) "n" positions either to the left, or to the right, so that only one non zero digit remains to the left of the decimal mark.
  • 7. Adjust the exponent in 11 bit excess/bias notation and then convert it from decimal (base 10) to 11 bit binary, by using the same technique of repeatedly dividing by 2, as shown above:
    Exponent (adjusted) = Exponent (unadjusted) + 2(11-1) - 1
  • 8. Normalize mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal mark, if the case) and adjust its length to 52 bits, either by removing the excess bits from the right (losing precision...) or by adding extra bits set on '0' 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 -31.640 215 from the decimal system (base ten) to 64 bit double precision IEEE 754 binary floating point:

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

    |-31.640 215| = 31.640 215

  • 2. First convert the integer part, 31. Divide it repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:
    • division = quotient + remainder;
    • 31 ÷ 2 = 15 + 1;
    • 15 ÷ 2 = 7 + 1;
    • 7 ÷ 2 = 3 + 1;
    • 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:

    31(10) = 1 1111(2)

  • 4. Then, convert the fractional part, 0.640 215. 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.640 215 × 2 = 1 + 0.280 43;
    • 2) 0.280 43 × 2 = 0 + 0.560 86;
    • 3) 0.560 86 × 2 = 1 + 0.121 72;
    • 4) 0.121 72 × 2 = 0 + 0.243 44;
    • 5) 0.243 44 × 2 = 0 + 0.486 88;
    • 6) 0.486 88 × 2 = 0 + 0.973 76;
    • 7) 0.973 76 × 2 = 1 + 0.947 52;
    • 8) 0.947 52 × 2 = 1 + 0.895 04;
    • 9) 0.895 04 × 2 = 1 + 0.790 08;
    • 10) 0.790 08 × 2 = 1 + 0.580 16;
    • 11) 0.580 16 × 2 = 1 + 0.160 32;
    • 12) 0.160 32 × 2 = 0 + 0.320 64;
    • 13) 0.320 64 × 2 = 0 + 0.641 28;
    • 14) 0.641 28 × 2 = 1 + 0.282 56;
    • 15) 0.282 56 × 2 = 0 + 0.565 12;
    • 16) 0.565 12 × 2 = 1 + 0.130 24;
    • 17) 0.130 24 × 2 = 0 + 0.260 48;
    • 18) 0.260 48 × 2 = 0 + 0.520 96;
    • 19) 0.520 96 × 2 = 1 + 0.041 92;
    • 20) 0.041 92 × 2 = 0 + 0.083 84;
    • 21) 0.083 84 × 2 = 0 + 0.167 68;
    • 22) 0.167 68 × 2 = 0 + 0.335 36;
    • 23) 0.335 36 × 2 = 0 + 0.670 72;
    • 24) 0.670 72 × 2 = 1 + 0.341 44;
    • 25) 0.341 44 × 2 = 0 + 0.682 88;
    • 26) 0.682 88 × 2 = 1 + 0.365 76;
    • 27) 0.365 76 × 2 = 0 + 0.731 52;
    • 28) 0.731 52 × 2 = 1 + 0.463 04;
    • 29) 0.463 04 × 2 = 0 + 0.926 08;
    • 30) 0.926 08 × 2 = 1 + 0.852 16;
    • 31) 0.852 16 × 2 = 1 + 0.704 32;
    • 32) 0.704 32 × 2 = 1 + 0.408 64;
    • 33) 0.408 64 × 2 = 0 + 0.817 28;
    • 34) 0.817 28 × 2 = 1 + 0.634 56;
    • 35) 0.634 56 × 2 = 1 + 0.269 12;
    • 36) 0.269 12 × 2 = 0 + 0.538 24;
    • 37) 0.538 24 × 2 = 1 + 0.076 48;
    • 38) 0.076 48 × 2 = 0 + 0.152 96;
    • 39) 0.152 96 × 2 = 0 + 0.305 92;
    • 40) 0.305 92 × 2 = 0 + 0.611 84;
    • 41) 0.611 84 × 2 = 1 + 0.223 68;
    • 42) 0.223 68 × 2 = 0 + 0.447 36;
    • 43) 0.447 36 × 2 = 0 + 0.894 72;
    • 44) 0.894 72 × 2 = 1 + 0.789 44;
    • 45) 0.789 44 × 2 = 1 + 0.578 88;
    • 46) 0.578 88 × 2 = 1 + 0.157 76;
    • 47) 0.157 76 × 2 = 0 + 0.315 52;
    • 48) 0.315 52 × 2 = 0 + 0.631 04;
    • 49) 0.631 04 × 2 = 1 + 0.262 08;
    • 50) 0.262 08 × 2 = 0 + 0.524 16;
    • 51) 0.524 16 × 2 = 1 + 0.048 32;
    • 52) 0.048 32 × 2 = 0 + 0.096 64;
    • 53) 0.096 64 × 2 = 0 + 0.193 28;
    • We didn't get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit = 52) 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.640 215(10) = 0.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2)

  • 6. Summarizing - the positive number before normalization:

    31.640 215(10) = 1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2)

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

    31.640 215(10) =
    1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) =
    1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) × 20 =
    1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) × 24

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

    Sign: 1 (a negative number)

    Exponent (unadjusted): 4

    Mantissa (not-normalized): 1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0

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

    Exponent (adjusted) = Exponent (unadjusted) + 2(11-1) - 1 = (4 + 1023)(10) = 1027(10) =
    100 0000 0011(2)

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

    Mantissa (not-normalized): 1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0

    Mantissa (normalized): 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100

  • Conclusion:

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

    Exponent (8 bits) = 100 0000 0011

    Mantissa (52 bits) = 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100

  • Number -31.640 215, converted from decimal system (base 10) to 64 bit double precision IEEE 754 binary floating point =


    1 - 100 0000 0011 - 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100