Cache block yog dab tsi?
Cache block yog dab tsi?

Video: Cache block yog dab tsi?

Video: Cache block yog dab tsi?
Video: Yog hmoov dab tsi - Gao Nou Kue ft. Mang Vang (Official Music Video) New song 2020 2024, Tej zaum
Anonim

cache thaiv - Lub hauv paus unit rau cache khaws cia. Tej zaum yuav muaj ntau bytes / lo lus ntawm cov ntaub ntawv. cache kab - Ib yam li cache thaiv . tag - Tus cim tshwj xeeb rau ib pawg ntawm cov ntaub ntawv. Vim hais tias txawv cheeb tsam ntawm lub cim xeeb tej zaum yuav mapped rau hauv ib thaiv , tag yog siv los sib txawv ntawm lawv.

Hauv qhov no, yuav ua li cas thaiv qhov thaiv hauv lub cache?

Thaum CPU sim nyeem los ntawm lub cim xeeb, qhov chaw nyob yuav raug xa mus rau a cache tus tswj. - Qhov qis tshaj k cov khoom ntawm qhov chaw nyob yuav ntsuas a thaiv hauv cache . - Yog tias thaiv yog siv tau thiab lub cim npe sib tw rau sab sauv (m - k) cov khoom ntawm m-ntsis chaw nyob, ces cov ntaub ntawv yuav raug xa mus rau CPU.

Tsis tas li ntawd, cache block loj npaum li cas hauv cov lus? 1 Teb. Hauv qhov piv txwv qhov cache block loj yog 32 bytes , i.e., byte-addressing yog siv; nrog cov lus plaub-byte, qhov no yog 8 lo lus.

Tsis tas li ntawd, muaj pes tsawg blocks nyob rau hauv ib lub cache?

Teb. Vim tias muaj 16 bytes hauv a cache thaiv , OFFSET teb yuav tsum muaj 4 khoom (24 = 16). Txhawm rau txiav txim siab tus lej ntawm cov khoom hauv SET teb, peb yuav tsum txiav txim siab tus lej ntawm cov teeb tsa. Txhua set muaj 2 cache blocks (2-txoj kev associative) yog li ib txheej muaj 32 bytes.

Dab tsi yog cache associativity?

Ib tug tag nrho associative cache tso cai cov ntaub ntawv khaws cia rau hauv ib qho twg cache thaiv, es tsis txhob yuam txhua qhov chaw nco mus rau hauv ib qho tshwj xeeb thaiv. - Thaum cov ntaub ntawv tau txais los ntawm lub cim xeeb, nws tuaj yeem muab tso rau hauv ib qho thaiv tsis siv ntawm qhov cache.

Pom zoo: