260

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.

7 Answers 7

240

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.

Sign up to request clarification or add additional context in comments.

6 Comments

@Leeor 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...
@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%)
@Leeor 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); }
@Leeor 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.
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.
|
162

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: Intel Performance Counter Monitor: A better way to measure CPU utilization

3 Comments

It probably says more than a thousand words for small creatures like ants though.
I don't have anything against using images, but at least you could make a further explanation, not just copy/paste an image.
@Sky Be careful with ants ... #hunter_x_hunter :3
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.

2 Comments

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?
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-cores
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.

4 Comments

What exactly happened in 2002?
Intel didn't invent the concept of simultaneous multithreading. Wikipedia says Alpha EV8 was the first major commercial implementation.
(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.)
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.
7

In the early days, like before the 1990s, the processors weren't able to do multiple tasks that efficiently, because a single processor could handle just a single task, so when we used to say that my antivirus software, Microsoft Word, VLC media player, etc. software 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 it’s a short one, again pause it and add it to the queue, and then the next.

But this 'pause' that I mentioned was so small (approximately 1 ns) that you didn't understand that the task has been paused. For example, on VLC media player, while listening to music, there are other applications running simultaneously, but as I told you, one program at a time, so the VLC media player application is actually pausing in between for nanoseconds, so you don’t understand it, but the music is actually stopping in between.

But this was about the old processors...

Nowadays, processors, i.e., third-generation PCs have multi-core processors. Now the 'cores' can be compared to a first-generation or second-generation processors itself, embedded onto a single chip, a single processor.

So now we understood what cores are, i.e., 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 follow the same steps as I mentioned above about the single processor.

E.g., a Core i7 sixth generation processor has eight cores, i.e., eight mini processors in one Core i7, i.e., its speed is eight times the old processors. And this is how multitasking can be done.

There could be hundreds of cores in a single processor. E.g., Intel i128.

Comments

5

I found this link to be a clear explanation for me about the difference between a CPU (processor) and a core. So I'm leaving here some notes from there:

The main difference between a CPU and a core is that the CPU is an electronic circuit inside the computer that carries out instructions 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

4 Comments

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".
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.
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.
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.
0

Intel's picture is helpful, as shown by JohnTortugo's 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.)

2 Comments

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.