Can you verify that my work is correct and both resulting values are positive? 1
ID: 3784093 • Letter: C
Question
Can you verify that my work is correct and both resulting values are positive?
1. Let A = (1110 1010)2. What decimal value does A represent if A is a 1's complement number?
A’s normal (binary) representation is (0001 0101)2 if A is a 1’s complement number.
A = (1*20) + (0*21) + (1*22) + (0*23) + (1*24) + (0*25) + (0*26) + (0*27) = 2110
Let A = (1110 1010)2. What decimal value does A represent if A is a 2's complement number?
00010101
1
________
00010110
=> A = (0*20) + (1*21) + (1*22) + (0*23) + (1*24) + (0*25) + (0*26) + (0*27) = 2210
Explanation / Answer
Given: A = 1110 10102. Here A is 1's complement. So, to convert A to decimal number, its regular number is, again 1's complement the A, which will not give 0001 01012. And now, converting to binary, will give: 20 * 1 + 21 * 0 + 22 * 1 + 23 * 0 + 24 * 1 + 25 * 0 + 26 * 0 + 27 * 0 = 1 + 0 + 4 + 0 + 16 + 0 + 0 + 0 = 2110.
To, recheck this, we can simply convert 21, back to binary.
21 / 2 = 10 with a remainder 1
10 / 2 = 5 with a remainder 0
5 / 2 = 2 with a remainder 1
2 / 2 = 1 with a remainder 0
1/ 2 = 0 with a remainder 1
Now, the binary number is: 0001 01012 Therefore, the 1's complement representation of 1110 10102 = 2110
Given, A = 1110 10102. A is 2's complement representation. Usually, 2's complement is used to represent a negative number, but as you specified, both the numbers are positive values, here is the conversion:
If A is 2's complement representation: its 1's complement representation is: 1110 10012, and its original number is: 0001 01102. Its decimal equivalent number is: 20 * 0 + 21 * 1 + 22 * 1 + 23 * 0 + 24 * 1 + 25 * 0 + 26 * 0 + 27 * 0 =
0 + 2 + 4 + 0 + 16 + 0 + 0 + 0 = 2210. You can reverse check with the same technique as is done in the first example.
And to conclude, both your answers are correct. Good work.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.