Computer Architecture HW 5 Answers (CH 7)

4
 p. 46 2- 46 9 1 . C al cu late t h e over al l sp eedu p of a syst em t h at sp en ds 65 % of it s t i me onI/O w it h a d i sk u p gr ad e t h at providesfor 50 % gr eat er t h r ou gh pu t .  A ns. 1 .28or 2 8 % (S = 1 .2 76 6; f = 0 .65; k = 1 . 5 ) S=1/[(1-f ) +( f / k ]] S= over al l sys t em speed u p F = f r act i on of w or k perf orm ance by faster compo n en t K=s pee du pof new c om ponent 5 . S u ppose t h at you are desi gn i n g a game sys t em t h at r espo n d s t o pl ayer s' p r essi n g b u t t on s a n dt og gl i n g j oyst icks. T h e p rotot yp e sy st em is f a i li n g to react i n t i me t o t h ese i n p u t even t s, causi n gn oti ceab lean n oyan cetot h egamers. You h avecal cu l atedt h at you n eedtoi m p r ove overal l syst em perf orm an ce by 5 0 % . T h is i s t o say t h at t h e en t ire syst em n eeds t o b e 5 0 % faster t h anit i s n ow. You k n ow t h at t hese I/O event s accou n t f or 75 % of t h e syst em  w o rkloa d . Y ou g u r e t hat a n e w I / O interfa c e c ardshou l d d o t h e t r ic k . I f t h e s y stem' s exi st i n g I /Ocard ru n s at 1 0 k H z ( p u l ses p er secon d ), w h at is t h e speedof t h e I /O card t h at  y o u needtoo r de r from t h e s u p p lie r ?  A ns.  A t leas t 18kH z . (S n eeds to b e 1.5; f =0.75; k = 1.8) 8. S u ppose t h e d ayt i me p r ocessi n g l oad con si sts of 6 0% CPUact i vit y an d40 % d i skact i vit y .  Y o u r c u st o mers a r e compl a inin g t h a t t he syst e m i s s l o w . Aft e r doing s o me resea r c h , y ou h ave l earned t h at you can u p grad e you r disks for $8 , 00 0 t o mak e t h em 2 .5 t i mes as f ast as t h ey are cu r ren t l y . You h ave al so l earnedt h at youcan u p gr ad e you r C P U t o mak e it 1.4as fast f or $ 5 , 0 0 0 . a. Wh i ch w ou l d you ch oose t o yieldt h e best p er f orm an ce i m provement for t h e l east am ount of mone y ?  b . Wh i c h o p t i o n w ould y o u c h o o se i f y o u d o n't ca r e abo u t t h e mon e y , b u t w ant a f a s t er sy st em ? c. Wh at is t h e break-ev en p oi n t for t h e u p gr ad es? T h at i s, w h at p ri ce would w e need t o ch arge f or t h e C P U (or t h e disk – ch an ge on l y on e) so t h e r esu l t w as t h e same cost p er 1 % i n cr ease f or bot h ?  A n s . F r action of w or k: 60 % C PU , 40 % disk. S CPU=1 / (( 1 -f) + ( f / k )) =1/(( 1 -0.60 ) + ( 0 .60 / 1.4) ) = 1 . 2 069 or 2 0 . 6 9 % S D I SK = 1 / (( 1 -f ) +(f / k ) ) = 1 / (( 1 - 0 . 4 0 ) + ( 0 . 4 0 /2.5)) = 1 . 3 1 5 8 or 3 1.58 %

description

Homework

Transcript of Computer Architecture HW 5 Answers (CH 7)

p. 462-469

1. Calculate the overall speedup of a system that spends 65% of its time on I/O with a disk

upgrade that provides for 50% greater throughput.

Ans.

1.28 or 28% (S = 1.2766; f = 0.65; k = 1.5)S = 1 / [(1-f) + (f/k]]

S = overall system speedupF = fraction of work performance by faster component

K = speedup of new component

5. Suppose that you are designing a game system that responds to players' pressing buttons

and toggling joysticks. The prototype system is failing to react in time to these input events,

causing noticeable annoyance to the gamers. You have calculated that you need to improve

overall system performance by 50%. This is to say that the entire system needs to be 50%

faster than it is now. You know that these I/O events account for 75% of the system

workload. You figure that a new I/O interface card should do the trick. If the system's

existing I/O card runs at 10 kHz (pulses per second), what is the speed of the I/O card that

you need to order from the supplier?

Ans.

At least 18kHz. (S needs to be 1.5; f = 0.75; k = 1.8)

8. Suppose the daytime processing load consists of 60% CPU activity and 40% disk activity.

Your customers are complaining that the system is slow. After doing some research, you

have learned that you can upgrade your disks for $8,000 to make them 2.5 times as fast as

they are currently. You have also learned that you can upgrade your CPU to make it 1.4 as

fast for $5,000.

a. Which would you choose to yield the best performance improvement for the least

amount of money?

b. Which option would you choose if you don't care about the money, but want a faster

system?

c. What is the break-even point for the upgrades? That is, what price would we need to

charge for the CPU (or the disk change only one) so the result was the same cost per

1% increase for both?

Ans.

Fraction of work: 60% CPU, 40% disk.

SCPU = 1/((1-f)+(f/k)) = 1/((1-0.60)+(0.60/1.4)) = 1.2069 or 20.69%

SDISK= 1/((1-f)+(f/k)) = 1/((1-0.40)+(0.40/2.5)) = 1.3158 or 31.58%

a. Choose the CPU upgrade:

CPU = $5000/20.69% = $241.66 per 1% increase in performance

Disk = $8000/31.58% = $253.32 per 1% increase in performance

b. The disk option gives a better performance improvement.

c. We want the price per 1% to be the same. If we change the CPU price, we have X/20.69

= 253.32, and X= $5241. This means if the CPU costs $5241, we break even on cost per

1% improvement. If we change the price of the disk, we have Y/31.58 = 241.66, Y=

7631.

10. Amdahl's Law is as applicable to software as it is to hardware. An oft-cited programming

truism states that a program spends 90% of its time executing 10% of its code. Thus,

tuning a small amount of program code can often time have an enormous affect on the

overall performance of a software product. Determine the overall system speedup if:

a. 90% of a program is made to run 10 times as fast (900% faster).

b. 80% of a program is made to run 20% faster.

Ans.

a. S = 5.26 (425%) (f = 0.9; k = 10)

b. S = 1.15 (15%) (f = 0.8; k = 1.2)

13. A generic DMA (Direct Memory Access) controller consists of the following components:

Address generator

Address bus interface

Data bus interface

Bus requestor Interrupt signal circuits

Local peripheral controller.

The local peripheral controller is the circuitry that the DMA uses to select among the

peripherals connected to it. This circuit is activated right after the bus is requested. What is

the purpose of each of the other components listed above and when are they active? (Use

Figure 7.6 as a guide.)

Ans.

1. The address generator is the second component (in our list) activated. (The first is

the interrupt signal circuits.) The address generator determines which address lines

need to be activated to effect the transfer.

2. The address bus interface is used by the address generator to place the source or

destination address on the address bus. It is the fourth component activated.

3. The data bus interface is the fifth component activated. It receives the bytes that the

DMA pulls from memory or a peripheral device.

4. The bus requester is the third component activated. It places a control signal on the

"Bus request" control line if the bus is busy. The bus requester then waits for a "bus

grant" signal before signaling the DMA to commence the transfer. It also raises the

bus grant signal during another arbitration exchange.

5. The interrupt signal circuits pass and receive interrupt signals to the CPU and

peripherals. It is the first and last DMA component set activated during a transfer.

28. Suppose a disk drive has the following characteristics:

4 surfaces

1024 tracks per surface

128 sectors per track

512 bytes/sector

Track-to-track seek time of 5 milliseconds

Rotational speed of 5000 RPM.

a. What is the capacity of the drive?

b. What is the access time?

Ans.

a. 4 surfaces x 1,024 tracks per surface x 128 sectors per track x 512 bytes/sector =

4*1024*128*512/(2^20 bytes/MB) = 256MB.

b. Rotational delay = (60 seconds/5000 rpm) * (1000ms/second)]/2 = 360 ms. So 360 + 5ms seek time = 365 msP. 494 Ex. 6

6. Create a Huffman tree and assign Huffman codes for the Star Bright rhyme used in

Section 7A.3. Use for whitespace instead of underscores.

One tree and its corresponding code: (See diagram)Character Code Character Code

01 E 11111

T 100 Y 101000

H 001 N 101010

I 110 O 101011

S 1110 M 101101

G 0000 V 1010010

R 0001 L 1010011

W 0111 B 1011000

A 11110 F 1011001

_________________________________________________________