| How a CPU Works |
|
|
$ Check REAL-TIME pricing for Intel Core 2 Quad Q9550 Processor BX80569Q9550 - 2.83GHz 12MB Cache 1333MHz FSB Yorkfield Quad-Core Retail Socket 775 with Fan $ |
|
|
|
|
|
| Branching |
As we mentioned several times, one of the main problems for the CPU is having too many cache misses, because the fetch unit must access directly the slow RAM memory, thus slowing down the system.
Usually the use of the memory cache avoids this a lot, but there is one typical situation where the cache controller will miss: branches. If in the middle of the program there is an instruction called JMP (“jump” or “go to”) sending the program to a completely different memory position, this new position won’t be loaded in the L2 memory cache, making the fetch unit to go get that position directly in the RAM memory. In order to solve this issue, the cache controller of modern CPUs analyze the memory block it loaded and whenever it finds a JMP instruction in there it will load the memory block for that position in the L2 memory cache before the CPU reaches that JMP instruction.
 click to enlarge Figure 8: Unconditional branching situation.
This is pretty easy to implement, the problem is when the program has a conditional branching, i.e. the address the program should go to depends on a condition not yet known. For example, if a =< b go to address 1, or if a > b go to address 2. We illustrate this example on Figure 9. This would make a cache miss, because the values of a and b are unknown and the cache controller would be looking only for JMP-like instructions. The solution: the cache controller loads both conditions into the memory cache. Later, when the CPU processes the branching instruction, it will simply discard the one that wasn’t chosen. It is better to load the memory cache with unnecessary data than directly accessing the RAM memory.
 click to enlarge Figure 9: Conditional branching situation.
|
| Pages (9): « 1 2 3 4 5 [6] 7 8 9 » |
| Print Version | Send to Friend |
|
Bookmark Article
| Comments (8)
|
|
Recommended Deal |
 | Amazon.com Corsair CMPSU-450VX 450-Watt VX Series 80 Plus Certified Power Supply compatible with Core i7 and i5 Electronics
|
|
Latest News |
November 20, 2009 - 12:37 PM PST |
November 19, 2009 - 7:30 AM PST |
November 18, 2009 - 11:30 AM PST |
November 18, 2009 - 10:18 AM PST |
November 17, 2009 - 1:39 PM PST |
November 17, 2009 - 1:06 PM PST |
November 17, 2009 - 10:18 AM PST |
November 16, 2009 - 11:46 AM PST |
November 13, 2009 - 12:51 PM PST |
November 11, 2009 - 3:31 PM PST |
| .:: More News ::. |
|
Latest Content |
|
|
| Our Most Popular Articles |
1,078,418 views
|
706,390 views
|
679,241 views
|
593,547 views
|
562,557 views
|
560,204 views
|
487,968 views
|
477,130 views
|
394,590 views
|
338,545 views
|
|
| Latest Threads in Our Forums |
by Merman |
by Merman |
by Hardware Secrets Team |
by Trevorrross |
by need2know |
by Olle P |
by Sherry |
by Hardware Secrets Team |
by 6dracing |
by tomahawk 1705 |
| .:: Visit Our Forums ::. |
|
|