The Value of Binary Numbers in Decimal
What are the decimal values of the following binary numbers represented in signed 2's complement: a. 0110 0111 b. 1001 0100 c. 0110 1001 d. 1111 1111?
a. 0110 0111 This binary number is positive because the leftmost bit is 0. So, the binary number is 0110 0111. Then, converting it into decimal: 0110 0111 = (2^6) + (2^5) + (2^1) + (2^0) = 64 + 32 + 2 + 1 = 98 Therefore, the value in decimal is 98. b. 1001 0100 This binary number is negative because the leftmost bit is 1. So, we need to calculate the 2's complement of this number as follows: Step 1: Take the 1's complement of the number, which means changing all 1's to 0's and all 0's to 1's. 1001 0100 -> 0110 1011 Step 2: Add 1 to the 1's complement of the number. 0110 1011 -> 0110 1100 Therefore, the 2's complement of 1001 0100 is 0110 1100. Then, converting it into decimal: 0110 1100 = -(2^6) + (2^5) + (2^4) + (2^3) + (2^1) = -64 + 32 + 16 + 8 + 2 = -6 Therefore, the value in decimal is -6. c. 0110 1001 This binary number is positive because the leftmost bit is 0. So, the binary number is 0110 1001. Then, converting it into decimal: 0110 1001 = (2^6) + (2^4) + (2^3) + (2^0) = 64 + 16 + 8 + 1 = 89 Therefore, the value in decimal is 89. d. 1111 1111 This binary number is negative because the leftmost bit is 1. So, we need to calculate the 2's complement of this number as follows: Step 1: Take the 1's complement of the number, which means changing all 1's to 0's and all 0's to 1's. 1111 1111 -> 0000 0000 Step 2: Add 1 to the 1's complement of the number. 0000 0000 -> 0000 0001 Therefore, the 2's complement of 1111 1111 is 0000 0001. Then, converting it into decimal: 0000 0001 = -(2^0) = -1 Therefore, the value in decimal is -1.