chapter03 exercises

6
BK TP.HCM 2010 dce COMPUTER ARCHITECTURE COMPUTER ARCHITECTURE CE2010 CE2010 Faculty of Computer Science and Engineering Department of Computer Engineering Nam Ho [email protected]

Upload: do-cong-thanh

Post on 28-Apr-2015

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter03 Exercises

BKTP.HCM

2010dce

COMPUTER ARCHITECTURECOMPUTER ARCHITECTURECE2010CE2010

Faculty of Computer Science and EngineeringDepartment of Computer Engineering

Nam Ho [email protected]

Page 2: Chapter03 Exercises

BKTP.HCM

2010dce

ARITHMETIC FOR COMPUTERSARITHMETIC FOR COMPUTERS

2

Chapter 3Chapter 3

Page 3: Chapter03 Exercises

2010dce

3Computer Architecture – Chapter 3

Exercise 1• Show the contents of each register on each step for the result of multiplication of 6-bit integer

4 and 7• Calculate the time necessary (number of cycles) to perform the multiplication above

Page 4: Chapter03 Exercises

2010dce

4Computer Architecture – Chapter 3

Exercise 2• Prepresent 927.4510 into IEEE FP 754 for

single precision

– + 1110011111.01 1100 1100 1100– + 1.11001111101 1100 1100 1100 x 29

– S = 0– F = 110 0111 1101 1100 1100 1100– E = 9 + Bias = 9 + 127 = 136 = 100010001 10001000 110 0111 1101 1100 1100 1100

Page 5: Chapter03 Exercises

2010dce

5Computer Architecture – Chapter 3

Exercise 3• NVIDIA has 16-bits wide for FP which is

similar to IEEE 754. The left most bit is the sign bit, the exponent is 5 bits.

• Calculate 1.5234375 × 10–1 × (2.0703125 ×10–1 + 9.96875 × 101). Assume one guard, one round bit and one sticky bit and round to nearest even. Show all steps in binary number

Page 6: Chapter03 Exercises

2010dce

6Computer Architecture – Chapter 3

Exercise 3• 1.5234375 × 10–1 = 1.0011100000 × 2–3

• 2.0703125 × 10–1 = 1.1010100000 × 2–3

• 9.96875 × 101 = 1.1000111011 × 26

– 2.0703125 × 10–1 + 9.96875 × 101 =– ( .0000000011 01 0100000 (G =0, R=1, S=1) +– 1.1000111011) x 26 =– 1.1000111110 × 26 ( Not round) x– 1.0011100000 × 2–3

– 1.1110011011 1001000000 (G=1, R=0, S=1) Round up– 1.1110011100 x 23