Questions tagged [cpu]

CPU, stands for Central Processing Unit. It is responsible for carrying out the instructions of a computer program by performing the basic arithmetic, logical, control and input/output (I/O) operations specified by the instructions.

325 questions
78
votes
9 answers

Why is addition as fast as bit-wise operations in modern processors?

I know that bit-wise operations are so fast on modern processors, because they can operate on 32 or 64 bits on parallel, so bit-wise operations take only one clock cycle. However addition is a complex operation that consists of at least one and…
45
votes
7 answers

Is there anything that MUST be done on a multi-core CPU?

When considering how multi-thread-friendly our program must be, my team puzzled about whether there's anything that absolutely cannot be done on a single-core CPU. I posited that graphics processing requires massively parallel processing, but they…
Ky -
  • 599
  • 1
  • 4
  • 9
21
votes
5 answers

What does machine code actually look like while being run?

When machine code is actually being executed by hardware and the CPU, what does it look like? Would it look like binary, as in instructions being represented by ones and zeros, or would it be something made up of hexadecimal digits where opcodes are…
Tim Hardly
  • 321
  • 2
  • 6
19
votes
2 answers

What is a GPU year?

I am reading papers in machine learning and they say things like, "This computation took $x$ number of GPU years". What is a GPU year? How long is that?
Frederic Chopin
  • 293
  • 1
  • 2
  • 6
18
votes
4 answers

What is a CPU clock physically?

I can't seem to get a straight answer as to what a CPU clock is. I know there are quartz crystal clocks that work by the bending of quartz that happens as an electrical current is passed through it. Do modern CPUs also use a crystal with the same…
Ryan Folks
  • 191
  • 1
  • 1
  • 5
16
votes
7 answers

How is a program executed at the CPU level?

I know this is a very common question. But I have a different angle in my mind. I will just try to articulate it here. From what I know, every instruction that a CPU executes, is in machine language and all CPU can do is do some arithmetic…
user2827893
  • 161
  • 1
  • 1
  • 4
14
votes
2 answers

What are the advantages of x86 CPUs over ARM?

Now that Apple is switching the MacOS platform to ARM chips, much has been said about the benefits of ARM processors (they save energy, are passively cooled, and the Apple M1 seems to be faster than even an Intel Core i9 processor). I'd like to know…
Jonas Sourlier
  • 243
  • 1
  • 2
  • 7
12
votes
2 answers

How is conditional jump implemented in the CPU?

After reading the question I'm still not sure how CPU does branching. I understand that we have an instruction counter which points to the current instruction. And after performing conditional jump it either stays the same (increments as usual) or…
LNK
  • 239
  • 2
  • 5
10
votes
2 answers

What is instruction throughput and instruction latency?

I was reading an article on an alternative method of modulo reduction and i couldn't understand the following excerpt (Those in bold) : "A single 32-bit division on a recent x64 processor has a throughput of one instruction every six cycles with a…
Karim Manaouil
  • 320
  • 1
  • 2
  • 12
10
votes
2 answers

Why doesn't playing audio stop other tasks?

If processors can only execute one thing at a time, how come I can play music continuously and still be able to run other tasks? I understand the interrupt system, but isn't it needed that CPU continuously process audio for it to not sound…
DreamIT
  • 103
  • 4
10
votes
4 answers

Exactly how many clocks does a Computer consists of and how do they synchronize with each other?

I am currently trying to understand how Computers are arranged and organized internally (so that I can learn Assembly Language) through an online book called The Art of Assembly by Randall Hyde. Irrespective of whether or not I'll learn Assembly,…
radiantshaw
  • 201
  • 2
  • 4
10
votes
7 answers

Mathematical benefit to use CPU/memory that increases by powers of 2 as 8-bit, 16-bit, 32-bit, 64-bit, etc?

Historically, processors often increase in bit-size by powers of 2, such as 8-bit, then 16-bit, 32-bit, 64-bit. Although this has not always been the case, it is a well known trend. One benefit is backwards compatibility. Another is that components…
BipedalJoe
  • 233
  • 2
  • 8
9
votes
1 answer

Where does the CPU get its first instructions from?

In order for the BIOS code to matter, it must be evaluated by the processor. However, the processor itself needs to do work to actually get access to the BIOS code, since the CPU only performs instructions that are given, something must give the…
Dmytro
  • 193
  • 1
  • 6
7
votes
4 answers

Can CPU's 'shortcut' adding 0, multiplying by 1, and multiplying by 0?

I am currently writing a program where a lot of adding 0 to numbers and multiplying by 1 and 0 occurs and it got me to wondering if the CPU 'shortcuts' (drops), these operations. I'm a CS student and this hasn't been brought up ever. Can a CPU do…
Azaral
  • 183
  • 1
  • 3
7
votes
2 answers

Does CPU without register exist?

Is existence of registers in CPU an obligation, Or we just do it for performance? Can we theoretically and practically have computer architectures that don't use registers? If yes, please name computer architecture and computer models that doesn't…
Mohammad Ha
  • 73
  • 1
  • 4
1
2 3
21 22