Question

In: Computer Science

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.

  1. (-128) + (+100)

  2. (+5) + (+7)

  3. (+5) + (-7)

  4. (-5) + (+7)

  5. (-5) + (-7)

  6. (+120) + (+100)

  7. (-120) + (-100)

  8. (6A)16+ (E2)16

  9. (A7)16+ (35)16

  10. (80)16+ (80)16

Solutions

Expert Solution

Now let's find each number in signed 2's complement representation. For positive numbers we just need to find it's signed 1's complement. For negative number we need to add 1 to the signed 1's complement.

i

Now +100 = 0110 0100

-128 = 1000 0000. Hence the result will be 1110 0100.

ii

+5 = 0000 0101

+7 = 0000 0111

Result = 0000 1100

iii Here -7 = 1111 1001 and +5 =  0000 0101 hence result =  1111 1110

iv

-5 = 1111 1011

+7 = 0000 0111

result = 1 0000 0010 ( Overflow will occur)

v

-5 + -7 = 1111 1011 + 1111 1001 = 1 1111 0100 (Overflow will occur)

vi

120 + 100 = 0111 1000 + 0110 0100 = 1101 1100 . Result got negative because range of +127 exceeded.

vii

Now -120 + -100 = 1000 1000 + 1001 1100 = 1 0010 0100 (Overflow)

viii

6A + E2 = 0110 1010 + 1110 0010 = 1 0100 1100 (Overflow)

ix

A7 + 35 = 1110 0010 + 0011 0101 = 1 0001 0111 (Overflow)

x

80+80 = 1000 0000 + 1000 0000 = 1 0000 0000 (Overflow and Zero Result)

Now we will indicate the status of flags (N,Z,V,C) for all of the above . Note the order of bits below correspond to order in (NZVC)

i . (1000)

ii (0000)

iii (1000)

iv (0010)

v (1010)

vi (1000)

vii (0010)

viii (0010)

ix (0010)

x (0110)


Related Solutions

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.
Represent the following numbers in binary 8-bit representation using singed magnitude, one's complement, two's complement, and...
Represent the following numbers in binary 8-bit representation using singed magnitude, one's complement, two's complement, and excess-127 representations: a) 48 b) -35
Represent -60 in binary using 8-bit signed magnitude. Add the following unsigned 8 bit binary numbers...
Represent -60 in binary using 8-bit signed magnitude. Add the following unsigned 8 bit binary numbers as shown. 01110101 + 00111011 Add the following unsigned 8 bit binary numbers as shown. 01000100 + 10111011
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?
convert +38 and +17 to binary using the signed 2s complement representation and enough digits to...
convert +38 and +17 to binary using the signed 2s complement representation and enough digits to accomaodate the numbers. Then perform the binary equivalent of (-38) and +17
Convert decimal +47 and +31 to binary, using the signed-2’s-complement representation and enough digits to accommodate...
Convert decimal +47 and +31 to binary, using the signed-2’s-complement representation and enough digits to accommodate the numbers. Then perform the binary equivalent of (+31)+(-47), (-31)+(+47), and (-31)+(-47). Convert the answers back to decimal and verify that they are correct.
(16%) Convert decimal +47 and +38 to binary, using the signed-2’s-complement representation and enough digits to...
(16%) Convert decimal +47 and +38 to binary, using the signed-2’s-complement representation and enough digits to accommodate the numbers, Then, perform the binary equivalent of (+47)+(-38) and (-47)+(-38) using addition. Convert the answers back to decimal and verify that they are correct.
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.  
Represent the decimal number -6 in binary using 4-bits: 3a) signed magnitude ____________________________ 3b) 1’s complement...
Represent the decimal number -6 in binary using 4-bits: 3a) signed magnitude ____________________________ 3b) 1’s complement _____________________________ 3c) 2’s complement _____________________________
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT