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: $0.94

Home » CPU
How a CPU Works
Author: Gabriel Torres
Type: Tutorials Last Updated: September 26, 2005
Page: 7 of 9
$ Check REAL-TIME pricing for Intel Core 2 Duo Retail Boxed E7200 Processor - 2.53GHz, 3MB Cache, 1066MHz FSB, 45nm Wolfdale E700 Boxed Processor $
TigerDirect.com: $119.99 Newegg.com: $119.99
Dell: $159.99 CompUSA.com: $119.99
ZipZoomfly.com: $119.00 Buy: $126.25

Processing Instructions

The fetch unit is in charge of loading instructions from memory. First, it will look if the instruction required by the CPU is in the L1 instruction cache. If it is not, it goes to the L2 memory cache. If the instruction is also not there, then it has to directly load from the slow system RAM memory.

When you turn on your PC all the caches are empty, of course, but as the system starts loading the operating system, the CPU starts processing the first instructions loaded from the hard drive, and the cache controller starts loading the caches, and the show begins.

After the fetch unit grabbed the instruction required by the CPU to be processed, it sends it to the decode unit.

The decode unit will then figure out what that particular instruction does. It does that by consulting a ROM memory that exists inside the CPU, called microcode. Each instruction that a given CPU understands has its own microcode. The microcode will “teach” the CPU what to do. It is like a step-by-step guide to every instruction. If the instruction loaded is, for example, add a+b, its microcode will tell the decode unit that it needs two parameters, a and b. The decode unit will then request the fetch unit to grab the data present in the next two memory positions, which fit the values for a and b. After the decode unit “translated” the instruction and grabbed all required data to execute the instruction, it will pass all data and the “step-by-step cookbook” on how to execute that instruction to the execute unit.

The execute unit will finally execute the instruction. On modern CPUs you will find more than one execution unit working in parallel. This is done in order to increase the processor performance. For example, a CPU with six execution units can execute six instructions in parallel, so in theory it could achieve the same performance of six processors with just one execution unit. This kind of architecture is called superscalar architecture.

Usually modern CPUs don’t have several identical execution units; they have execution units specialized in one kind of instructions. The best example is the FPU, Float Point Unit, which is in charge of executing complex math instructions. Usually between the decode unit and the execution unit there is an unit (called dispatch or schedule unit) in charge of sending the instruction to the correct execution unit, i.e. if the instruction is a math instruction it will send it to the FPU and not to one “generic” execution unit. By the way, “generic” execution units are called ALU, Arithmetic and Logic Unit.

Finally, when the processing is over, the result is sent to the L1 data cache. Continuing our add a+b example, the result would be sent to the L1 data cache. This result can be then sent back to RAM memory or to another place, as the video card, for example. But this will depend on the next instruction that is going to be processed next (the next instruction could be “print the result on the screen”).

Another interesting feature that all microprocessors have for a long time is called “pipeline”, which is the capability of having several different instructions at different stages of the CPU at the same time.

After the fetch unit sent the instruction to the decode unit, it will be idle, right? So, how about instead of doing nothing, put the fetch unit to grab the next instruction? When the first instruction goes to the execution unit, the fetch unit can send the second instruction to the decode unit and grab the third instruction, and so on.

In a modern CPU with an 11-stage pipeline (stage is another name for each unit of the CPU), it will probably have 11 instructions inside it at the same time almost all the time. In fact, since all modern CPUs have a superscalar architecture, the number of instructions simultaneously inside the CPU will be even higher.

Also, for an 11-stage pipeline CPU, an instruction to be fully executed will have to pass thru 11 units. The higher the number of stages, the higher the time an instruction will delay to be fully executed. On the other hand, keep in mind that because of this concept several instructions can be running inside the CPU at the same time. The very first instruction loaded by the CPU can delay 11 steps to get out of it, but once it goes out, the second instruction will get out right after it (and not another 11 steps later).

There are several other tricks used by modern CPUs to increase performance. We will explain two of them, out-of-order execution (OOO) and speculative execution.

Pages (9): « 1 2 3 4 5 6 [7] 8 9 »
Print Version | Send to Friend | | Bookmark Article | Comments (5)

Related Content
  • Athlon 64 Overclocking
  • Dual Core AMD Processors
  • Maximum CPU Temperature
  • Sempron 3000+ and Celeron D 331 Review
  • How to Upgrade Your CPU

  • Recommended Deals
    AMD Opteron 180, 2.4 GHz (OSA180DAA6CD) Processor


    CompUSA.com: $169.99 TigerDirect.com: $169.99
    Gstechco: $48.38

    RSSLatest News
    Exceleram Launches Five New Memory Kits
    October 10, 2008 - 10:57 AM PST
    Kingston Launches 32 GB DataTraveler Flash Memory
    October 9, 2008 - 10:13 AM PST
    Gelid Launches Silent Spirit CPU Cooler
    October 8, 2008 - 11:18 AM PST
    Antec Skeleton Case
    October 7, 2008 - 10:42 AM PST
    Lexar Media Launches Crucial Ballistix Tracer DDR3-1333
    October 7, 2008 - 10:11 AM PST
    Elpida Develops 65-nm Memory Chips
    October 6, 2008 - 11:10 AM PST
    Transcend Launches T5 Flash Memory
    October 3, 2008 - 11:50 AM PST
    Thermaltake Announces BigTyp14 Pro CPU Cooler
    October 3, 2008 - 11:28 AM PST
    A-Data Announces Triple-Channel DDR3 kits for Core i7 Processors
    October 3, 2008 - 11:17 AM PST
    EVGA Launches nForce 790i SLI FTW Mainboard
    October 3, 2008 - 11:07 AM PST
    .:: More News ::.

    RSSLatest Content
    500 GB Hard Disk Drive Round-Up
    Anatomy of the Playstation 3
    AMD ATI Chips Comparison Table
    Bgears b-Envi Case Review
    Everything You Need to Know About Digital Cameras
    Kingwin Mach 1 ABT-700MA1S 700 W Power Supply Review
    Thermaltake V9 Case Review
    OCZ Dominatrix Gaming Mouse Review
    Rosewill Wind Ryder RZLS142-AP Case Review
    AeroCool AeroRacer Pro Case Review
    iPod Touch 2nd Generation Review
    Olympus SP-570UZ Digital Camera Review
    Zalman ZM600-HP 600 W Power Supply Review
    Tagan A+ Curbic Case Review
    Everything You Need to Know About The Motherboard Voltage Regulator Circuit

    Our Most Popular Articles
    Maximum CPU Temperature
    794,987 views
    nVidia Chips Comparison Table
    494,778 views
    AMD ATI Chips Comparison Table
    437,367 views
    ATI Radeon X1300 Pro Review
    420,683 views
    ATI Radeon X1600 XT Review
    414,740 views
    How to Find Out Your Motherboard Manufacturer and Model
    406,106 views
    Connecting Two PCs Using a USB-USB Cable
    364,474 views
    How To Correctly Apply Thermal Grease
    348,988 views
    Sempron vs. Athlon XP
    284,392 views
    Sempron 3400+ Review
    275,325 views

    Latest Threads in Our Forums
    500 GB Hard Disk Drive Round-Up
    by Hardware Secrets Team
    Pentium M 1.6 Ghz Laptop Pin Mod
    by Gabriel Torres
    ATHLON x2 6000 or C2D E8400??
    by Gabriel Torres
    Exceleram Launches Five New Memory Kits
    by Hardware Secrets Team
    Corsair VX450W Power Supply Review
    by Gabriel Torres
    Anatomy of the Playstation 3
    by Hardware Secrets Team
    Kingston Launches 32 GB DataTraveler Flash Memory
    by Hardware Secrets Team
    Powerful Anti-virus
    by ashok520
    Gelid Launches Silent Spirit CPU Cooler
    by Hardware Secrets Team
    what mobo and PSU pls..
    by Gabriel Torres
    .:: 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)