-284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154 Converted to 64 Bit Double Precision IEEE 754 Binary Floating Point Representation Standard
Convert decimal -284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154(10) to 64 bit double precision IEEE 754 binary floating point representation standard (1 bit for sign, 11 bits for exponent, 52 bits for mantissa)
What are the steps to convert decimal number
-284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154(10) to 64 bit double precision IEEE 754 binary floating point representation (1 bit for sign, 11 bits for exponent, 52 bits for mantissa)
1. Start with the positive version of the number:
|-284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154| = 284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154
2. First, convert to binary (in base 2) the integer part: 284.
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;
- 284 ÷ 2 = 142 + 0;
- 142 ÷ 2 = 71 + 0;
- 71 ÷ 2 = 35 + 1;
- 35 ÷ 2 = 17 + 1;
- 17 ÷ 2 = 8 + 1;
- 8 ÷ 2 = 4 + 0;
- 4 ÷ 2 = 2 + 0;
- 2 ÷ 2 = 1 + 0;
- 1 ÷ 2 = 0 + 1;
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.
284(10) =
1 0001 1100(2)
4. Convert to binary (base 2) the fractional part: 0.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154.
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.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154 × 2 = 0 + 0.022 200 000 002 220 002 220 000 000 020 200 022 220 202 220 000 202 000 222 202 308;
- 2) 0.022 200 000 002 220 002 220 000 000 020 200 022 220 202 220 000 202 000 222 202 308 × 2 = 0 + 0.044 400 000 004 440 004 440 000 000 040 400 044 440 404 440 000 404 000 444 404 616;
- 3) 0.044 400 000 004 440 004 440 000 000 040 400 044 440 404 440 000 404 000 444 404 616 × 2 = 0 + 0.088 800 000 008 880 008 880 000 000 080 800 088 880 808 880 000 808 000 888 809 232;
- 4) 0.088 800 000 008 880 008 880 000 000 080 800 088 880 808 880 000 808 000 888 809 232 × 2 = 0 + 0.177 600 000 017 760 017 760 000 000 161 600 177 761 617 760 001 616 001 777 618 464;
- 5) 0.177 600 000 017 760 017 760 000 000 161 600 177 761 617 760 001 616 001 777 618 464 × 2 = 0 + 0.355 200 000 035 520 035 520 000 000 323 200 355 523 235 520 003 232 003 555 236 928;
- 6) 0.355 200 000 035 520 035 520 000 000 323 200 355 523 235 520 003 232 003 555 236 928 × 2 = 0 + 0.710 400 000 071 040 071 040 000 000 646 400 711 046 471 040 006 464 007 110 473 856;
- 7) 0.710 400 000 071 040 071 040 000 000 646 400 711 046 471 040 006 464 007 110 473 856 × 2 = 1 + 0.420 800 000 142 080 142 080 000 001 292 801 422 092 942 080 012 928 014 220 947 712;
- 8) 0.420 800 000 142 080 142 080 000 001 292 801 422 092 942 080 012 928 014 220 947 712 × 2 = 0 + 0.841 600 000 284 160 284 160 000 002 585 602 844 185 884 160 025 856 028 441 895 424;
- 9) 0.841 600 000 284 160 284 160 000 002 585 602 844 185 884 160 025 856 028 441 895 424 × 2 = 1 + 0.683 200 000 568 320 568 320 000 005 171 205 688 371 768 320 051 712 056 883 790 848;
- 10) 0.683 200 000 568 320 568 320 000 005 171 205 688 371 768 320 051 712 056 883 790 848 × 2 = 1 + 0.366 400 001 136 641 136 640 000 010 342 411 376 743 536 640 103 424 113 767 581 696;
- 11) 0.366 400 001 136 641 136 640 000 010 342 411 376 743 536 640 103 424 113 767 581 696 × 2 = 0 + 0.732 800 002 273 282 273 280 000 020 684 822 753 487 073 280 206 848 227 535 163 392;
- 12) 0.732 800 002 273 282 273 280 000 020 684 822 753 487 073 280 206 848 227 535 163 392 × 2 = 1 + 0.465 600 004 546 564 546 560 000 041 369 645 506 974 146 560 413 696 455 070 326 784;
- 13) 0.465 600 004 546 564 546 560 000 041 369 645 506 974 146 560 413 696 455 070 326 784 × 2 = 0 + 0.931 200 009 093 129 093 120 000 082 739 291 013 948 293 120 827 392 910 140 653 568;
- 14) 0.931 200 009 093 129 093 120 000 082 739 291 013 948 293 120 827 392 910 140 653 568 × 2 = 1 + 0.862 400 018 186 258 186 240 000 165 478 582 027 896 586 241 654 785 820 281 307 136;
- 15) 0.862 400 018 186 258 186 240 000 165 478 582 027 896 586 241 654 785 820 281 307 136 × 2 = 1 + 0.724 800 036 372 516 372 480 000 330 957 164 055 793 172 483 309 571 640 562 614 272;
- 16) 0.724 800 036 372 516 372 480 000 330 957 164 055 793 172 483 309 571 640 562 614 272 × 2 = 1 + 0.449 600 072 745 032 744 960 000 661 914 328 111 586 344 966 619 143 281 125 228 544;
- 17) 0.449 600 072 745 032 744 960 000 661 914 328 111 586 344 966 619 143 281 125 228 544 × 2 = 0 + 0.899 200 145 490 065 489 920 001 323 828 656 223 172 689 933 238 286 562 250 457 088;
- 18) 0.899 200 145 490 065 489 920 001 323 828 656 223 172 689 933 238 286 562 250 457 088 × 2 = 1 + 0.798 400 290 980 130 979 840 002 647 657 312 446 345 379 866 476 573 124 500 914 176;
- 19) 0.798 400 290 980 130 979 840 002 647 657 312 446 345 379 866 476 573 124 500 914 176 × 2 = 1 + 0.596 800 581 960 261 959 680 005 295 314 624 892 690 759 732 953 146 249 001 828 352;
- 20) 0.596 800 581 960 261 959 680 005 295 314 624 892 690 759 732 953 146 249 001 828 352 × 2 = 1 + 0.193 601 163 920 523 919 360 010 590 629 249 785 381 519 465 906 292 498 003 656 704;
- 21) 0.193 601 163 920 523 919 360 010 590 629 249 785 381 519 465 906 292 498 003 656 704 × 2 = 0 + 0.387 202 327 841 047 838 720 021 181 258 499 570 763 038 931 812 584 996 007 313 408;
- 22) 0.387 202 327 841 047 838 720 021 181 258 499 570 763 038 931 812 584 996 007 313 408 × 2 = 0 + 0.774 404 655 682 095 677 440 042 362 516 999 141 526 077 863 625 169 992 014 626 816;
- 23) 0.774 404 655 682 095 677 440 042 362 516 999 141 526 077 863 625 169 992 014 626 816 × 2 = 1 + 0.548 809 311 364 191 354 880 084 725 033 998 283 052 155 727 250 339 984 029 253 632;
- 24) 0.548 809 311 364 191 354 880 084 725 033 998 283 052 155 727 250 339 984 029 253 632 × 2 = 1 + 0.097 618 622 728 382 709 760 169 450 067 996 566 104 311 454 500 679 968 058 507 264;
- 25) 0.097 618 622 728 382 709 760 169 450 067 996 566 104 311 454 500 679 968 058 507 264 × 2 = 0 + 0.195 237 245 456 765 419 520 338 900 135 993 132 208 622 909 001 359 936 117 014 528;
- 26) 0.195 237 245 456 765 419 520 338 900 135 993 132 208 622 909 001 359 936 117 014 528 × 2 = 0 + 0.390 474 490 913 530 839 040 677 800 271 986 264 417 245 818 002 719 872 234 029 056;
- 27) 0.390 474 490 913 530 839 040 677 800 271 986 264 417 245 818 002 719 872 234 029 056 × 2 = 0 + 0.780 948 981 827 061 678 081 355 600 543 972 528 834 491 636 005 439 744 468 058 112;
- 28) 0.780 948 981 827 061 678 081 355 600 543 972 528 834 491 636 005 439 744 468 058 112 × 2 = 1 + 0.561 897 963 654 123 356 162 711 201 087 945 057 668 983 272 010 879 488 936 116 224;
- 29) 0.561 897 963 654 123 356 162 711 201 087 945 057 668 983 272 010 879 488 936 116 224 × 2 = 1 + 0.123 795 927 308 246 712 325 422 402 175 890 115 337 966 544 021 758 977 872 232 448;
- 30) 0.123 795 927 308 246 712 325 422 402 175 890 115 337 966 544 021 758 977 872 232 448 × 2 = 0 + 0.247 591 854 616 493 424 650 844 804 351 780 230 675 933 088 043 517 955 744 464 896;
- 31) 0.247 591 854 616 493 424 650 844 804 351 780 230 675 933 088 043 517 955 744 464 896 × 2 = 0 + 0.495 183 709 232 986 849 301 689 608 703 560 461 351 866 176 087 035 911 488 929 792;
- 32) 0.495 183 709 232 986 849 301 689 608 703 560 461 351 866 176 087 035 911 488 929 792 × 2 = 0 + 0.990 367 418 465 973 698 603 379 217 407 120 922 703 732 352 174 071 822 977 859 584;
- 33) 0.990 367 418 465 973 698 603 379 217 407 120 922 703 732 352 174 071 822 977 859 584 × 2 = 1 + 0.980 734 836 931 947 397 206 758 434 814 241 845 407 464 704 348 143 645 955 719 168;
- 34) 0.980 734 836 931 947 397 206 758 434 814 241 845 407 464 704 348 143 645 955 719 168 × 2 = 1 + 0.961 469 673 863 894 794 413 516 869 628 483 690 814 929 408 696 287 291 911 438 336;
- 35) 0.961 469 673 863 894 794 413 516 869 628 483 690 814 929 408 696 287 291 911 438 336 × 2 = 1 + 0.922 939 347 727 789 588 827 033 739 256 967 381 629 858 817 392 574 583 822 876 672;
- 36) 0.922 939 347 727 789 588 827 033 739 256 967 381 629 858 817 392 574 583 822 876 672 × 2 = 1 + 0.845 878 695 455 579 177 654 067 478 513 934 763 259 717 634 785 149 167 645 753 344;
- 37) 0.845 878 695 455 579 177 654 067 478 513 934 763 259 717 634 785 149 167 645 753 344 × 2 = 1 + 0.691 757 390 911 158 355 308 134 957 027 869 526 519 435 269 570 298 335 291 506 688;
- 38) 0.691 757 390 911 158 355 308 134 957 027 869 526 519 435 269 570 298 335 291 506 688 × 2 = 1 + 0.383 514 781 822 316 710 616 269 914 055 739 053 038 870 539 140 596 670 583 013 376;
- 39) 0.383 514 781 822 316 710 616 269 914 055 739 053 038 870 539 140 596 670 583 013 376 × 2 = 0 + 0.767 029 563 644 633 421 232 539 828 111 478 106 077 741 078 281 193 341 166 026 752;
- 40) 0.767 029 563 644 633 421 232 539 828 111 478 106 077 741 078 281 193 341 166 026 752 × 2 = 1 + 0.534 059 127 289 266 842 465 079 656 222 956 212 155 482 156 562 386 682 332 053 504;
- 41) 0.534 059 127 289 266 842 465 079 656 222 956 212 155 482 156 562 386 682 332 053 504 × 2 = 1 + 0.068 118 254 578 533 684 930 159 312 445 912 424 310 964 313 124 773 364 664 107 008;
- 42) 0.068 118 254 578 533 684 930 159 312 445 912 424 310 964 313 124 773 364 664 107 008 × 2 = 0 + 0.136 236 509 157 067 369 860 318 624 891 824 848 621 928 626 249 546 729 328 214 016;
- 43) 0.136 236 509 157 067 369 860 318 624 891 824 848 621 928 626 249 546 729 328 214 016 × 2 = 0 + 0.272 473 018 314 134 739 720 637 249 783 649 697 243 857 252 499 093 458 656 428 032;
- 44) 0.272 473 018 314 134 739 720 637 249 783 649 697 243 857 252 499 093 458 656 428 032 × 2 = 0 + 0.544 946 036 628 269 479 441 274 499 567 299 394 487 714 504 998 186 917 312 856 064;
- 45) 0.544 946 036 628 269 479 441 274 499 567 299 394 487 714 504 998 186 917 312 856 064 × 2 = 1 + 0.089 892 073 256 538 958 882 548 999 134 598 788 975 429 009 996 373 834 625 712 128;
- 46) 0.089 892 073 256 538 958 882 548 999 134 598 788 975 429 009 996 373 834 625 712 128 × 2 = 0 + 0.179 784 146 513 077 917 765 097 998 269 197 577 950 858 019 992 747 669 251 424 256;
- 47) 0.179 784 146 513 077 917 765 097 998 269 197 577 950 858 019 992 747 669 251 424 256 × 2 = 0 + 0.359 568 293 026 155 835 530 195 996 538 395 155 901 716 039 985 495 338 502 848 512;
- 48) 0.359 568 293 026 155 835 530 195 996 538 395 155 901 716 039 985 495 338 502 848 512 × 2 = 0 + 0.719 136 586 052 311 671 060 391 993 076 790 311 803 432 079 970 990 677 005 697 024;
- 49) 0.719 136 586 052 311 671 060 391 993 076 790 311 803 432 079 970 990 677 005 697 024 × 2 = 1 + 0.438 273 172 104 623 342 120 783 986 153 580 623 606 864 159 941 981 354 011 394 048;
- 50) 0.438 273 172 104 623 342 120 783 986 153 580 623 606 864 159 941 981 354 011 394 048 × 2 = 0 + 0.876 546 344 209 246 684 241 567 972 307 161 247 213 728 319 883 962 708 022 788 096;
- 51) 0.876 546 344 209 246 684 241 567 972 307 161 247 213 728 319 883 962 708 022 788 096 × 2 = 1 + 0.753 092 688 418 493 368 483 135 944 614 322 494 427 456 639 767 925 416 045 576 192;
- 52) 0.753 092 688 418 493 368 483 135 944 614 322 494 427 456 639 767 925 416 045 576 192 × 2 = 1 + 0.506 185 376 836 986 736 966 271 889 228 644 988 854 913 279 535 850 832 091 152 384;
- 53) 0.506 185 376 836 986 736 966 271 889 228 644 988 854 913 279 535 850 832 091 152 384 × 2 = 1 + 0.012 370 753 673 973 473 932 543 778 457 289 977 709 826 559 071 701 664 182 304 768;
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.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154(10) =
0.0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000 1000 1011 1(2)
6. Positive number before normalization:
284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154(10) =
1 0001 1100.0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000 1000 1011 1(2)
7. Normalize the binary representation of the number.
Shift the decimal mark 8 positions to the left, so that only one non zero digit remains to the left of it:
284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154(10) =
1 0001 1100.0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000 1000 1011 1(2) =
1 0001 1100.0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000 1000 1011 1(2) × 20 =
1.0001 1100 0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000 1000 1011 1(2) × 28
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): 8
Mantissa (not normalized):
1.0001 1100 0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000 1000 1011 1
9. Adjust the exponent.
Use the 11 bit excess/bias notation:
Exponent (adjusted) =
Exponent (unadjusted) + 2(11-1) - 1 =
8 + 2(11-1) - 1 =
(8 + 1 023)(10) =
1 031(10)
10. Convert the adjusted exponent from the decimal (base 10) to 11 bit binary.
Use the same technique of repeatedly dividing by 2:
- division = quotient + remainder;
- 1 031 ÷ 2 = 515 + 1;
- 515 ÷ 2 = 257 + 1;
- 257 ÷ 2 = 128 + 1;
- 128 ÷ 2 = 64 + 0;
- 64 ÷ 2 = 32 + 0;
- 32 ÷ 2 = 16 + 0;
- 16 ÷ 2 = 8 + 0;
- 8 ÷ 2 = 4 + 0;
- 4 ÷ 2 = 2 + 0;
- 2 ÷ 2 = 1 + 0;
- 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) =
1031(10) =
100 0000 0111(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 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. 0001 1100 0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000 1 0001 0111 =
0001 1100 0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000
13. The three elements that make up the number's 64 bit double precision IEEE 754 binary floating point representation:
Sign (1 bit) =
1 (a negative number)
Exponent (11 bits) =
100 0000 0111
Mantissa (52 bits) =
0001 1100 0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000
Decimal number -284.011 100 000 001 110 001 110 000 000 010 100 011 110 101 110 000 101 000 111 101 154 converted to 64 bit double precision IEEE 754 binary floating point representation:
1 - 100 0000 0111 - 0001 1100 0000 0010 1101 0111 0111 0011 0001 1000 1111 1101 1000