Binary Addition and Subtraction with Unsigned and Signed Numbers, Exercises of Computer Architecture and Organization

Instructions for performing binary addition and subtraction with unsigned and signed 4-bit numbers using two's complement. It includes examples of addition and subtraction, as well as a table for signed overflow and a problem to apply booth's algorithm for multiplication.

Typology: Exercises

2012/2013

Uploaded on 04/27/2013

arundhati
arundhati 🇮🇳

4.5

(23)

88 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1. Consider 4-bit BINARY numbers, because of “roll-over” the number line wraps around.
Perform the following additions:
e) for unsigned numbers: 0100
2
(4
10
) 1001
2
(9
10
)
+ 0110
2
(6
10
)+ 1010
2
(10
10
)
f) for signed numbers: 0100
2
(4
10
) 0100
2
(4
10
)1100
2
(-4
10
)
(two’s compliment) + 0110
2
(6
10
)+ 1010
2
(-6
10
) + 1010
2
(-6
10
)
2. For 4-bit unsigned numbers, when do we have overflow and get the wrong result during
addition? (Hint: think about the carry bits into and/or out of the most-significant bit)
3. a) For 4-bit signed numbers, complete the following table about signed overflow:
-
-
+
-
These two rows cannot cause
signed overflow in addition
-
+
++
Operand 2Operand 1
Wrong Sign
of Result
(indicates overflow)
Expected Sign
of Result
Sign of Operands for addition
b) For 4-bit signed numbers, when do we have overflow and get the wrong result during
addition? (Hint: think about the carry bits into and/or out of the most-significant bit)
4. How would you subtract two signed, 2’s-complement numbers? Try the following:
0110
2
(6
10
) 0011
2
(+3
10
)1111
2
(-1
10
)
- 0111
2
(7
10
)- 1111
2
(-1
10
) - 0011
2
(+3
10
)
Comp. Org. (CS 1410) Lecture 3 Name:________________
Lecture 3 Page 1
0000 0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
a) List unsigned decimal values on the outside
b) List signed (two's complement) decimal
values on the inside
c) Mark the point of unsigned overflow
d) Mark the point of signed overflow
Docsity.com
pf2

Partial preview of the text

Download Binary Addition and Subtraction with Unsigned and Signed Numbers and more Exercises Computer Architecture and Organization in PDF only on Docsity!

  1. Consider 4-bit BINARY numbers, because of “roll-over” the number line wraps around.

Perform the following additions: e) for unsigned numbers: 01002 (4 10 ) 10012 (9 10 )

  • 01102 (6 10 ) + 10102 (10 10 )

f) for signed numbers: 01002 (4 10 ) 01002 (4 10 ) 11002 (-4 10 ) (two’s compliment) + 01102 (6 10 ) + 10102 (-6 10 ) + 10102 (-6 10 )

  1. For 4-bit unsigned numbers , when do we have overflow and get the wrong result during addition? (Hint: think about the carry bits into and/or out of the most-significant bit)
  2. a) For 4-bit signed numbers , complete the following table about signed overflow:

These two rows cannot cause signed overflow in addition

Operand 1 Operand 2

Wrong Sign of Result (indicates overflow)

Expected Sign of Result

Sign of Operands for addition

b) For 4-bit signed numbers , when do we have overflow and get the wrong result during addition? (Hint: think about the carry bits into and/or out of the most-significant bit)

  1. How would you subtract two signed, 2’s-complement numbers? Try the following: 01102 (6 10 ) 00112 (+3 10 ) 11112 (-1 10 )
  • 01112 (7 10 ) - 11112 (-1 10 ) - 00112 (+3 10 )

Comp. Org. (CS 1410) Lecture 3 Name:________________

Lecture 3 Page 1

(^0000 ) 0010

0011

0100

0101

0110 1001 1000 0111

1010

1011

1100

1101

1110

1111

a) List unsigned decimal values on the outside

b) List signed (two's complement) decimal values on the inside

c) Mark the point of unsigned overflow

d) Mark the point of signed overflow

Docsity.com

  1. Use Booth's algorithm to calculate the 8-bit product of 0110 2 x 1101 2.

"Initial Product" "Multiplier" "Previous bit"

Multiplicand 0 1 1 0

Multiplicand 1 0 1 0

Comp. Org. (CS 1410) Lecture 3 Name:________________

Lecture 3 Page 2

Docsity.com