Question

In: Computer Science

Show decimal values below in two complement binary notation with 6 bits. a) 18 b) -12

Show decimal values below in two complement binary notation with 6 bits.

a) 18

b) -12

Solutions

Expert Solution

a) 18

  • A positive number is the same in unsigned form and also in two's complement form.
  • To find the two's complement form of a positive number, just represent the decimal integer in its binary form
  • Convert 18 to binary
    • 18/2 9 - 0
    • 9/2 4 - 1
    • 4/2 2 - 0
    • 2/2 1 - 0
  • The binary equivalent of 18 is 10010 and when it represented in 6 bits, it is 010010
  • Two's complement of 18 is same as the positive notation.
  • Answer is 0100102

=============================================================================================

b) -12

  • To find the two's complement form of a negative number, first represent the decimal integer in its binary form
  • Invert all the bits in the binary ,which means convert 1's to 0's and 0's to 1's
  • Add 1 to the Inverted answer
  • The resultant binary number is the two's complement representation of the decimal integer.
  • Convert 12 to binary
    • 12/2 6 - 0
    • 6/2 3 - 0
    • 3/2 1 - 1
    • 1/2 0 - 1
  • The binary equivalent of 12 is 01100 and when it represented in 6 bits, it is 001100
  • Invert the bits and the result is 110011
  • Add 1 to this result. 110011+1 => 110100
  • Two's complement of -12 is 110100
  • Answer is 1101002

Below diagram shows the addition of 110011 and 1

The first row specifies the carry and the last row specifies the sum.

1+1 = sum (0) carry (1)

0+1 = sum(1) carry (0)

1+0 = sum(1) carry (0)

0+0 = sum(0) carry(0)

1 1
1 1 0 0 1 1 +
1 =
1 1 0 1 0 0 sum

Related Solutions

Give the signed decimal value of D03 (12 bits, show work)
Give the signed decimal value of D03 (12 bits, show work)
Part 1: Solve the operation 75.38-18.62 in binary using two's complement. Use 6 bits for the...
Part 1: Solve the operation 75.38-18.62 in binary using two's complement. Use 6 bits for the fractionary part. Part 2:Convert the result to a decimal, and explain how much is the absolute error obtained in the operation. (Provide Step by Step process of problem solving in each part.)
Design a 9’s complement of a Binary Coded Decimal
Design a 9’s complement of a Binary Coded Decimal
1. Give the signed decimal value of A93 (12 bits, show work)
1. Give the signed decimal value of A93 (12 bits, show work)
i need to convert decimal to twos complement binary and then add the binary digits but...
i need to convert decimal to twos complement binary and then add the binary digits but I am unable to do it. I am only allowed to use string, can anyone help me out please. i need the code urgently. #include #include #include #include using namespace std; string reverse(string s) { string x = ""; for (long i = s.length() - 1; i >= 0; i--) { x += s[i]; } return x; } string twosComplementStringsAddition(string A, string B) {...
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.  
The standard method of representing negative numbers in the binary system is with 2's complement notation....
The standard method of representing negative numbers in the binary system is with 2's complement notation. What are the advantages and disadvantages of using this method to represent negative numbers?
1) Covert the following binary values to decimal. Do this interpreting the binary as unsigned and...
1) Covert the following binary values to decimal. Do this interpreting the binary as unsigned and signed. a. 0111 1001 b. 1000 0000 c. 1111 1111 PLEASE EXPLAIN IT IN DETAIL
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system....
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system. Make sure there are enough digits in the results to be able to perform arithmetic operations with these two numbers. (b) Perform in the signed 2’s complement system, (+70) + (-26) (c) Perform in the signed 2’s complement system, (-70) - (-26) (d) Perform in the signed 2’s complement system, (+70) + (+26)
Solve each of the following problems by translating the values into two’s complement notation (using patterns...
Solve each of the following problems by translating the values into two’s complement notation (using patterns of 5 bits), converting any subtraction problem to an equivalent addition problem, and performing that addition. Check your work by converting your answer to base 10 notation. (Watch out for overflow.) a. 5 + 1 b. 12 – 5 c. 5 – 11 d. 12 + 5 e. 5 – 1
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT