-0.000 000 000 000 000 000 000 065 4 Converted to 32 Bit Single Precision IEEE 754 Binary Floating Point Representation Standard
Convert decimal -0.000 000 000 000 000 000 000 065 4(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 000 065 4(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 000 065 4| = 0.000 000 000 000 000 000 000 065 4
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 000 065 4.
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 000 065 4 × 2 = 0 + 0.000 000 000 000 000 000 000 130 8;
- 2) 0.000 000 000 000 000 000 000 130 8 × 2 = 0 + 0.000 000 000 000 000 000 000 261 6;
- 3) 0.000 000 000 000 000 000 000 261 6 × 2 = 0 + 0.000 000 000 000 000 000 000 523 2;
- 4) 0.000 000 000 000 000 000 000 523 2 × 2 = 0 + 0.000 000 000 000 000 000 001 046 4;
- 5) 0.000 000 000 000 000 000 001 046 4 × 2 = 0 + 0.000 000 000 000 000 000 002 092 8;
- 6) 0.000 000 000 000 000 000 002 092 8 × 2 = 0 + 0.000 000 000 000 000 000 004 185 6;
- 7) 0.000 000 000 000 000 000 004 185 6 × 2 = 0 + 0.000 000 000 000 000 000 008 371 2;
- 8) 0.000 000 000 000 000 000 008 371 2 × 2 = 0 + 0.000 000 000 000 000 000 016 742 4;
- 9) 0.000 000 000 000 000 000 016 742 4 × 2 = 0 + 0.000 000 000 000 000 000 033 484 8;
- 10) 0.000 000 000 000 000 000 033 484 8 × 2 = 0 + 0.000 000 000 000 000 000 066 969 6;
- 11) 0.000 000 000 000 000 000 066 969 6 × 2 = 0 + 0.000 000 000 000 000 000 133 939 2;
- 12) 0.000 000 000 000 000 000 133 939 2 × 2 = 0 + 0.000 000 000 000 000 000 267 878 4;
- 13) 0.000 000 000 000 000 000 267 878 4 × 2 = 0 + 0.000 000 000 000 000 000 535 756 8;
- 14) 0.000 000 000 000 000 000 535 756 8 × 2 = 0 + 0.000 000 000 000 000 001 071 513 6;
- 15) 0.000 000 000 000 000 001 071 513 6 × 2 = 0 + 0.000 000 000 000 000 002 143 027 2;
- 16) 0.000 000 000 000 000 002 143 027 2 × 2 = 0 + 0.000 000 000 000 000 004 286 054 4;
- 17) 0.000 000 000 000 000 004 286 054 4 × 2 = 0 + 0.000 000 000 000 000 008 572 108 8;
- 18) 0.000 000 000 000 000 008 572 108 8 × 2 = 0 + 0.000 000 000 000 000 017 144 217 6;
- 19) 0.000 000 000 000 000 017 144 217 6 × 2 = 0 + 0.000 000 000 000 000 034 288 435 2;
- 20) 0.000 000 000 000 000 034 288 435 2 × 2 = 0 + 0.000 000 000 000 000 068 576 870 4;
- 21) 0.000 000 000 000 000 068 576 870 4 × 2 = 0 + 0.000 000 000 000 000 137 153 740 8;
- 22) 0.000 000 000 000 000 137 153 740 8 × 2 = 0 + 0.000 000 000 000 000 274 307 481 6;
- 23) 0.000 000 000 000 000 274 307 481 6 × 2 = 0 + 0.000 000 000 000 000 548 614 963 2;
- 24) 0.000 000 000 000 000 548 614 963 2 × 2 = 0 + 0.000 000 000 000 001 097 229 926 4;
- 25) 0.000 000 000 000 001 097 229 926 4 × 2 = 0 + 0.000 000 000 000 002 194 459 852 8;
- 26) 0.000 000 000 000 002 194 459 852 8 × 2 = 0 + 0.000 000 000 000 004 388 919 705 6;
- 27) 0.000 000 000 000 004 388 919 705 6 × 2 = 0 + 0.000 000 000 000 008 777 839 411 2;
- 28) 0.000 000 000 000 008 777 839 411 2 × 2 = 0 + 0.000 000 000 000 017 555 678 822 4;
- 29) 0.000 000 000 000 017 555 678 822 4 × 2 = 0 + 0.000 000 000 000 035 111 357 644 8;
- 30) 0.000 000 000 000 035 111 357 644 8 × 2 = 0 + 0.000 000 000 000 070 222 715 289 6;
- 31) 0.000 000 000 000 070 222 715 289 6 × 2 = 0 + 0.000 000 000 000 140 445 430 579 2;
- 32) 0.000 000 000 000 140 445 430 579 2 × 2 = 0 + 0.000 000 000 000 280 890 861 158 4;
- 33) 0.000 000 000 000 280 890 861 158 4 × 2 = 0 + 0.000 000 000 000 561 781 722 316 8;
- 34) 0.000 000 000 000 561 781 722 316 8 × 2 = 0 + 0.000 000 000 001 123 563 444 633 6;
- 35) 0.000 000 000 001 123 563 444 633 6 × 2 = 0 + 0.000 000 000 002 247 126 889 267 2;
- 36) 0.000 000 000 002 247 126 889 267 2 × 2 = 0 + 0.000 000 000 004 494 253 778 534 4;
- 37) 0.000 000 000 004 494 253 778 534 4 × 2 = 0 + 0.000 000 000 008 988 507 557 068 8;
- 38) 0.000 000 000 008 988 507 557 068 8 × 2 = 0 + 0.000 000 000 017 977 015 114 137 6;
- 39) 0.000 000 000 017 977 015 114 137 6 × 2 = 0 + 0.000 000 000 035 954 030 228 275 2;
- 40) 0.000 000 000 035 954 030 228 275 2 × 2 = 0 + 0.000 000 000 071 908 060 456 550 4;
- 41) 0.000 000 000 071 908 060 456 550 4 × 2 = 0 + 0.000 000 000 143 816 120 913 100 8;
- 42) 0.000 000 000 143 816 120 913 100 8 × 2 = 0 + 0.000 000 000 287 632 241 826 201 6;
- 43) 0.000 000 000 287 632 241 826 201 6 × 2 = 0 + 0.000 000 000 575 264 483 652 403 2;
- 44) 0.000 000 000 575 264 483 652 403 2 × 2 = 0 + 0.000 000 001 150 528 967 304 806 4;
- 45) 0.000 000 001 150 528 967 304 806 4 × 2 = 0 + 0.000 000 002 301 057 934 609 612 8;
- 46) 0.000 000 002 301 057 934 609 612 8 × 2 = 0 + 0.000 000 004 602 115 869 219 225 6;
- 47) 0.000 000 004 602 115 869 219 225 6 × 2 = 0 + 0.000 000 009 204 231 738 438 451 2;
- 48) 0.000 000 009 204 231 738 438 451 2 × 2 = 0 + 0.000 000 018 408 463 476 876 902 4;
- 49) 0.000 000 018 408 463 476 876 902 4 × 2 = 0 + 0.000 000 036 816 926 953 753 804 8;
- 50) 0.000 000 036 816 926 953 753 804 8 × 2 = 0 + 0.000 000 073 633 853 907 507 609 6;
- 51) 0.000 000 073 633 853 907 507 609 6 × 2 = 0 + 0.000 000 147 267 707 815 015 219 2;
- 52) 0.000 000 147 267 707 815 015 219 2 × 2 = 0 + 0.000 000 294 535 415 630 030 438 4;
- 53) 0.000 000 294 535 415 630 030 438 4 × 2 = 0 + 0.000 000 589 070 831 260 060 876 8;
- 54) 0.000 000 589 070 831 260 060 876 8 × 2 = 0 + 0.000 001 178 141 662 520 121 753 6;
- 55) 0.000 001 178 141 662 520 121 753 6 × 2 = 0 + 0.000 002 356 283 325 040 243 507 2;
- 56) 0.000 002 356 283 325 040 243 507 2 × 2 = 0 + 0.000 004 712 566 650 080 487 014 4;
- 57) 0.000 004 712 566 650 080 487 014 4 × 2 = 0 + 0.000 009 425 133 300 160 974 028 8;
- 58) 0.000 009 425 133 300 160 974 028 8 × 2 = 0 + 0.000 018 850 266 600 321 948 057 6;
- 59) 0.000 018 850 266 600 321 948 057 6 × 2 = 0 + 0.000 037 700 533 200 643 896 115 2;
- 60) 0.000 037 700 533 200 643 896 115 2 × 2 = 0 + 0.000 075 401 066 401 287 792 230 4;
- 61) 0.000 075 401 066 401 287 792 230 4 × 2 = 0 + 0.000 150 802 132 802 575 584 460 8;
- 62) 0.000 150 802 132 802 575 584 460 8 × 2 = 0 + 0.000 301 604 265 605 151 168 921 6;
- 63) 0.000 301 604 265 605 151 168 921 6 × 2 = 0 + 0.000 603 208 531 210 302 337 843 2;
- 64) 0.000 603 208 531 210 302 337 843 2 × 2 = 0 + 0.001 206 417 062 420 604 675 686 4;
- 65) 0.001 206 417 062 420 604 675 686 4 × 2 = 0 + 0.002 412 834 124 841 209 351 372 8;
- 66) 0.002 412 834 124 841 209 351 372 8 × 2 = 0 + 0.004 825 668 249 682 418 702 745 6;
- 67) 0.004 825 668 249 682 418 702 745 6 × 2 = 0 + 0.009 651 336 499 364 837 405 491 2;
- 68) 0.009 651 336 499 364 837 405 491 2 × 2 = 0 + 0.019 302 672 998 729 674 810 982 4;
- 69) 0.019 302 672 998 729 674 810 982 4 × 2 = 0 + 0.038 605 345 997 459 349 621 964 8;
- 70) 0.038 605 345 997 459 349 621 964 8 × 2 = 0 + 0.077 210 691 994 918 699 243 929 6;
- 71) 0.077 210 691 994 918 699 243 929 6 × 2 = 0 + 0.154 421 383 989 837 398 487 859 2;
- 72) 0.154 421 383 989 837 398 487 859 2 × 2 = 0 + 0.308 842 767 979 674 796 975 718 4;
- 73) 0.308 842 767 979 674 796 975 718 4 × 2 = 0 + 0.617 685 535 959 349 593 951 436 8;
- 74) 0.617 685 535 959 349 593 951 436 8 × 2 = 1 + 0.235 371 071 918 699 187 902 873 6;
- 75) 0.235 371 071 918 699 187 902 873 6 × 2 = 0 + 0.470 742 143 837 398 375 805 747 2;
- 76) 0.470 742 143 837 398 375 805 747 2 × 2 = 0 + 0.941 484 287 674 796 751 611 494 4;
- 77) 0.941 484 287 674 796 751 611 494 4 × 2 = 1 + 0.882 968 575 349 593 503 222 988 8;
- 78) 0.882 968 575 349 593 503 222 988 8 × 2 = 1 + 0.765 937 150 699 187 006 445 977 6;
- 79) 0.765 937 150 699 187 006 445 977 6 × 2 = 1 + 0.531 874 301 398 374 012 891 955 2;
- 80) 0.531 874 301 398 374 012 891 955 2 × 2 = 1 + 0.063 748 602 796 748 025 783 910 4;
- 81) 0.063 748 602 796 748 025 783 910 4 × 2 = 0 + 0.127 497 205 593 496 051 567 820 8;
- 82) 0.127 497 205 593 496 051 567 820 8 × 2 = 0 + 0.254 994 411 186 992 103 135 641 6;
- 83) 0.254 994 411 186 992 103 135 641 6 × 2 = 0 + 0.509 988 822 373 984 206 271 283 2;
- 84) 0.509 988 822 373 984 206 271 283 2 × 2 = 1 + 0.019 977 644 747 968 412 542 566 4;
- 85) 0.019 977 644 747 968 412 542 566 4 × 2 = 0 + 0.039 955 289 495 936 825 085 132 8;
- 86) 0.039 955 289 495 936 825 085 132 8 × 2 = 0 + 0.079 910 578 991 873 650 170 265 6;
- 87) 0.079 910 578 991 873 650 170 265 6 × 2 = 0 + 0.159 821 157 983 747 300 340 531 2;
- 88) 0.159 821 157 983 747 300 340 531 2 × 2 = 0 + 0.319 642 315 967 494 600 681 062 4;
- 89) 0.319 642 315 967 494 600 681 062 4 × 2 = 0 + 0.639 284 631 934 989 201 362 124 8;
- 90) 0.639 284 631 934 989 201 362 124 8 × 2 = 1 + 0.278 569 263 869 978 402 724 249 6;
- 91) 0.278 569 263 869 978 402 724 249 6 × 2 = 0 + 0.557 138 527 739 956 805 448 499 2;
- 92) 0.557 138 527 739 956 805 448 499 2 × 2 = 1 + 0.114 277 055 479 913 610 896 998 4;
- 93) 0.114 277 055 479 913 610 896 998 4 × 2 = 0 + 0.228 554 110 959 827 221 793 996 8;
- 94) 0.228 554 110 959 827 221 793 996 8 × 2 = 0 + 0.457 108 221 919 654 443 587 993 6;
- 95) 0.457 108 221 919 654 443 587 993 6 × 2 = 0 + 0.914 216 443 839 308 887 175 987 2;
- 96) 0.914 216 443 839 308 887 175 987 2 × 2 = 1 + 0.828 432 887 678 617 774 351 974 4;
- 97) 0.828 432 887 678 617 774 351 974 4 × 2 = 1 + 0.656 865 775 357 235 548 703 948 8;
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 000 065 4(10) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 1111 0001 0000 0101 0001 1(2)
6. Positive number before normalization:
0.000 000 000 000 000 000 000 065 4(10) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 1111 0001 0000 0101 0001 1(2)
7. Normalize the binary representation of the number.
Shift the decimal mark 74 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 065 4(10) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 1111 0001 0000 0101 0001 1(2) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 1111 0001 0000 0101 0001 1(2) × 20 =
1.0011 1100 0100 0001 0100 011(2) × 2-74
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): -74
Mantissa (not normalized):
1.0011 1100 0100 0001 0100 011
9. Adjust the exponent.
Use the 8 bit excess/bias notation:
Exponent (adjusted) =
Exponent (unadjusted) + 2(8-1) - 1 =
-74 + 2(8-1) - 1 =
(-74 + 127)(10) =
53(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;
- 53 ÷ 2 = 26 + 1;
- 26 ÷ 2 = 13 + 0;
- 13 ÷ 2 = 6 + 1;
- 6 ÷ 2 = 3 + 0;
- 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) =
53(10) =
0011 0101(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. 001 1110 0010 0000 1010 0011 =
001 1110 0010 0000 1010 0011
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 0101
Mantissa (23 bits) =
001 1110 0010 0000 1010 0011
Decimal number -0.000 000 000 000 000 000 000 065 4 converted to 32 bit single precision IEEE 754 binary floating point representation:
1 - 0011 0101 - 001 1110 0010 0000 1010 0011