What are the main parts of the cpu

What are the main parts of the cpu

What is CPU: Components, Parts of CPU and Their Functions!!

CPU Definition

Importance of CPU

Parts of CPU

In this section, we will spread light on the all different CPU’s internal hardware parts names. Describe below each one.

Internal Components of CPU (Central Processing Unit) and their Functions

Memory Unit

Memory unit is the main components of CPU, because its main objective is to store all instructions, and pass them to other component of CPU (Control unit).

In the computer industries, computer memory is spited into two main categories such as primary and secondary memory. Entire performance, computing power, and execution speed of computer memory is totally depends upon its design layout and types like as ( SRAM or DRAM ).

After processing of all instructions by CPU, memory unit helps to store the generated output, and finally it is moved to output devices.

Control Unit

Main goal of control unit of CPU is to control entire operations of its units, and it helps to move all data or instructions in between the all units of system. Memory unit is received all instruction and data from control unit, interprets them, and finally transfer entire operations to different units.

Arithmetic and Logic Unit

ALU is divided into two parts like as arithmetic and logic unit. It contains the digital circuit which is made with registers, and they help to solve the various arithmetic and logical operations. Arithmetic unit is designed to solve the different operations such as addition, subtraction, multiplication, division etc.

Prime functions of logic unit is to perform various types of operations like as comparing, selecting, matching and merging of numerous data value.

Input/Output Unit

Other CPU Components Lists are –

System Bus – Prime objective of system bus is to transmits all data and instructions, as well as it sends the address locations that aware the CPU where in the main memory all data and instructions are receiving from and where processed data should be saved.

External Bu s – It is communication medium in between the main data bus and system board.

Address Lines – Address lines are designed to identify the appropriate location in the memory unit where data is presented.

Flags – Flags are embedded into CPU, and they work as registers because they indicate the all currently running states of entire functions and other operations.

Function and Uses of CPU

CPU is an input and output device because it receive data from memory unit for processing, and after manipulation move it to again memory unit for displaying result on the screen.

Here, we will explain different four main functions of CPU (Central Processing Unit). Describe below each one.

Uses of CPU (Processor) and its Function

Fetch Phase

In this phase, CPU fetches all instructions from the memory unit . All instructions are stored in the memory unit in own address location, and CPU gets the address number to fetch instructions with the help of program counter. When CPU fetch first instruction then program counter increases itself automatic, and then CPU takes next instruction in the consecutively.

Decode Phase

After completing fetching phase, CPU decides that what to perform next step of receiving data. In this phase, CPU decodes the fetched data with help of “Decoder Circuit”. These data are converted into Assembly instructions, and further Assembly instructions are decoded in the form of binary language, CPU easily can understand to binary instructions such as 0 and 1.

Execute Phase

After completing fetching and decoding phase, next phase execute to be performed, but it totally depend upon the CPU architecture, it means execution is done may be serially or parallel fashion.

Execution phase is completed into three steps such as done calculation along with ALU (Arithmetically Logical Unit), and then transfer data from one memory place to other place finally switch to their allotted address location.

Store Phase

After completing above three phases, CPU releases the finally feedback, then produced output data is moved to memory units for storing. But these memories have slow speed and cheaper to registers.C

Features of CPU

CPU’s features are classified into various eight categories such as –

Characteristics of CPU and its Impact

Cache Memory

CPU takes more time for receiving data from the main memory of system, so CPU’s registers reserve important data which are used in processing and further precede them to cache memory.

Cache memory is small piece of memory but it is fastest memory to main memory, which is built into CPU core. Cache memory is divided into three level s such as L1, L2, and L3. L1 is small in size to L2 but it is faster compare L2, and further L3 is much faster to L1 and L2.

Cores in CPU

Today, modern CPU are developed along with multi-cores such as dual core, quad core, core i5, core i7 and i8, and those cores help to process data in parallel nature for enhancing the entire performance of computer system, as well as to manage their workload and speed.

Speeds

The performance of CPU is measured in different parameters such as GHz ( Gegahertz ) and MHz (Migahertz) but Hertz unit is used for measuring the frequency. CPU is capable to perform multiple tasks with using their frequency in few seconds. The frequency is measured into different parameter such as “how many times the internal clock of a processor ticks in cycles/sec”. For example – 2.5 GHz CPU can tick 2.5 billion times in every second.

Bandwidth

Hyper Threading

Hyper threading is also called the HTT because it has single CPU but it acts as double processor. It is not able to chase double speed, but entire performance is enhanced as dramatically. Intel Company provides the HTT technology to boost up the performance of processor.

Virtualization Help

Architecture of CPU

Operating system is designed with bit form like as 32 bit and 64 bit; it means some amount of data can be processed at once. So CPU architecture is also depend on the 32 bit and 64 bit, because if you use 32 bit O/S then your system can manage memory unit along with 32 bit architecture, CPU can access only 32 bit data buses.

Embedded GPU

What is a CPU?

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

If you’re just learning about the world of computers and electronics, the terminology used to refer to different parts can be confusing. One component term you may have encountered is “CPU,” which stands for “central processing unit.”

CPUs reside in almost all devices you own, whether it’s a smartwatch, a computer, or a thermostat. They are responsible for processing and executing instructions and act as the brains of your devices. Here, we explain how CPUs interact with other parts of your devices and what makes them so integral to the computing process.

What makes a CPU a CPU?

The CPU is the core component that defines a computing device, and while it is of critical importance, the CPU can only function alongside other hardware. The silicon chip sits in a special socket located on the main circuit board (motherboard or mainboard) inside the device. It is separate from the memory, which is where information is temporarily stored. It is also separate from the graphics card or graphics chip, which renders the video and 3D graphics that are displayed on your screen.

CPUs are built by placing billions of microscopic transistors onto a single computer chip. Those transistors allow it to make the calculations it needs to run programs that are stored on your system’s memory. They’re effectively minute gates that switch on or off, thereby conveying the ones or zeros that translate into everything you do with the device, be it watching videos or writing an email.

One of the most common advancements of CPU technology is in making those transistors smaller and smaller. That’s resulted in the improvement to CPU speed over the decades, often referred to as Moore’s Law.

In the context of modern devices, a desktop or laptop has a dedicated CPU that performs many processing functions for the system. Mobile devices and some tablets instead utilize a System on Chip (SoC) which is a chip that packages the CPU alongside other components. Intel and AMD both offer CPUs with graphics chips and memory stored on them, too, meaning they can do more than just standard CPU functions.

What does a CPU actually do?

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

At its core, a CPU takes instructions from a program or application and performs a calculation. This process breaks down into three key stages: Fetch, decode, and execute. A CPU fetches the instruction from RAM, decodes what the instruction actually is, and then executes the instruction using relevant parts of the CPU.

The executed instruction, or calculation, can involve basic arithmetic, comparing numbers, performing a function, or moving numbers around in memory. Since everything in a computing device is represented by numbers, you can think of the CPU as a calculator that runs incredibly fast. The resulting workload might start up Windows, display a YouTube video, or calculate compound interest in a spreadsheet.

In modern systems, the CPU acts like the ringmaster at the circus by feeding data to specialized hardware as it is required. For example, the CPU needs to tell the graphics card to show an explosion because you shot a fuel drum or tell the solid-state drive to transfer an Office document to the system’s RAM for quicker access.

Cores, clocks, and costs

Originally, CPUs had a single processing core. Today’s modern CPU consists of multiple cores that allow it to perform multiple instructions at once, effectively cramming several CPUs on a single chip. Most CPUs sold today have two or four cores. Six cores are considered mainstream, while more expensive chips range from eight to a massive 64 cores.

Many processors also employ a technology called multithreading. Imagine a single physical CPU core that can perform two lines of execution (threads) at once, thereby appearing as two “logical” cores on the operating system end. These virtual cores aren’t as powerful as physical cores because they share the same resources, but overall, they can help improve the CPU’s multitasking performance when running compatible software.

Clock speed is prominently advertised when you are looking at CPUs. This is the “gigahertz” (GHz) figure that effectively denotes how many instructions a CPU can handle per second, but that’s not the whole picture regarding performance. Clock speed mostly comes into play when comparing CPUs from the same product family or generation. When all else is the same, a faster clock speed means a faster processor. However, a 3GHz processor from 2010 will deliver less work than a 2GHz processor from 2020.

For Intel CPUs, that means 8th-, 9th-, or 10th-generation chips. You can determine their generation by the product name. For instance, the Core i7-6820HK is an older 6th-generation chip, while the Core i5-10210U is a newer 10th-generation chip.

AMD does something similar with its Ryzen CPUs: The Ryzen 5 2500X is a 2nd-generation chip based on its new “Zen+” core design, while the Ryzen 9 3950X is a 3rd-generation CPU. Ryzen 4000 was released as a laptop chip line and in APU form with very limited availability on desktop through system builders. With that in mind, it’s arguable whether the Ryzen 5000 is the fourth or fifth generation of AMD Ryzen CPU, but it’s the latest, and most recently, AMD has unified its laptop, APU, and desktop platforms under the Ryzen 5000 banner.

How important is the CPU?

These days, your CPU isn’t as important for overall system performance as it once was, but it still plays a major role in the response and speed of your computing device. Gamers will generally find a benefit from higher clock speeds, while more serious work such as CAD and video editing will see an improvement from a higher CPU core count.

You should bear in mind that your CPU is part of a system, so you want to be sure you have enough RAM and also fast storage that can feed data to your CPU. Perhaps the largest question mark will hang over your graphics card as you generally require some balance within your PC, both in terms of performance and also cost.

Now that you understand the role of a CPU, you are in a better position to make an educated choice about your computing hardware. Use this guide to learn more about the best chips from AMD and Intel.

Anatomy of a CPU

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Article Index

The CPU is often called the brains of a computer, and just like the human brain, it consists of several parts that work together to process information. There are parts that take in information, parts that store information, parts that process information, parts that help output information, and more. In today’s explainer, we’ll go over the key elements that make up a CPU and how they all work together to power your computer.

You should know, this article is part of our Anatomy series that dissects all the tech behind PC components. We also have a dedicated series to CPU Design that goes deeper into the CPU design process and how things work internally. It’s a highly recommended technical read. This anatomy article will revisit some of the fundamentals from the CPU series, but at a higher level and with additional content.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Compared to previous articles in our Anatomy series, this one will inevitably be more abstract. When you’re looking inside something like a power supply, you can clearly see the capacitors, transformers, and other components. That’s simply not possible with a modern CPU since everything is so tiny and because Intel and AMD don’t publicly disclose their designs. Most CPU designs are proprietary, so the topics covered in this article represent the general features that all CPUs have.

TechSpot’s Anatomy of Computer Hardware Series

You might have a desktop PC at work, school, or home. You might use one to work out tax returns or play the latest games; you might even be into building and tweaking computers. But how well do you know the components that make up a PC?

So let’s dive in. Every digital system needs some form of a Central Processing Unit. Fundamentally, a programmer writes code to do whatever their task is, and then a CPU executes that code to produce the intended result. The CPU is also connected to other parts of a system like memory and I/O to help keep it fed with the relevant data, but we won’t cover those systems today.

The CPU Blueprint: An ISA

When analyzing any CPU, the first thing you’ll come across is the Instruction Set Architecture (ISA). This is the figurative blueprint for how the CPU operates and how all the internal systems interact with each other. Just like there are many breeds of dogs within the same species, there are many different types of ISAs a CPU can be built on. The two most common types are x86 (found in desktops and laptops) and ARM (found in embedded and mobile devices).

There are some others like MIPS, RISC-V, and PowerPC that have more niche applications. An ISA will specify what instructions the CPU can process, how it interacts with memory and caches, how work is divided in the many stages of processing, and more.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

To cover the main portions of a CPU, we’ll follow the path an instruction takes as it is executed. Different types of instructions may follow different paths and use different parts of a CPU, but we’ll generalize here to cover the biggest parts. We’ll start with the most basic design of a single-core processor and gradually add complexity as we get towards a more modern design.

Control Unit and Datapath

The parts of a CPU can be divided into two: the control unit and the datapath. Imagine a train car. The engine is what moves the train, but the conductor is pulling the levers behind the scenes and controlling the different aspects of the engine. A CPU is the same way.

The datapath is like the engine and as the name suggests, is the path where the data flows as it is processed. The datapath receives the inputs, processes them, and sends them out to the right place when they are done. The control unit tells the datapath how to operate like the conductor of the train. Depending on the instruction, the datapath will route signals to different components, turn on and off different parts of the datapath, and monitor the state of the CPU.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Block diagram of a basic CPU. Black lines indicate data flow, red indicate control flow. Illustration by Lambtron via Wikipedia

The first thing our CPU must do is figure out what instructions to execute next and transfer them from memory into the CPU. Instructions are produced by a compiler and are specific to the CPU’s ISA. ISAs will share most common types of instructions like load, store, add, subtract, etc, but there many be additional special types of instructions unique to each particular ISA. The control unit will know what signals need to be routed where for each type of instruction.

Once it knows where to start, the first step of the instruction cycle is to get that instruction. This moves the instruction from memory into the CPU’s instruction register and is known as the Fetch stage. Realistically, the instruction is likely to be in the CPU’s cache already, but we’ll cover those details in a bit.

Depending on how complex the ISA is, the instruction decode portion of the CPU may get complex. An ISA like RISC-V may only have a few dozen instructions while x86 has thousands. On a typical Intel x86 CPU, the decode process is one of the most challenging and takes up a lot of space. The most common types of instructions that a CPU would decode are memory, arithmetic, or branch instructions.

3 Main Instruction Types

A memory instruction may be something like «read the value from memory address 1234 into value A» or «write value B to memory address 5678». An arithmetic instruction might be something like «add value A to value B and store the result into value C». A branch instruction might be something like «execute this code if value C is positive or execute that code if value C is negative». A typical program may chain these together to come up with something like «add the value at memory address 1234 to the value at memory address 5678 and store it in memory address 4321 if the result is positive or at address 8765 if the result is negative».

Before we start executing the instruction we just decoded, we need to pause for a moment to talk about registers.

A CPU has a few very small but very fast pieces of memory called registers. On a 64-bit CPU these would hold 64 bits each and there may be just a few dozen for the core. These are used to store values that are currently being used and can be considered something like an L0 cache. In the instruction examples above, values A, B, and C would all be stored in registers.

The ALU

Back to the execution stage now. This will be different for the 3 types of instructions we talked about above, so we’ll cover each one separately.

Starting with arithmetic instructions since they are the easiest to understand. These type of instructions are fed into an Arithmetic Log Unit (ALU) for processing. An ALU is a circuit that typically takes two inputs with a control signal and outputs a result.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Imagine a basic calculator you used in middle school. To perform an operation, you type in the two input numbers as well as what type of operation you want to perform. The calculator does the computation and outputs the result. In the case of our CPU’s ALU, the type of operation is determined by the instruction’s opcode and the control unit would send that to the ALU. In addition to basic arithmetic, ALUs can also perform bitwise operations like AND, OR, NOT, and XOR. The ALU will also output some status info for the control unit about the calculation it has just completed. This could include things like whether the result was positive, negative, zero, or had an overflow.

An ALU is most associated with arithmetic operations, but it may also be used for memory or branch instructions. For example, the CPU may need to calculate a memory address given as the result of a previous arithmetic operation. It may also need to calculate the offset to add to the program counter that a branch instruction requires. Something like «if the previous result was negative, jump ahead 20 instructions.»

Memory Instructions and Hierarchy

For memory instructions, we’ll need to understand a concept called the Memory Hierarchy. This represents the relationship between caches, RAM, and main storage. When a CPU receives a memory instruction for a piece of data that it doesn’t yet have locally in its registers, it will go down the memory hierarchy until it finds it. Most modern CPUs contain three levels of cache: L1, L2, and L3. The first place the CPU will check is the L1 cache. This is the smallest and fastest of the three levels of cache. The L1 cache is typically split into a portion for data and a portion for instructions. Remember, instructions need to be fetched from memory just like data.

A typical L1 cache may be a few hundred KB. If the CPU can’t find what it’s looking for in the L1 cache, it will check the L2 cache. This may be on the order of a few MB. The next step is the L3 cache which may be a few tens of MB. If the CPU can’t find the data it needs in the L3 cache, it will go to RAM and finally main storage. As we go down each step, the available space increases by roughly an order of magnitude, but so does the latency.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Once the CPU finds the data, it will bring it up the hierarchy so that the CPU has fast access to it if needed in the future. There are a lot of steps here, but it ensures that the CPU has fast access to the data it needs. For example, the CPU can read from its internal registers in just a cycle or two, L1 in a handful of cycles, L2 in ten or so cycles, and the L3 in a few dozen. If it needs to go to memory or main storage, those could take tens of thousands or even millions of cycles. Depending on the system, each core will likely have its own private L1 cache, share an L2 with one other core, and share an L3 among groups four or more cores. We’ll talk more about multi-core CPUs later in this article.

Branch and Jump Instructions

The last of the three major instruction types is the branch instruction. Modern programs jump around all the time and a CPU will rarely ever execute more than a dozen contiguous instructions without a branch. Branch instructions come from programming elements like if-statements, for-loops, and return-statements. These are all used to interrupt the program execution and switch to a different part of the code. There are also jump instructions which are branch instructions that are always taken.

Conditional branches are especially tricky for a CPU since it may be executing multiple instructions at once and may not determine the outcome of a branch until after it has started on subsequent instructions.

In order to fully understand why this is an issue, we’ll need to take another diversion and talk about pipelining. Each step in the instruction cycle may take a few cycles to complete. That means that while an instruction is being fetched, the ALU would otherwise be sitting idle. To maximize a CPU’s efficiency, we divide each stage in a process called pipelining.

The classic way to understand this is through an analogy to doing laundry. You have two loads to do and washing and drying each take an hour. You could put the first load in the washer and then the dryer when it’s done, and then start the second load. This would take four hours. However, if you divided the work and started the second load washing while the first load was drying, you could get both loads done in three hours. The one hour reduction scales with the number of loads you have and the number of washers and dryers. It still takes two hours to do an individual load, but the overlap increases the total throughput from 0.5 loads/hr to 0.75 loads/hr.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

A graphical representation of the pipeline used in AMD’s Bobcat core from 2011. Note how complex it is and how many stages are present.

CPUs use this same method to improve instruction throughput. A modern ARM or x86 CPU may have 20+ pipeline stages which means at any given point, that core is processing 20+ different instructions at once. Each design is unique, but one sample division may be 4 cycles for fetch, 6 cycles for decode, 3 cycles for execute, and 7 cycles for updating the results back to memory.

Back to branches, hopefully you can start to see the issue. If we don’t know that an instruction is a branch until cycle 10, we will have already started executing 9 new instructions that may be invalid if the branch is taken. To get around this issue, CPUs have very complex structures called branch predictors. They use similar concepts from machine learning to try and guess if a branch will be taken or not. The intricacies of branch predictors are well beyond the scope of this article, but on a basic level, they track the status of previous branches to learn whether or not an upcoming branch is likely to be taken or not. Modern branch predictors can have 95% accuracy or higher.

Once the result of the branch is known for sure (it has finished that stage of the pipeline), the program counter will be updated and the CPU will go on to execute the next instruction. If the branch was mispredicted, the CPU will throw out all the instructions after the branch that it mistakenly started to execute and start up again from the correct place.

Out-Of-Order Execution

Now that we know how to execute the three most common types of instructions, let’s take a look at some of the more advanced features of a CPU. Virtually all modern processors don’t actually execute instructions in the order in which they are received. A paradigm called out-of-order execution is used to minimize downtime while waiting for other instructions to finish.

If a CPU knows that an upcoming instruction requires data that won’t be ready in time, it can switch the instruction order and bring in an independent instruction from later in the program while it waits. This instruction reordering is an extremely powerful tool, but it is far from the only trick CPUs use.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Another performance improving feature is called prefetching. If you were to time how long it takes for a random instruction to complete from start to finish, you’d find that the memory access takes up most of the time. A prefetcher is a unit in the CPU that tries to look ahead at future instructions and what data they will require. If it sees one coming that requires data that the CPU doesn’t have cached, it will reach out to the RAM and fetch that data into the cache. Hence the name pre-fetch.

Accelerators and the Future

Another major feature starting to be included in CPUs are task-specific accelerators. These are circuits whose entire job is perform one small task as fast as possible. This might include encryption, media encoding, or machine learning.

The CPU can do these things on its own, but it is vastly more efficient to have a unit dedicated to them. A great example of this is onboard graphics compared to a dedicated GPU. Surely the CPU can perform the computations needed for graphics processing, but having a dedicated unit for them offers orders of magnitude better performance. With the rise of accelerators, the actual core of a CPU may only take up a small fraction of the chip.

The picture below shows an Intel CPU from several years back. Most of the space is taken up by cores and cache. The second picture below it is for a much newer AMD chip. Most of the space there is taken up by components other than the cores.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Above: the die of Intel’s first generation Nehalem architecture. Note that the cores and Cache take up the majority of the space.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Above: The die of an AMD SoC showing the large amount of space devoted to accelerators and external interfaces

Going Multicore

The last major feature to cover is how we can connect a bunch of individual CPUs together to form a multicore CPU. It’s not as simple as just putting multiple copies of the single core design we talked about earlier. Just like there’s no easy way to turn a single-threaded program into a multi-threaded program, the same concept applies to hardware. The issues come from dependence between the cores.

For, say, a 4-core design, the CPU needs to be able to issue instructions 4 times as fast. It also needs four separate interfaces to memory. With multiple entities operating on potentially the same pieces of data, issues like coherence and consistency must be resolved. If two cores were both processing instructions that used the same data, how do they know who has the right value? What if one core modified the data but it didn’t reach the other core in time for it to execute? Since they have separate caches that may store overlapping data, complex algorithms and controllers must be used to remove these conflicts.

Proper branch prediction is also extremely important as the number of cores in a CPU increases. The more cores are executing instructions at once, the higher the likelihood that one of them is processing a branch instruction. This means the instruction flow may change at any time.

Typically, separate cores will process instruction streams from different threads. This helps reduce the dependence between cores. That’s why if you check Task Manager, you’ll often see one core working hard and the others hardly working. Many programs aren’t designed for multithreading. There may also be certain cases where it’s more efficient to have one core do the work rather than pay the overhead penalties of trying to divide up the work.

Physical Design

Most of this article has focused on the architectural design of a CPU since that’s where most of the complexity is. However, this all needs to be created in the real world and that adds another level of complexity.

In order to synchronize all the components throughout the processor, a clock signal is used. Modern processors typically run between 3.0GHz and 5.0GHz and that hasn’t seemed to change in the past decade. At each of these cycles, the billions of transistors inside a chip are switching on and off.

Clocks are critical to ensure that as each stage of the pipeline advances, all the values show up at the right time. The clock determines how many instructions a CPU can process per second. Increasing its frequency through overclocking will make the chip faster, but will also increase power consumption and heat output.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Heat is a CPU’s worst enemy. As digital electronics heat up, the microscopic transistors can start to degrade. This can lead to damage in a chip if the heat is not removed. This is why all CPUs come with heat spreaders. The actual silicon die of a CPU may only take up 20% of the surface area of a physical device. Increasing the footprint allows the heat to be spread more evenly to a heatsink. It also allows more pins for interfacing with external components.

Modern CPUs can have a thousand or more input and output pins on the back. A mobile chip may only have a few hundred pins though since most of the computing parts are within the chip. Regardless of the design, around half of them are devoted to power delivery and the rest are used data communications. This includes communication with the RAM, chipset, storage, PCIe devices, and more. With high performance CPUs drawing a hundred or more amps at full load, they need hundreds of pins to spread out the current draw evenly. The pins are usually gold plated to improve electrical conductivity. Different manufacturers use different arrangements of pins throughout their many product lines.

Putting It All Together with an Example

To wrap things up, we’ll take a quick look at the design of an Intel Core 2 CPU. This is from way back in 2006, so some parts may be outdated, but details on newer designs are not available.

Starting at the top, we have the instruction cache and ITLB. The Translation Lookaside Buffer (TLB) is used to help the CPU know where in memory to go to find the instruction it needs. Those instructions are stored in an L1 instruction cache and are then sent into a pre-decoder. The x86 architecture is extremely complex and dense so there are many steps to decoding. Meanwhile, the branch predictor and prefetcher are both looking ahead for any potential issues caused by incoming instructions.

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

From there, the instructions are sent into an instruction queue. Recall back to how the out-of-order design allows a CPU to execute instructions and choose the most timely one to execute. This queue holds the current instructions a CPU is considering. Once the CPU knows which instruction would be the best to execute, it is further decoded into micro-operations. While an instruction might contain a complex task for the CPU, micro-ops are granular tasks that are more easily interpreted by the CPU.

These instructions then go into the Register Alias Table, the ROB, and the Reservation Station. The exact function of these three components is a bit complex (think graduate level university course), but they are used in the out-of-order process to help manage dependencies between instructions.

A single «core» will actually have many ALUs and memory ports. Incoming operations are put into the reservation station until an ALU or memory port is available for use. Once the required component is available, the instruction will be processed with the help from the L1 data cache. The output results will be stored and the CPU is now ready to start on the next instruction. That’s about it!

While this article was not meant to be a definitive guide to exactly how every CPU works, it should give you a good idea of their inner workings and complexities. Frankly, no one outside of AMD and Intel actually know how their CPUs work. Each section of this article represents an entire field of research and development so the information presented here just scratches the surface.

Keep Reading

If you are interested in learning more about how the various components covered in this article are designed, check out Part 2 of our CPU design series. If you’re more interested in learning how a CPU is physically made down to the transistor and silicon level, check out Part 3.

What are the main parts of the cpu

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu
Reviewed by Jenna Phipps

What is a CPU?

CPU (pronounced as separate letters) is the abbreviation for central processing unit. Sometimes referred to simply as the central processor, but more commonly called a processor, the CPU is the brains of the computer where most calculations take place. In terms of computing power, the CPU is the most important element of a computer system.

What are the components of a CPU?

The two typical components of a CPU include the following:

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

Image: Relationship between the elements of the CPU, input and output, and storage (see study guide).

Printed Circuit Boards, Microprocessors

On large machines, the CPU requires one or more printed circuit boards. On personal computers and small workstations, it is housed in a single chip called a microprocessor. Since the 1970’s the microprocessor class of CPUs has almost completely overtaken all other CPU implementations.

The CPU itself is an internal component of the computer. Modern CPUs are small and square and contain multiple metallic connectors or pins on the underside. The CPU is inserted directly into a CPU socket, pin side down, on the motherboard.

Each motherboard will support only a specific type (or range) of CPU, so you must check the motherboard manufacturer’s specifications before attempting to replace or upgrade a CPU in your computer. Modern CPUs also have an attached heat sink and small fan that go directly on top of the CPU to help dissipate heat.

Recommended Reading: Webopedia study guides

CPUs, main memory, and flash memory

The computer’s persistent, or secondary, memory is its hard drive. The hard drive stores all of the computer’s data. The CPU doesn’t process it all at the same time, but that’s why it is in secondary memory (or storage): it’s available whenever the computer user opens the related application.

External hard drives and solid state drives (SSDs) are another form of secondary storage. They connect either through a cable or through a slot on the motherboard. Serial ATA (SATA) is a drive interface through which the CPU can access externally stored data. The SATA interface has both HDDS and SSDs.

Solid state drives use flash memory rather than hard spinning disks. Flash is a very fast method of accessing stored data. Some SSDs have a PCI Express interface. By connecting the SSD to the PCIe bus on a computer, the data stored on the drive has a direct path to the CPU. The CPU processes it as though it’s in main memory.

How does a CPU work?

What are the main parts of the cpu. Смотреть фото What are the main parts of the cpu. Смотреть картинку What are the main parts of the cpu. Картинка про What are the main parts of the cpu. Фото What are the main parts of the cpu

CPU, also known as the microprocessor is the heart and/or brain of a computer. Lets Deep dive into the core of the computer to help us write computer programs efficiently.

«A tool is usually more simple than a machine; it is generally used with the hand, whilst a machine is frequently moved by animal or steam power.»

A computer is a machine powered mostly by electricity but its flexibility and programability has helped achieve the simplicity of a tool.

CPU is the heart and/or the brain of a computer. It executes the instructions that are provided to it. Its main job is to perform arithmetic and logical operations and orchestrate the instructions together. Before diving into the main parts let’s start by looking what are the main components of a CPU and what there roles are:

Two main components of a processor

Control Unit — CU

Control unit CU is the part of CPU that helps orchestrate the execution of instructions. It tells what to do. According to the instruction, it helps activate the wires connecting CPU to different other parts of computer including the ALU. Control unit is the first component of CPU to receive the instruction for processing.

There are two types of control unit:

Hardwired control units are the hardware and needs the change in hardware to add modify it’s working where as microprogrammable control unit can be programmed to change its behavior. Hardwired CU are faster in processing instruction whereas microprogrammable as more flexible.

Arithmetic and logical unit — ALU

Arithmetic and logical unit ALU as name suggest does all the arithmetic and logical computations. ALU performs the operations like addition, subtraction. ALU consists of logic circuitry or logic gates which performs these operations.

Most logic gates take in two input and produces one output

Bellow is an example of half adder circuit which takes in two inputs and outputs the result. Here A and B are the input, S is the output and C is the carry.

Storage — Registers and Memory

Main job of CPU is to execute the instructions provided to it. To process these instructions most of the time, it needs data. Some data are intermediate data, some of them are inputs and other is the output. These data along with the instructions are stored in the following storage:

Registers

Register is a small set of place where the data can be stored. A register is a combination of latches. Latches also known as flip-flops are combinations of logic gates which stores 1 bit of information.

A latch has two input wire, write and input wire and one output wire. We can enable the write wire to make changes to the stored data. When the write wire is disabled the output always remains the same.

CPU has registers to store the data of output. Sending to main memory(RAM) would be slow as it is the intermediate data. This data is send to other register which is connected by a BUS. A register can store instruction, output data, storage address or any kind of data.

Memory(RAM)

Ram is a collection of register arranged and compact together in an optimized way so that it can store a higher number of data. RAM(Random Access Memory) are volatile and it’s data get’s lost when we turn off the power. As RAM is a collection of register to read/write data a RAM takes input of 8bit address, data input for the actual data to be stored and finally read and write enabler which works as it is for the latches.

What are Instructions

Instruction is the granular level computation a computer can perform. There are various types of instruction a CPU can process.

Instruction are provided to computer using assembly language or are generated by compiler or are interpreted in some high level languages.

These instruction are hardwired inside CPU. ALU contains the arithmetic and logical where as the control flow are managed by CU.

In one clock cycle computers can perform one instruction but modern computers can perform more than one.

A group of instructions a computer can perform is called an instruction set.

CPU clock

Clock cycle

The speed of a computer is determined by its clock cycle. It is the number of clock periods per second a computer works on. A single clock cycles are very small like around 250 * 10 *-12 sec. Higher the clock cycle faster the processor is.

CPU clock cycle is measure in gHz(Gigahertz). 1gHz is equal to 10 ⁹ Hz(hertz). A hertz means a second. So 1Gigahertz means 10 ⁹ cycles per second.

The faster the clock cycle, the more instructions the CPU can execute.Clock cycle = 1/clock rateCPU Time = number of clock cycle / clock rate

This means to improve CPU time we can increase clock rate or decrease number of clock cycle by optimizing the instruction we provide to CPU. Some processor provide the ability to increase the clock cycle but since it is physical changes there might be over heating and even smokes/fires.

How does an instruction get executed

Instructions are stored on the RAM in a sequential order. For a hypothetical CPU Instruction consists of OP code(operational code) and memory or register address.

There are two registers inside a Control Unit Instruction register(IR) which loads the OP code of the instruction and Instruction address register which loads the address of the current executing instruction. There are other registers inside a CPU which stores the value stored in the address of the last 4 bits of a instruction.

Let’s take an example of a set of instruction which adds two number. The following are the instructions along with there description:

STEP 1 — LOAD_A 8:

STEP 2 — LOAD_B 2

Similar to above this loads the the data in memory address 2 (0010) to CPU register B.

STEP 3 — ADD B A

Now the next instruction is to add these two numbers. Here the CU tells ALU to perform the add operation and save the result back to register A.

STEP 4 — STORE_A 23

This is a very simple set of instruction that helps add two numbers.

We have successfully added two numbers!

BUS

All the data between CPU, register, memory and IO devise are transferred via bus. To load the data to memory that it has just added, the CPU puts the memory address to address bus and the result of the sum to data bus and enables the right signal in control bus. In this way the data is loaded to memory with the help of the bus.

Cache

CPU also has mechanism to prefetch the instruction to its cached. As we know there are millions of instruction a processor can complete within a second. This means that there will be more time spent in fetching the instruction from RAM than executing them. So the CPU cache prefetches some of the instruction and also data so that the execution gets fast.

If the data in cache and operating memory is different the data is marked as a dirty bit.

Instruction pipelining

Modern CPU uses Instruction pipelining for parallelization in instruction execution. Fetch, Decode, Execute. When one instruction is in decode phase the CPU can process another instruction for fetch phase.

This has one problem when one instruction is dependent on another. So processors execute the instruction that are not dependent and in different order.

Multi core computer

It is basically the different CPU but has some shared resource like the cache.

Performance

Performance of CPU is determined by it’s execution time.Performance = 1/execution time

let’s say it takes 20ms for a program to execute. The performance of CPU is 1/20 = 0.05msRelative performance = execution time 1/ execution time 2

The factor that comes under consideration for a CPU performance is the instruction execution time and the CPU clock speed. So to increase the performance of a program we either need to to increase the clock speed or decrease the number of instruction in a program. The processor speed is limited and modern computer’s with multi core can support millions of instructions a second. But if the program we have written has a lot of instructions this will decrease the overall performance.

Big O notation determines with the given input how the performance will be affected.

There are a lot of optimization done in CPU to make it faster and perform as much as it can. While writing any program we need to consider how reducing the number of instruction we provide to CPU will increase the performance of computer program.

Also Posted on Milap Neupane Blog: How Does a CPU work

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *