Question

In: Computer Science

Find the decimal equivalents for the following 8-bit two’s complement numbers. a. 0010 0100 Decimal Equivalent...

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 ___________

Solutions

Expert Solution

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 :

  • Applying 1's complement to the given Number
  • Add 1 to the result
  • And Then convert the final result into decimal representation by using Positional Weight Methods.
  • Apply the Sign (found in Step 1) and to resultant value to get decimal equivalents for the 8-bit two’s complement numbers.

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!


Related Solutions

1. What is the two’s complement of: 00110101 2. Carry out the following calculation using 8-bit...
1. What is the two’s complement of: 00110101 2. Carry out the following calculation using 8-bit signed arithmetic (convert to 8-bit binary sequences) and use two’s complement for the negative number, give the result as both an 8-bit binary sequence and in base 10: 127 – 74. 3. What does shifting a binary sequence to left by 3 places correspond to (from the arithmetic standpoint)
All decimal numbers must be converted to signed two’s complement form before working. Use the least...
All decimal numbers must be converted to signed two’s complement form before working. Use the least number of digits necessary (only using one sign bit) to represent the largest number in a given problem. The smaller number must be represented with the same number of bits. If overflow occurs, indicate that with a note. Show step by step subtraction. 13 - 8 6 - 19 21 - 14
All decimal numbers must be converted to signed two’s complement form before working. Use the least...
All decimal numbers must be converted to signed two’s complement form before working. Use the least number of digits necessary (only using one sign bit) to represent the largest number in a given problem. The smaller number must be represented with the same number of bits. If overflow occurs, indicate that with a note. Show step by step addition. 15 + 6 14 + 18 31 + 5
Evaluate the following expressions, where two’s complement numbers, A is 11111110 and B is 00000010 and...
Evaluate the following expressions, where two’s complement numbers, A is 11111110 and B is 00000010 and indicate the results. a. A + B b. A – B c. B–A d. –B e. – (-A)
Binary How is 00001001 (base 2) represented in 8-bit two’s complement notation? Convert 0.3828125 to binary...
Binary How is 00001001 (base 2) represented in 8-bit two’s complement notation? Convert 0.3828125 to binary with 4 bits to the right of the binary point. How is 00110100 (base 2) represented in 8-bit one's complement.  
Assume that we are executing the following code on a 32-bit machine using two’s complement arithmetic...
Assume that we are executing the following code on a 32-bit machine using two’s complement arithmetic for signed integers. Which of the following will be printed when the following code is executed (circle those printed, and show work; e.g., how the values are stored): #include <stdio.h> int main() { char x = 0xF;                // x = ________ char y = -1;                 // y = ________ unsigned char z = 0xFF;      // z = 11111111        if (x<z)     printf("performed unsigned compare,...
Perform the following calculation in a 6-bit two’s complement system. Show your work. Indicate at the...
Perform the following calculation in a 6-bit two’s complement system. Show your work. Indicate at the end if there will be overflow/underflow or not and why. 1810 – 1010
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers,...
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers, • perform the operation shown, • show all work in binary operating on 4-bit numbers, and • identify overflow if necessary. a) 4 + 2 b) 4 – 2 c) 2 – 4 d) 4 + 4
Represent -34 and +67 in the following way: a) 8 bit 1's complement representation.
Represent -34 and +67 in the following way: a) 8 bit 1's complement representation.
Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25...
Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25 d) -96 Convert the following hexadecimal numbers to binary and decimal assuming two's compliment format: a) 0x56 b) 0x14 c) 0xF8 d) 0xCC MUST DO ALL PROBLEMS AND SHOW ALL WORK!!!!
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT