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) {...
1.convert the following numbers from decimal to binary assuming seven-bit twe's complement binary representation: a)49 b)...
1.convert the following numbers from decimal to binary assuming seven-bit twe's complement binary representation: a)49 b) -27 c)0 d) -64 e) -1 f) -2 g) what is the range for this computer as written in binary and in decimal? 2.convert the following numbers from decimal to binary assuming nine-bit twe's complement binary representation: a)51 b) -29 c) -2 d)0 e) -256 f) -1 g ) what is the range for this computer as written in binary and in decimal?
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?
Convert from hexadecimal to binary to decimal (PLEASE SHOW WORK) 1. B2 - binary: - decimal:...
Convert from hexadecimal to binary to decimal (PLEASE SHOW WORK) 1. B2 - binary: - decimal: 2. 37 - binary: - decimal: 3. 0A -binary: - decimal: 4. 11 - binary: - decimal:
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT