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




Recommended
The Winn L. Rosch Hardware Bible, 6th Edition (2 Vol. Set)
The Winn L. Rosch Hardware Bible, 6th Edition (2 Vol. Set), by Winn L Rosch (Que), starting at $2.68
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 Amazon.com ASUS M3A78-EM AM2 AMD 780G DDR2-1066 ATX Motherboard Electronics $.
Amazon: $74.25 Newegg: $69.99

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 (8)

Related Content
  • Pentium 4 Thermal Throttle
  • Dual Core AMD Processors
  • Intel Dual Core Technology
  • Maximum CPU Temperature
  • How to Upgrade Your CPU

  • Recommended Deal.
    Phenom II Black 550 Phenom153 Edition CPU 3.1GHzAMD Phenom II X2 550 Black Edition Dual Core Processor - 3.10GHz Socket AM3 6MB Cache 2000MHz 4000 MT/s Retail Unlocked Multiplier HDZ550WFGIBOX


    CircuitCity: $109.99 CDW: $135.99
    Directron: $104.99 Newegg: $102.00

    RSSLatest News
    Enermax Unveils Aurora Micro Wireless Keyboard
    November 4, 2009 - 3:43 PM PST
    Noctua Intros NH-D14 Premium CPU Cooler
    November 3, 2009 - 8:14 PM PST
    Transcend Unveils DDR3-1333 Memory Kits
    November 3, 2009 - 7:57 PM PST
    EVGA Launches GeForce GTX 275 CO-OP PhysX Edition
    November 3, 2009 - 7:51 PM PST
    Akasa Launches Freedom Xone Mid-tower Case
    November 2, 2009 - 6:05 PM PST
    Enermax Announces NAPPA Series of External HDD Enclosure
    November 2, 2009 - 5:54 PM PST
    DFI Launches LANParty BI P43-T34 Motherboard
    November 2, 2009 - 5:33 PM PST
    Thermaltake Debuts Element V Full-tower Case
    October 30, 2009 - 3:29 PM PST
    New SSD Series from A-Data
    October 29, 2009 - 7:16 PM PST
    PowerColor Unveils Radeon HD 5870 LCS
    October 29, 2009 - 6:53 PM PST
    .:: More News ::.

    RSSLatest Content
    Can We Trust the 80 Plus Certification?
    NZXT Gamma Case Review
    Patriot Box Office Media Player Review
    ASUS U-75HA 750 W Power Supply Review
    MSI P55-GD80 Motherboard
    Thermaltake Element V Case Review
    Nokia 7705 Twist Cell Phone Review
    Cooler Master Hyper TX3 CPU Cooler Review
    Some Pictures from Our Office
    Antec Two Hundred Case Review
    Corsair TX950W Power Supply Review
    XFX Radeon HD 5770 Video Card Review
    XFX Radeon HD 5750 Video Card Review
    Scythe Big Shuriken CPU Cooler Review
    Athlon II X2 240e and Athlon II X3 435 CPU Review

    Our Most Popular Articles
    Maximum CPU Temperature
    1,068,290 views
    How to Find Out Your Motherboard Manufacturer and Model
    691,685 views
    nVidia Chips Comparison Table
    669,685 views
    Connecting Two PCs Using a USB-USB Cable
    583,499 views
    How To Correctly Apply Thermal Grease
    553,896 views
    AMD ATI Chips Comparison Table
    552,833 views
    ATI Radeon X1300 Pro Review
    485,142 views
    ATI Radeon X1600 XT Review
    474,232 views
    How To Perform a BIOS Upgrade
    387,698 views
    Sempron vs. Athlon XP
    335,979 views

    Latest Threads in Our Forums
    Enermax Unveils Aurora Micro Wireless Keyboard
    by Hardware Secrets Team
    Can We Trust the 80 Plus Certification?
    by Hardware Secrets Team
    Understanding Over Current Protection
    by Gabriel Torres
    EVGA Launches GeForce GTX 275 CO-OP PhysX Edition
    by Gabriel Torres
    Noctua Intros NH-D14 Premium CPU Cooler
    by Gabriel Torres
    My PSU grading system
    by Phaedrus
    Is it possible LCD Monitor leaked by itself ?
    by Olle P
    Burning Problems
    by Olle P
    ASUS U-75HA 750 W Power Supply Review
    by Merman
    Enermax Announces NAPPA Series of External HDD Enclosure
    by Olle P
    .:: Visit Our Forums ::.


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