Question

In: Computer Science

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

Solutions

Expert Solution

13 - 8

The first number is = 13

The second number is = 8

The binary representation of the first number is = 1101

The binary representation of the second number is = 1000

We need to subtraction the second number and we can perform the addition operation by using the two's complement.

So, the two's complement of the second number is = 1000

Now, we will perform the addition operation as given below:

1101 + 1000 = 1 0101

If the sign of two subtraction operands is the same or the sign of two additional operands is different then the overflow never occurs.

So, there is no overflow.

After ignoring the carry bit, the MSB is 0, so the result is positive.

The final result is: 0101

6 - 19

The first number is = 6

The second number is = 19

The binary representation of the first number is = 00110

The binary representation of the second number is = 10011

We need to subtraction the second number and we can perform the addition operation by using the two's complement.

So, the two's complement of the second number is = 01101

Now, we will perform the addition operation as given below:

00110 + 01101 = 10011

If the sign of two subtraction operands is the same or the sign of two additional operands is different then the overflow never occurs.

The MSB of the result is 1, so the result is negative and in two's complement form. The get the actual number, we need to find the two's complement first.

The final result is: 10011

21 - 14

The first number is = 21

The second number is = 14

The binary representation of the first number is = 10101

The binary representation of the second number is = 01110

We need to subtraction the second number and we can perform the addition operation by using the two's complement.

So, the two's complement of the second number is = 10010

Now, we will perform the addition operation as given below:

10101 + 10010 = 100111

If the sign of two subtraction operands is the same or the sign of two additional operands is different then the overflow never occurs.

So, there is no overflow.

After ignoring the carry bit, the MSB is 0, so the result is positive.

The final result is: 00111


Related Solutions

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
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 ___________
For m=4 bits, using the signed two’s complement representation, (neatly) construct a table consisting of all...
For m=4 bits, using the signed two’s complement representation, (neatly) construct a table consisting of all possible 4 bit sequences along with their base 10 values.
(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)
Assuming signed two’s complement representation using m=8 bits, add the following numbers using binary addition AND...
Assuming signed two’s complement representation using m=8 bits, add the following numbers using binary addition AND determine the values of the N, Z, V and C flags in response to each calculation. (-128) + (+100) (+5) + (+7) (+5) + (-7) (-5) + (+7) (-5) + (-7) (+120) + (+100) (-120) + (-100) (6A)16+ (E2)16 (A7)16+ (35)16 (80)16+ (80)16
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to...
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to decimal and confirm: 110110 + 111000 001100 – 011100
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)
a)The decimal equivalent of the signed 2’s complement 8-bit binary number 11010101B is ______________. b)The decimal...
a)The decimal equivalent of the signed 2’s complement 8-bit binary number 11010101B is ______________. b)The decimal equivalent of the unsigned 8-bit hex number 0B4H is ______________. c)The value of the expression ‘H’ – ‘B’ is less than / equal to / greater than that of the expression ‘L’ – ‘C’. d)If the .data segment contains declarations                         A    BYTE      2 DUP (‘a’), ‘+’ B    BYTE      3 DUP (‘b’), 0 C    BYTE      4 DUP (‘c’), ‘–’ D    BYTE     ...
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7...
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7 5 -3
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7...
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7 5 -3
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT