In: Computer Science
Find the decimal equivalents for the following 8-bit two’s complement numbers.
a. 0010 0100 Decimal Equivalent ___________
b. 1010 1001 Decimal Equivalent ___________
c. 1100 0011 Decimal Equivalent ___________
d. 0101 0101 Decimal Equivalent ___________
Steps to Convert 2's Complement Binary Numbers to Decimal Numbers :
1.Finding the Magnitude of the Number (Positive or Negative) by considering the MSB ( Most Significant Bit) (Left most bit is called MSB
2.If MSB is 0 then the Magnitude of the number is Positive. Then directly convert it into Decimal representation using positional Weight Method.
3. If MSB is 1 then the Magnitude of the Number is Negative. Then follow the below steps
Finding the Decimal Value :
a. 0010 0100
Step1 : The MSB bit is 0 (leftmost bit) . Hence it is a Positive Number.
Step 2: Therefore directly converting it into Decimal using the Positional Weight Method.
Positional Weights | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bits | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 |
value | 0 | 0 | 32 | 0 | 0 | 4 | 0 | 0 |
Value = Positional weight x Data Bit (Like 1x 25 = 32 )
Total value = (0 × 27 + 0 × 26 + 1 × 25 + 0 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 0 × 20)
= 32 + 4 = 36
The Decimal Equivalent of 0010 0100 is + 36
b. 1010 1001
Step1 : The MSB bit is 1 (leftmost bit) . Hence it is a Negative Number
Step 2: (As the number is Negative We have to use separate method )
2's complement Number (Given) | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
1's complement form | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
Adding 1 | + | 1 | ||||||
Final Result | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 |
Converting Final Result into Decimal using the Positional Weight Method.
Positional Weights | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bits | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 |
value | 0 | 64 | 0 | 16 | 0 | 4 | 2 | 1 |
Value = Positional weight x Data Bit (Like 1x 25 = 32 )
Total value = (0 × 27 + 1 × 26 + 0 × 25 + 1 × 24 + 0 × 23 + 1 × 22 + 1 × 21 + 1 × 20)
= 64 + 16 + 4 + 2 + 1 = 87
Now apply negative sign to get Final result
The Decimal Equivalent of 1010 1001 is - 87
c. 1100 0011
Step1 : The MSB bit is 1 (leftmost bit) .Hence it is a Negative Number
Step 2: (As the number is Negative We have to use separate method )
2's complement Number (Given) | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
1's complement form | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |
Adding 1 | + | 1 | ||||||
Final Result | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 |
Converting Final Result into Decimal using the Positional Weight Method.
Positional Weights | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bits | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 |
value | 0 | 0 | 32 | 16 | 8 | 4 | 0 | 1 |
Value = Positional weight x Data Bit (Like 1x 25 = 32 )
Total value = (0 × 27 + 0 × 26 + 1 × 25 + 1 × 24 + 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20)
= 32 + 16 + 8 + 4 + 1 = 61
Now apply negative sign to get Final result
The Decimal Equivalent of 1100 0011 is - 61
d. 0101 0101
Step1 : The MSB bit is 0 (leftmost bit) . Hence it is a Positive Number.
Step 2: Therefore directly converting it into Decimal using the Positional Weight Method.
Positional Weights | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
Bits | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
value | 0 | 64 | 0 | 16 | 0 | 4 | 0 | 1 |
Value = Positional weight x Data Bit (Like 1x 25 = 32 )
Total value = (0 × 27 + 1 × 26 + 0 × 25 + 1 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20)
= 64 + 16 + 4 + 1 = 85
The Decimal Equivalent of 0101 0101 is + 85
If You Have Any Doubts. Please Ask Using Comments.
Have A Great Day!