Difference between core and processor [closed]
Asked Answered
N

7

258

What is the difference between a core and a processor?

I've already looked for it on Google, but I only get definitions for multi-core and multi-processor, which is not what I am looking for.

Nitin answered 7/10, 2013 at 13:13 Comment(0)
C
238

A core is usually the basic computation unit of the CPU - it can run a single program context (or multiple ones if it supports hardware threads such as hyperthreading on Intel CPUs), maintaining the correct program state, registers, and correct execution order, and performing the operations through ALUs. For optimization purposes, a core can also hold on-core caches with copies of frequently used memory chunks.

A CPU may have one or more cores to perform tasks at a given time. These tasks are usually software processes and threads that the OS schedules. Note that the OS may have many threads to run, but the CPU can only run X such tasks at a given time, where X = number cores * number of hardware threads per core. The rest would have to wait for the OS to schedule them whether by preempting currently running tasks or any other means.

In addition to the one or many cores, the CPU will include some interconnect that connects the cores to the outside world, and usually also a large "last-level" shared cache. There are multiple other key elements required to make a CPU work, but their exact locations may differ according to design. You'll need a memory controller to talk to the memory, I/O controllers (display, PCIe, USB, etc..). In the past these elements were outside the CPU, in the complementary "chipset", but most modern design have integrated them into the CPU.

In addition the CPU may have an integrated GPU, and pretty much everything else the designer wanted to keep close for performance, power and manufacturing considerations. CPU design is mostly trending in to what's called system on chip (SoC).

This is a "classic" design, used by most modern general-purpose devices (client PC, servers, and also tablet and smartphones). You can find more elaborate designs, usually in the academy, where the computations is not done in basic "core-like" units.

Countryandwestern answered 11/10, 2013 at 9:5 Comment(6)
@Countryandwestern so for a 4 cpu and 2 core machine, if I run a busy loop, should it not engage just 1 cpu and 1 core (ie 50%) of just one of the cpu ? My observation shows it engages all the cpu to 100% ...somethin missing in my understanding...Transceiver
@Nrj, if you run one single-threaded application, it will be allocated to a single core, and activate only a single HW thread on it. That thread will be able to utilize 100% of that core as there is no other thread running along with it. If you activate another application it will usually be allocated to another core, and so on until you saturate the number of cores. Beyond that any additional thread will be scheduled to the same cores again using SMT. At that point, the core utilization will be distributed between the 2 threads (and if they behave symmetrically, each would likely reach ~50%)Countryandwestern
@Countryandwestern apparently this was my expectation but its not what i found. I saw that all the four CPU (in taskmanager) jump to show 100% usage. The code was simple - for(int i=0; i<Integer.MAX_VALUE; i++) { System.out.println(k); }Transceiver
@Countryandwestern I think I did the test incorrectly. it loooks like my online workspace has virtual CPUs (4) but a single processor. Thats why all of them get busy. When I performed the test on a 2 cpu physical machine (dual core), i can see that the cpu utilization is about 25% which is inline with the expectation.Transceiver
Note that this terminology varies, depending on who you ask. For instance, on my Debian system, inspecting /proc/cpuinfo, I see sixteen processor: lines, although it says model: AMD Ryzen 7 2700X Eight-Core Processor. So, at least in this case, each of the 8 "cores" has two "processors", which is at odds with some other answers here.Bubalo
A description of the difference between core and processor that does not use the word processor. Feel like something critical is missing from this - it doesn't answer the question.Hyperon
S
160

An image may say more than a thousand words:

An image may say more than a thousand words

* Figure describing the complexity of a modern multi-processor, multi-core system.

Source:

https://software.intel.com/en-us/articles/intel-performance-counter-monitor-a-better-way-to-measure-cpu-utilization

Specialty answered 21/5, 2014 at 23:55 Comment(3)
It probably says more than a thousand words for small creatures like ants though.Gallant
I don't have anything against using images, but at least you could make a further explanation, not just copy/paste an image.Richierichlad
@Gallant Be careful with ants ... #hunter_x_hunter :3Nitin
E
33

Let's clarify first what is a CPU and what is a core, a central processing unit CPU, can have multiple core units, those cores are a processor by itself, capable of execute a program but it is self contained on the same chip.

In the past one CPU was distributed among quite a few chips, but as Moore's Law progressed they made to have a complete CPU inside one chip (die), since the 90's the manufacturer's started to fit more cores in the same die, so that's the concept of Multi-core.

In these days is possible to have hundreds of cores on the same CPU (chip or die) GPUs, Intel Xeon. Other technique developed in the 90's was simultaneous multi-threading, basically they found that was possible to have another thread in the same single core CPU, since most of the resources were duplicated already like ALU, multiple registers.

So basically a CPU can have multiple cores each of them capable to run one thread or more at the same time, we may expect to have more cores in the future, but with more difficulty to be able to program efficiently.

Easement answered 19/5, 2014 at 10:29 Comment(2)
Even "Intel E5-2697 v2" only has 12 cores... Why do you say "hundreds of cores on the same CPU"? What limits the number of cores possible on a single CPU?Titular
They are research microprocessors in the count of +100 cores and a few on production take a look to: tomshardware.com/forum/318101-28-which-maximum-cores-coresGalinagalindo
Y
14

CPU is a central processing unit. Since 2002 we have only single core processor i.e. we will only perform a single task or a program at a time.

For having multiple programs run at a time we have to use the multiple processor for executing multi processes at a time so we required another motherboard for that and that is very expensive.

So, Intel introduced the concept of hyper threading i.e. it will convert the single CPU into two virtual CPUs i.e we have two cores for our task. Now the CPU is single, but it is only pretending (masqueraded) that it has a dual CPU and performs multiple tasks. But having real multiple cores will be better than that so people develop making multi-core processor i.e. multiple processors on a single box i.e. grabbing a multiple CPU on single big CPU. I.e. multiple cores.

Yorkist answered 27/3, 2015 at 14:4 Comment(4)
What exactly happened in 2002?Shaggy
Intel didn't invent the concept of simultaneous multithreading. Wikipedia says Alpha EV8 was the first major commercial implementation.Nina
(Update to my previous comment: Alpha EV8 was basically finished, but never made it to market before DEC went out of business. Intel hired most of that design team, so it's not at all a coincidence that Pentium 4 SMT was one of the next commercial implementations. But the idea had been known even before EV8, including more coarse-grained variations on it like switch-on-stall.)Nina
I benchmarked one of those DEC Alpha hosts at an EDA company. It blew the doors of the SPARC competition. I wanted to buy truckloads but my customers, who complained about SLOW, then started complaining about migration. Sigh.Wideeyed
E
7

In the early days...like before the 90s...the processors weren't able to do multi tasks that efficiently...coz a single processor could handle just a single task...so when we used to say that my antivirus,microsoft word,vlc,etc. softwares are all running at the same time...that isn't actually true. When I said a processor could handle a single process at a time...I meant it. It actually would process a single task...then it used to pause that task...take another task...complete it if its a short one or again pause it and add it to the queue...then the next. But this 'pause' that I mentioned was so small (appx. 1ns) that you didn't understand that the task has been paused. Eg. On vlc while listening to music there are other apps running simultaneously but as I told you...one program at a time...so the vlc is actually pausing in between for ns so you dont underatand it but the music is actually stopping in between.

But this was about the old processors...

Now-a- days processors ie 3rd gen pcs have multi cored processors. Now the 'cores' can be compared to a 1st or 2nd gen processors itself...embedded onto a single chip, a single processor. So now we understood what are cores ie they are mini processors which combine to become a processor. And each core can handle a single process at a time or multi threads as designed for the OS. And they folloq the same steps as I mentioned above about the single processor.

Eg. A i7 6gen processor has 8 cores...ie 8 mini processors in 1 i7...ie its speed is 8x times the old processors. And this is how multi tasking can be done.

There could be hundreds of cores in a single processor Eg. Intel i128.

I hope I explaned this well.

Esbensen answered 29/10, 2017 at 11:44 Comment(0)
T
5

I have read all answers, but this link was more clear explanation for me about difference between CPU(Processor) and Core. So I'm leaving here some notes from there.

The main difference between CPU and Core is that the CPU is an electronic circuit inside the computer that carries out instruction to perform arithmetic, logical, control and input/output operations while the core is an execution unit inside the CPU that receives and executes instructions.

enter image description here

Thou answered 12/12, 2020 at 7:32 Comment(4)
In computer-architecture terminology, an "execution unit" is a component of a single core, e.g. a FP adder or an integer shifter. realworldtech.com/haswell-cpu/4 shows the execution units attached to the execution ports of a single Intel Haswell core. realworldtech.com/haswell-cpu/6 shows a block diagram of a whole core, including instruction fetch/decode and the whole rest of the pipeline. Do not conflate "execution unit" with "core".Nina
The "core" side of your diagram could be correct: each core can process a separate instruction-stream (at a rate of up to 4 instructions per clock for Haswell with 4-wide pipeline that can feed its multiple execution units. Well actually 6 with compare/branch instruction fusion in its decoders). See also this answer and especially Modern Microprocessors A 90-Minute Guide! for more about the inside of a single core.Nina
But the "CPU" side of your diagram looks wrong. Each core logically acts as a whole uniprocessor system, handling its own instruction stream. The left side does seem to be talking about a single core that runs a single instruction stream, and executes each one on an execution unit. So it's basically showing definitions for "core" and "execution unit" and mislabeling them "CPU" and "core". I wonder if the original author of that on pediaa.com/difference-between-cpu-and-core was thinking of GPUs where "cuda cores" are basically just execution units.Nina
Question: Does this mean a multi-processor CPU is simple multiple CPUs? I'm reading a computer architecture textbook that differentiates between the term "Processor" and "CPU", meaning the Processor is the Chip housing the cores. This leaves me perplexed as to what the CPU then is. Is the CPU a physical unit or just a logical part of the computer architecture? Making the CPU->Processor-> core relation heirarchical.Suwannee
I
0

Intel's picture is helpful, as shown by Tortuga's best answer. Here's a caption for it.

Processor: One semiconductor chip, the CPU (central processing unit) seated in one socket, circa 1950s-2010s. Over time, more functions have been packed onto the CPU chip. Prior to the 1950s releases of single-chip processors, one processor might have spread across multiple chips. In the mid 2010s the system-on-a-chip chips made it slightly more sketchy to equate one processor to one chip, though that's generally what people mean by processor, as in "this computer has an i7 processor" or "this computer system has four processors."

Core: One block of a CPU, executing one instruction at a time. (You'll see people say one instruction per clock cycle, but some CPUs use multiple clock cycles for some instructions.)

Incantatory answered 30/8, 2018 at 4:4 Comment(2)
An x86 core logically executes instructions one at a time, in program order, but in reality modern CPUs spend a lot of transistors to preserve the illusion of doing that while actually being 4-wide superscalar out-of-order execution. realworldtech.com/haswell-cpu. (Or 5 or 6 wide, for Ryzen). More than 3 instructions per clock is not rare in practice, for some code. But well below 1 is also common in other code that bottlenecks on cache misses and/or branch mispredicts.Nina
Also, VLIW architectures like Itanium are explicltly parallel, and logically as well as physically execute multiple instructions in parallel. BTW, interesting historical point that one CPU took more than one chip in the early days.Nina

© 2022 - 2024 — McMap. All rights reserved.