Download CST131 Tutorial2 PDF

TitleCST131 Tutorial2
TagsElectronic Engineering Central Processing Unit Instruction Set Macintosh Parallel Computing
File Size277.1 KB
Total Pages7
Document Text Contents
Page 2

2

CPI = (48000*1 + 34000*2 + 13000*2 + 5000*2)/100000 = 152000/100000 =

1.52





66
1010

rate MIPS






CPI

f

T

I
c
















MIPS = Clock frequency/(CPI*1000000) = (40*1000000)/(1.52*1000000) =

26.3



Execution time (T) = CPI*Instruction count*clock time = CPI*Instruction

count/frequency = 1.52*100000/40000000 = 1.52/400 = 3.8 ms





3. Assume a processor is able to process 50,500,000 instructions in 0.011 seconds.

Calculate the MIPS rate.



66
1010

rate MIPS






CPI

f

T

I
c






MIPS rate = 50500000 / (0.011 x 10
6
) = 4590.91 MIPS

































Total number of instructions

Total time taken

Change from “instructions” to

“millions of instructions”

Cycles per second /

cycles per instruction

= cycle x instruction /

second x cycle

= instruction / second



Change from

“instructions” to

“millions of instructions”

Page 6

6



7. Convert the following decimal numbers to binary:



(a) 0.4687510

(b) 0.310



(a)

0.46875 x 2 = 0.9375

0.9375 x 2 = 1.875

0.875 x 2 = 1.75

0.75 x 2 = 1.5

0.5 x 2 = 1

Answer = 0.011112



(b)

0.3 x 2 = 0.6

0.6 x 2 = 1.2

0.2 x 2 = 0.4

0.4 x 2 = 0.8

0.8 x 2 = 1.6

Answer = 0.01001…2



8. Represent the following decimal numbers in both twos complement and biased

representation using 8 bits and 12 bits:



(a) 70

(b) – 31



8 BITS



7010 = 0100 01102 (“normal”/unsigned binary)

3110 = 0001 11112



Two’s complement:

7010 = 0100 01102 (same as “normal”/unsigned binary)

-3110 = 1110 00012 (invert binary +31 and add 1)



Biased representation

7010 = 7010 + 12710 (bias = (2
n-1

– 1) = 2
7
– 1 = 127)

= 19710 = 1100 01012

-3110 = -3110 + 12710

= 9610 = 0110 00002



12 BITS



7010 = 0000 0100 01102 (“normal”/unsigned binary)

3110 = 0000 0001 11112



Two’s complement:

7010 = 0000 0100 01102 (same as “normal”/unsigned binary)

-3110 = 1111 1110 00012 (invert binary +31 and add 1 OR from 8 bits answer,

padded with leading 1s to make 12 bits)



Biased representation

7010 = 7010 + 204710 (bias = (2
n-1

– 1) = 2
11

– 1 = 2047)

= 211710 = 1000 0100 01012

-3110 = -3110 + 204710

= 201610 = 0111 1110 00002

Similer Documents