What are the steps to convert the base 2 signed binary number
1011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100(2) to a base 10 decimal system equivalent integer?
1. Is this a positive or a negative number?
1011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100 is the binary representation of a negative integer, on 64 bits (8 Bytes).
- In a signed binary, the first bit (the leftmost) is reserved for the sign, 1 = negative, 0 = positive. This bit does not count when calculating the absolute value.
2. Construct the unsigned binary number.
Exclude the first bit (the leftmost), that is reserved for the sign:
1011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100 = 011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100
3. Map the unsigned binary number's digits versus the corresponding powers of 2 that their place value represent:
262
0 261
1 260
1 259
0 258
1 257
1 256
1 255
0 254
0 253
1 252
1 251
1 250
0 249
1 248
0 247
1 246
0 245
1 244
1 243
0 242
1 241
1 240
0 239
0 238
0 237
1 236
1 235
0 234
0 233
0 232
0 231
0 230
0 229
0 228
0 227
0 226
0 225
0 224
0 223
0 222
0 221
0 220
0 219
0 218
0 217
0 216
0 215
0 214
0 213
0 212
0 211
0 210
0 29
0 28
0 27
0 26
1 25
0 24
1 23
0 22
1 21
0 20
0
4. Multiply each bit by its corresponding power of 2 and add all the terms up.
011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100(2) =
(0 × 262 + 1 × 261 + 1 × 260 + 0 × 259 + 1 × 258 + 1 × 257 + 1 × 256 + 0 × 255 + 0 × 254 + 1 × 253 + 1 × 252 + 1 × 251 + 0 × 250 + 1 × 249 + 0 × 248 + 1 × 247 + 0 × 246 + 1 × 245 + 1 × 244 + 0 × 243 + 1 × 242 + 1 × 241 + 0 × 240 + 0 × 239 + 0 × 238 + 1 × 237 + 1 × 236 + 0 × 235 + 0 × 234 + 0 × 233 + 0 × 232 + 0 × 231 + 0 × 230 + 0 × 229 + 0 × 228 + 0 × 227 + 0 × 226 + 0 × 225 + 0 × 224 + 0 × 223 + 0 × 222 + 0 × 221 + 0 × 220 + 0 × 219 + 0 × 218 + 0 × 217 + 0 × 216 + 0 × 215 + 0 × 214 + 0 × 213 + 0 × 212 + 0 × 211 + 0 × 210 + 0 × 29 + 0 × 28 + 0 × 27 + 1 × 26 + 0 × 25 + 1 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 0 × 20)(10) =
(0 + 2 305 843 009 213 693 952 + 1 152 921 504 606 846 976 + 0 + 288 230 376 151 711 744 + 144 115 188 075 855 872 + 72 057 594 037 927 936 + 0 + 0 + 9 007 199 254 740 992 + 4 503 599 627 370 496 + 2 251 799 813 685 248 + 0 + 562 949 953 421 312 + 0 + 140 737 488 355 328 + 0 + 35 184 372 088 832 + 17 592 186 044 416 + 0 + 4 398 046 511 104 + 2 199 023 255 552 + 0 + 0 + 0 + 137 438 953 472 + 68 719 476 736 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 64 + 0 + 16 + 0 + 4 + 0 + 0)(10) =
(2 305 843 009 213 693 952 + 1 152 921 504 606 846 976 + 288 230 376 151 711 744 + 144 115 188 075 855 872 + 72 057 594 037 927 936 + 9 007 199 254 740 992 + 4 503 599 627 370 496 + 2 251 799 813 685 248 + 562 949 953 421 312 + 140 737 488 355 328 + 35 184 372 088 832 + 17 592 186 044 416 + 4 398 046 511 104 + 2 199 023 255 552 + 137 438 953 472 + 68 719 476 736 + 64 + 16 + 4)(10) =
3 979 693 538 009 940 052(10)
5. If needed, adjust the sign of the integer number by the first digit (leftmost) of the signed binary:
1011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100(2) = -3 979 693 538 009 940 052(10)
1011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100(2), Base 2 signed binary number, converted and written as a base 10 decimal system equivalent integer:
1011 0111 0011 1010 1011 0110 0011 0000 0000 0000 0000 0000 0000 0000 0101 0100(2) = -3 979 693 538 009 940 052(10)
Spaces were used to group digits: for binary, by 4, for decimal, by 3.