C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 05-07-2007, 08:09 PM   #1
essence of digital
 
xddxogm3's Avatar
 
Join Date: Sep 2003
Posts: 577
cache tag calculation

how would you calculate the cache tag?
is there a way to break a binary address into it's separate parts?
i know that we the block address is calculated by dividing the byte address by the block size. i know the set index is calculated by modulating the block address by the total number of sets. but how do you calculate the cache tag?
__________________
"Hence to fight and conquer in all your battles is not supreme excellence;
supreme excellence consists in breaking the enemy's resistance without fighting."
Art of War Sun Tzu
xddxogm3 is offline   Reply With Quote
Old 05-07-2007, 11:01 PM   #2
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,657
Treat the address as an unsigned long say, then use bitwise operators to mask off certain groups of bits.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

Salem is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with cache simulator! dtogers123 C Programming 3 04-30-2008 06:18 PM
ideas requested for a CACHE. bean66 C Programming 2 02-21-2008 11:01 AM
Resource manager tree Bubba Game Programming 23 09-07-2007 10:27 PM
added start menu crashes game avgprogamerjoe Game Programming 6 08-29-2007 01:30 PM
cache miss/hit xddxogm3 C++ Programming 3 05-07-2007 06:51 PM


All times are GMT -6. The time now is 05:00 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22