Hardware Secrets
Home | Audio | Case | Cooling | CPU | Input | Memory | Mobile | Motherboard | Networking | Power | Storage | Video | Other
Content
Articles
First Look
News
Reviews
Tutorials
Main Menu
About Us
Compare Prices
Datasheets
Dictionary
Download
Drivers
Forums
Gabriel's Blog
Links
Manufacturer Finder
Newsletter
On The Web
RSS Feed
Test Your Skills
Newsletter
Subscribe today!
Search




Recommended Book
The Winn L. Rosch Hardware Bible (6th Edition)
By Winn L Rosch
Que
Price: $1.62

Home » CPU
How a CPU Works
Author: Gabriel Torres
Type: Tutorials Last Updated: September 26, 2005
Page: 6 of 9
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.

Unconditional Branching
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.

Conditional Branching
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 (5)

Related Content
  • Pentium 4 Thermal Throttle
  • Sempron vs. Athlon XP
  • Maximum CPU Temperature
  • Sempron 3000+ and Celeron D 331 Review
  • How to Upgrade Your CPU

  • Compare Prices for CPUPowered by Shopping.com
    Intel Core?2 Quad Q6600, 2.40 GHz (BX80562Q6600) Boxed Processor
    Processor, 8 MB Cache Memory, For Socket LGA775, 1066 MHz Bus Speed, For PC Platforms
    Read full description...

    Read 2 Epinions reviews
    $177 - $330 Compare Prices
    Intel Core 2 Duo E6850, 3 GHz (BX80557E6850) Boxed Processor
    Processor, 3 GHz, 1333 MHz Bus Speed, 4 MB Cache Memory, For Socket LGA775, For PC Platforms
    Read full description...
    $183 - $221 Compare Prices
    Intel Core2? Quad Q6600, 2.40 GHz Q6600 (HH80562PH0568M) OEM / Unboxed Processor
    Processor, 2.4 GHz, 1066 MHz Bus Speed, 8 MB Cache Memory, For Socket LGA775, For PC Platforms
    Read full description...
    $200 - $200 Compare Prices
    AMD Athlon? 64 3800 3800+, 2 GHz AMD Processor in a Box (PIB)
    Processor, 1 MB Cache Memory, For Socket AM2, 1000 MHz Bus Speed, For PC Platforms
    Read full description...
    $64 - $103 Compare Prices
    AMD Athlon? 64 3000+, 2.0 GHz (ada3000box) AMD Processor in a Box (PIB)
    Processor, 1 MB Cache Memory, For Socket 754, 1600 MHz Bus Speed, For PC Platforms
    Read full description...

    Read 3 Epinions reviews
    $105 - $105 Compare Prices

    RSSLatest News
    Danamics Liquid-metal CPU Cooler
    July 18, 2008 - 8:26 AM
    Sapphire Launches 1 GB GDDR3 Radeon HD 4850
    July 17, 2008 - 7:40 AM
    Cooler Master Geminii S
    July 16, 2008 - 10:48 AM
    Intel Unveils Centrino 2 Platform
    July 15, 2008 - 10:02 AM
    PowerColor Launches 2 GB GDDR3 Radeon HD 4850
    July 14, 2008 - 8:57 AM
    Albatron Launches GeForce 8 PCI Cards
    July 11, 2008 - 11:55 AM
    OCZ Elixir Gaming Keyboard
    July 11, 2008 - 9:05 AM
    OCZ Launches DDR2-1000 nVidia SLI-Ready
    July 10, 2008 - 8:20 AM
    ASUS Launches ROG Rampage Extreme Motherboard
    July 10, 2008 - 8:12 AM
    Corsair Launches DDR3-2133
    July 9, 2008 - 10:22 AM
    .:: More News ::.

    RSSLatest Content
    160 GB Hard Disk Drive Round-Up
    Everything You Need to Know About Dual Channel
    Flux Capacitor
    iPod Nano Third Gen Review
    Sunbeamtech 9-Bay Acrylic Case Review
    Lian Li Tyr PC-X500 Case Review
    Sapphire PI-AM2RS780G Motherboard Review
    ECS GF8200A Black Series Motherboard Review
    Raidmax Iceberg Case Review
    Honda MP3 Player Review
    Celeron, Pentium Dual Core and Athlon X2: Which One is the Best USD 70 CPU?
    DirectX Versions
    All Phenom Models
    Everything You Need to Know About Serial ATA
    Sapphire HD 4850 Video Card Review

    Our Most Popular Articles
    Maximum CPU Temperature
    735,825 views
    nVidia Chips Comparison Table
    458,228 views
    AMD ATI Chips Comparison Table
    411,388 views
    ATI Radeon X1300 Pro Review
    404,830 views
    ATI Radeon X1600 XT Review
    399,940 views
    How to Find Out Your Motherboard Manufacturer and Model
    356,750 views
    Connecting Two PCs Using a USB-USB Cable
    324,680 views
    How To Correctly Apply Thermal Grease
    309,832 views
    Sempron vs. Athlon XP
    274,015 views
    Sempron 3400+ Review
    263,679 views

    Latest Threads in Our Forums
    2.1 PC speakers in car
    by rajani1983
    How often is thermal paste replacement?
    by paulh902
    Zalman ZM360B-APS and 8800 GT
    by Pvt.Ryan
    motherboard problem plzzz help me
    by ksmitty
    Danamics Liquid-metal CPU Cooler
    by Hardware Secrets Team
    Everything You Need to Know About DDR Dual Channel
    by Eofu
    Buying a case
    by Heterodoxstudent
    9800GX2 on a PCI-E 1.0 MoBo
    by MachineMessiah
    P5K premium or P5kC
    by KoRn
    Cases: How to Avoid Overheating
    by HairyRodent
    .:: Visit Our Forums ::.

    © 2004-8, Hardware Secrets, LLC. All rights reserved.
    Advertising | Legal Information | Privacy Policy
    All times are Pacific Standard Time (PST, GMT -08:00)