Question

6)Two integers A and B are stored in two’s complement format. Show how B is subtracted...

6)Two integers A and B are stored in two’s complement format. Show how B is subtracted from A. (-23) - (+13) =(-36).

Hint: Let A = (-23) and B = (+13) and show how to do (A – B) in two’s complement format.

Use 8-bits torepresent each number in binary.Verify that your final answer in binary is equal to -36 in decimal. Show your work?

Homework Answers

Answer #1
  • 2's complement of a number obtained by adding 1 to its 1's complement
  • 1's complement is calculated by inverting all 1's to 0's and all 0's to 1's
  • Here A is -23 and B is 13
  • 2's complement form of -23 is 1's complement of 23 +1

  

  • 8 bit binary form of 23 is 00010111
  • It's 1's complement is 11101000
  • 2's complement form of -23=11101000+1 =11101001
  • Subtraction is performed by adding 2's complement of subtrahend
  • To perform (-23)-(+13), add 2's complement of +13 to -23
  • 2's complement of 13 is 1's complement of 13 +1
  • 8 bit binary form of 13 is 00001101

  • it's 1's complement is 11110010
  • 2's complement of 13 is 11110010+1=11110011
  • Add 2's complement of 13 to -23
  • 11101001+
  • 11110011
  • 11011100
  • To show it is correct,convert 11011100 to its decimal form
  • It is done by inverting each digit(0 to 1 and 1 to 0) and add 1
  • 00100011+1=00100100
  • =1x25+0x24+0x23+1x22+0x21+0x20 = 32+4=36
  • Since first digit of 11011100 is 1.So the number is negative
  • Result is -36
  • The answer is verified.



Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. Assuming unsigned binary representation, convert 10110 (B) to decimal. Show work. 2 . Assuming unsigned...
1. Assuming unsigned binary representation, convert 10110 (B) to decimal. Show work. 2 . Assuming unsigned binary representation, convert 12 (D) to binary. Show work. 4. Assuming 9-bit two’s complement representation and let x be binary representation of 94 (D) a. Find x. Show work. b. Show the effect of the ASL operation on x, and then convert the result back to decimal. c. Show the effect of the ASR operation on x, and then convert the result back to...
A). Convert following decimal integers to 8-bit two's complement binary numbers using any method . Explain...
A). Convert following decimal integers to 8-bit two's complement binary numbers using any method . Explain why, If decimal number cannot be represented with 8 bits. a. -46 b. -63 c. 118 d. -128 e. 128 B). Perform following operations by converting the decimal numbers to 8-bit two’s complement binary. Check results by converting final result to decimal a. 94-53 b. 15–84
i) What would be stored in the 4-digit binary codes if the clock display time was:17:29...
i) What would be stored in the 4-digit binary codes if the clock display time was:17:29 (7) (c) Using two’s complement binary arithmetic, find the sum of (i) 48 and – 19 (ii) ( 6)  ( 13) and (iii) Convert (b) (i)Convert 87.25 in decimal to Binary and show it value in Octal and Hex. n
Convert the hexadecimal number DEADBEEF to binary. Convert the following decimal number to binary: a) 356...
Convert the hexadecimal number DEADBEEF to binary. Convert the following decimal number to binary: a) 356              b) 658 What decimal value does the 8-bit binary number 10011110 represent if it is on a computer using two’s complement representation? What decimal value does the 8-bit binary number 10110100 have if it is on a computer using two’s complement representation? please show your work for question number 4. thank you.
You are to create 17 subnets on a class B network with the IP address: 172.20.112.1?...
You are to create 17 subnets on a class B network with the IP address: 172.20.112.1? How many bits do you need to uniquely identify each subnet? (focus on the binary representation more so than the networking aspect of the question) : hint what is the minimum number of bits do you need to represent 17 different entities. (show all steps) Subtract 10 – 7 using 2’s complement (show all steps) Find the two’s complement of the following number:   10110111(show...
What will be the output when the computer performs arithmetic left shift operation on the bit...
What will be the output when the computer performs arithmetic left shift operation on the bit pattern 11010101 which is stored in two’s complement format? Verify that if you multiply the original number in decimal by 2 you get your final answer in decimal. Show your work?
4)What will be the output when the computer performs arithmetic left shift operation on the bit...
4)What will be the output when the computer performs arithmetic left shift operation on the bit pattern11010101 which is stored in two’s complement format?Verify that if you multiply the original number in decimal by 2 you get your final answer in decimal. Show your work?
In the following problems, assume you are using 2s complement form and do the indicated operation....
In the following problems, assume you are using 2s complement form and do the indicated operation. Leave the answers in binary. Also, assume you are dealing with signed numbers. Also, assume we are saving the answer in a 8-bit register. In this case, for each problem would the saved answer be correct. If not for which of the following problems would if be incorrect and why?   6 + 7   6 + (-7)    -6 + 13 (Note: 13, which is positive...
2. On the Arduino Uno (and other ATMega based boards) an “int” stores a 16-bit (2-byte)...
2. On the Arduino Uno (and other ATMega based boards) an “int” stores a 16-bit (2-byte) value. “int” store negative numbers with a technique called 2's complement math. The highest bit, sometimes referred to as the "sign" bit, flags the number as a negative number. The rest of the bits are inverted and 1 is added. The Arduino takes care of dealing with negative numbers for you, so that arithmetic operations work transparently in the expected manner. a-What is the...
Question 9.1 Half-precision Floating-point Format (50 marks) Do some research and find out how real (floating...
Question 9.1 Half-precision Floating-point Format Do some research and find out how real (floating point) numbers are represented in Binary. (a) (10 =6+4 marks) Devise your own 16-bit representation for floating point numbers. Draw a diagram of your representation and explain what the various bits are used for. Explain in detail: (i) How many bits are allocated to the mantissa and the exponent, respectively? (ii) What defines the range and the precision (or accuracy) of the numbers stored in floating...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT