Everything About Cache Memory That Should You Know

Everything About Cache Memory That Should You Know


Welcome friends, Kuch previous articles mein Maine RAM, ROM aur primary and secondary storages ke bare mein likha tha like - RAM kya hain, ROM kya hain etc... But in dono ke alawa bhi ek primary memory aur hote hain jis ko 'Cache Memory' kaha jata hain. Iss article mein aapko cache memory se related sabhe tarah ki information dange like cache memory kya hain, Iss ke use kya hain aur cache memory ke types etc...

What is Cache Memory ?
Computer mein high capicaty aur long term data store karne ke liye secondary storage devices (hard disk drive aur SSD) ka use hota hain. Aur RAm ka use program ko temporary store karne mein kiya jata hain jis se cpu ko direct access milte hain. RAM bhot fast memory hote hain aur access time bhot aacha hota hain. Lakin computer ke best performance ke liye yeah storages sufficient nahi hain. Iss liye computer ki aachi performance ke liye cache memory ka use kiya jata hain. Cache memory processer mein he lagi hote hain.

Cache memory ek bhot he high speed memory hain jo size mein toh chooti hote hain but speed mein extremrly fast hote hain. CPU, main memory (RAM) se bhi fast iss memory ko access kar sakta hain. Iss se CPU ki performance improve hote hain.

Cache memory ko sirf aur sirf CPU he access kar sakta hian. Cache memory us program aur data ko store karte hain jo bar - bar use hota hain. Toh jab bhi CPU ko data ki jaroorat hote hain tab ushe bhot he jaldi data mil jata hain. Agar CPU ko cache memory mein data mil jata hain toh CPU ko RAM access karne ki jaroorat nahi padti. RAM aur CPU ke bech yeah process hone se computer aache se perform kar pata hain.

Types of Cache Memory :-
Cache memory ko mostly 3 levels mein divided kiya gaya hain jinko L1, L2 aur L3 kaha jata hain. Sabhe levels ke memory range alag - alag hain aur speed mein bhi difference hain.

L1: Yeah cache memory ke pehle level hain jis ko L1 cache ya Level 1 cache kaha jata hain. L1 type ki memory ki size bhot kam hote lakin speed sabse fast hote hain. Yeah multi-cores ke liye individually memory hote hain matlab agar CPU mein 8 cores hain toh sabhe 8 cores ke liye alag - alag L1 memory hogi. L1 cache, CPU mein he hote hain isliye iss ke speed CPU ki speed ke barabar hote hain. L1 cache ki size range 2KB se 64KB hote hain.

Modern CPU mein L1 cache memory 2 parts mein divided hote hain - data section (L1d) aur instruction section (L1i). L1d mein data store hota hain aur L1i mein instructions store hote hain.
Royalty Free Image By pexels.com
L2: Iss memory ko Level 2 cache ya L2 cache kaha jata hain. Yeah memory CPU ke andar ya bahar ho sakte hain. Agar L2 memory CPU se bahar hote hain toh iss he high-speed bus se connect kiya jata hain. L2 memory bhi sabhe cores ke liye individually hote hain. L2 memory ki size L1 ke compare mein jyada hote hain but speed L1 se slow hote hain. L2 cache ki memory range 256KB se 512KB  tak hote hain.

L3: Iss memory ko Level 3 cache ya L3 cache memory kaha jata hain. Yeah memory sabhe processors mein nahi hote hain, sirf kuch high-end processors mein hote hain. Yeah memory sabhe cores mein shared hote hain. Iss ke memory range 1MB se 8MB tak hote hain. Yeah L1 aur L2 se slow hote hain lakin main memory (RAM) se bhot jyada fast hote hain.

What is Cache Hit ?
Jab processor ko RAM mein location read aur write karna hota hain, toh pehle procesor cache entries ko check karta hain.

Agar processor ko memory location cache mein mil jate hain toh iss ko 'Cache hit' kahate hain aur data cache se read ho jata hain.

Agar processor ko cache mein data nahi milta hain toh isshe 'Cache miss' kahate hain. Phir data main memory se copy hota hain.

Cache memory ki performance ko 'Hit Ratio' mein measure kiya jata hain jis ka formula hain:

Hit Ratio = Hit / (hit + miss) = number of hits / total access
Royalty Free Image By pexels.com

Advantages of Cache Memory :-
  • Cache Memory, main memory se bhot fast hote hain.
  • Cache memory ka access time bhot kam hota hain.
  • Iss mein woh data store hota hain jo ham bar - bar use karte hain.

Disadvantages of Cache Memory :-
  • Yeah memory bhot mahengi hote hain.
  • Iss ke capacity bhi bhot kam hote hain.

Other Posts :-




Post a Comment