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
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
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?
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...
Given a Class B network and a number of subnets required, complete the table to identify...
Given a Class B network and a number of subnets required, complete the table to identify the number of bits to borrow from the host field for the subnet field and the maximum number of host addresses available per subnet. Number of Subnets Required Number of Bits to Borrow for the Subnet Field Maximum Number of Hosts per Subnet Subnet Mask in Binary and Decimal Representations 5 3    23 = 8 Class B has 16 host bits by definition. If...
2 Convert each of the following octal numbers to 10-bit binary, hexadecimal, and decimal. Show your...
2 Convert each of the following octal numbers to 10-bit binary, hexadecimal, and decimal. Show your work. (a) 368 (b) 7568 3 Convert the following binary values into Decimal, Octal and hexadecimal. Show your work. (a) 111010101011112 (b) 1010111011001102 (c) 1011101010001112 (d) 1111101011102 4 Convert the following hexadecimal numbers to 16-bit binary and decimal numbers. Show your work. (a) FE9816 (b) FCAD16 (c) B00C16 (d) FEDF16 5 Perform the addition on the following unsigned binary numbers. Indicate whether or not...
QUESTION 1 During a single clock tick, how many 64-bit values can be written to an...
QUESTION 1 During a single clock tick, how many 64-bit values can be written to an input of a register file with 8 64-bit registers (i.e. an 8x64 register file)? QUESTION 2 Suppose you are designing a processor that contains a register file with 32 32-bit registers (i.e. a 32x32 register file). What is the minimum number of bits required in order to select which register is being written to? QUESTION 3 If the decimal value, 30, is shifted to...
Two identical fair 6-sided dice are rolled simultaneously. Each die that shows a number less than...
Two identical fair 6-sided dice are rolled simultaneously. Each die that shows a number less than or equal to 4 is rolled once again. Let X be the number of dice that show a number less than or equal to 4 on the first roll, and let Y be the total number of dice that show a number greater than 4 at the end. (a) Find the joint PMF of X and Y . (Show your final answer in a...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT