You are on page 1of 4
Sa registers are the Swallesh of at, their sfa34er and their cord will be exprensive.- ~ Secondary memory is whe lagesd, 7°50 the access Sime + bud the cost ail) be lers thom the other mbmoryies, ae F in Suomery, 4 the size incase, the nccess: Hime also p increases bat the cost decreastes. This is the main Valwe oF wSing memory heirarchy instead OF jast heaving Single memory. @ sum=0 ; <—Tewporal locality. Zs For Cito; f tn ite) 44 Sum 2 @ Ci] ;<———__ spatial Locality C in the array “Tempora\——_ Cacalily Feturn Sum Pe. . ee ' 7 + ‘ = ty + TH begining of the programm Sum iS zero ther awrai a place in ain Memory iS imstalized Jo » Sum eo, 45 @ variable the program accers o . +n BE 40 fhee Samet Sum location’of: main mam — becose of that that This is a temporal (& fie Te For loop, the program access do vay Cad, the array elgmenS-are © hans4+Lich.x no) h-+1=20h- [Block 2| Block 4| Total Access bime= 20m » access tle @ tenet preseeting un cashe, ce nedeftom} toe019...Tolal nes 25s tiene _f Block 2 already present inacached, nd directly, Total acces dime data in ans." = _ = can EL con Ndtt Mand “in coshe, s6-ms ” ____reques +’ ttt memory oe tate go'ns,— Oo: ouk_ of 30 mtS$- Memory accesses Gre © rissed, i —— lo ore hit.) For 20 misses, the to fal fie required is — Bi Cao misses » (roms Pommemary access +25, = kaonss 's a jo hits, fofal ime tive regurred fs — lo hits x 2ns = Ronse. | 8. _Toto| Fine—hs—both case Cashe comd Te 4a} He required fo all 30: memory cee 4gons tMons = 4bons MiSs => Place in Seto; igs =) Place im Set pty Poso. — Miss => Place Hit Hie im Se¢0 y Pos J so => Access in SC+O, Pos | => Access.in, Ser ©, PosO oo —Hit => Access im Set 1, Posio. 1s

You might also like