Professional Documents
Culture Documents
ENGG 1203 Tutorial Computer Arithmetic (1) : Computer Systems Supplementary Notes Learning Objectives
ENGG 1203 Tutorial Computer Arithmetic (1) : Computer Systems Supplementary Notes Learning Objectives
1 2
Convert the following decimal values to binary: Perform the following operations in the 2’s
a) 205 b) 2133 complement system. Use eight bits (including the sign
bit) for each number.
20510 = 1 x 27 + 1 x 26 + 1 x 23 a) add +9 to +6 b) add +14 to -17 c) add +19 to -24
+ 1 x 22 + 1 x 20
00001001 = +9 00001110 = +14 00010011 = +19
= 110011012
00000110 = +6 11101111 = −17 11101000 = −24
00001111 = +15 11111101 = −3 11111011 = −5
213310 = 1 x 211 + 1 x 26
+1 x 24 + 1 x 22 + 1 x 20 24 = 00011000 −24 = 11100111(1's complement) = 11101000(2's complement)
= 1000010101012
3 4
Overflow Addition using 2’s Complement (1)
Overflow: Add two positive numbers to get a negative Perform the following computations.
number or two negative numbers to get a positive
Indicate on your answer if an overflow has
number
occurred.
For 2’s complement,
(+1)+(+6)
= +7 OK 01000000 + 01000001 (64 + 65)
(+1)+(+7) 00000111 − 11111001 (7 - -7)
= -8 Overflow
(-1)+(-8)
= +7 Overflow
(-6)+(+7)
= -1 OK
5 6
7 8
Limitation of Parallel Processing? Limitation of Parallel Processing?
1
Speedup overall =
Fraction parallel
Major challenge is: % of program inherently (1 − Fraction enhanced ) +
sequential Speedup parallel
Suppose 80X speedup from 100 processors. What 1
fraction of original program can be sequential? 80 =
a. 10% (1 − Fraction parallel ) + Fraction
100
parallel
5%
80 × ((1 − Fraction parallel ) +
b. Fraction parallel
) =1
c. 1% 100
d. <1% 79 = 80 × Fraction parallel − 0.8 × Fraction parallel
Fraction parallel = 79 / 79.2 = 99.75%
9 10
11 12
Ratio of Speed-up via N Processors
13 14
17 18
(Appendix)
19