110 votes
Accepted

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

Addition is fast because CPU designers have put in the circuitry needed to make it fast. It does take significantly more gates than bitwise operations, but it is frequent enough that CPU designers ...
D.W.'s user avatar
  • 159k
58 votes

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

The question is: under what constraints? There are certainly problems where, if we ask the question "can we solve this problem on hardware X in the given amount of time", the answer will be no. But ...
Joey Eremondi's user avatar
48 votes
Accepted

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

If you don't care about the running time, anything you can do on a multi-core machine, you can do on a single-core machine. A multi-core machine is just a way of speeding up some kinds of ...
D.W.'s user avatar
  • 159k
43 votes

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

There are several aspects. The relative cost of a bitwise operation and an addition. A naive adder will have a gate-depth which depend linearly of the width of the word. There are alternative ...
AProgrammer's user avatar
  • 3,069
38 votes
Accepted

What does machine code actually look like while being run?

The best answer I can give is, it doesn't really "look" like anything. The instruction currently being executed by the CPU is represented by a series of wires, some of which have a high voltage, some ...
Draconis's user avatar
  • 7,138
38 votes
Accepted

What is a CPU clock physically?

Modern clocks are originally generated by quartz crystal oscillators of about 20MHz or so, and then the frequency is multiplied by one or more phase-locked loops to generate the clock signals for ...
user253751's user avatar
  • 1,739
30 votes
Accepted

What is a GPU year?

That means, one year of computation time on a single GPU (or half a year on two GPUs, or a quarter of a year on four GPUs, etc.). If you are thinking of using this term in your own writing, I ...
D.W.'s user avatar
  • 159k
29 votes
Accepted

How is conditional jump implemented in the CPU?

The problem: to define conditional jump we need a conditional jump? I mean in order to evaluate an IF the processor has to evaluate condition and IF it's true, then jump, otherwise not. It's an ...
harold's user avatar
  • 2,053
26 votes

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

CPUs operate in cycles. At each cycle, something happens. Usually, an instruction takes more cycles to execute, but multiple instructions are executed at the same time, in different states. For ...
Paul92's user avatar
  • 528
17 votes

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

As other answers have pointed out, a single CPU can always emulate multiple CPUs by slicing time and playing the role of each virtual CPU. This emulation will certainly calculate the correct answers. ...
Nayuki's user avatar
  • 881
16 votes

What course in CS deals with the study of RAM, CPU, Storage?

The subject you're describing often goes under the names computer architecture, computer systems, computer organization and design, and the like. One example is Elements of computing systems, based on ...
Yuval Filmus's user avatar
13 votes

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

Processors are clocked, so even if some instructions can clearly be done faster than others, they may well take the same number of cycles. You'll probably find that the circuitry required to ...
James Hollis's user avatar
12 votes

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

Addition is important enough to not have it wait for a carry bit to ripple through a 64-bit accumulator: the term for that is a carry-lookahead adder and they are basically part of 8-bit CPUs (and ...
user72735's user avatar
  • 121
11 votes

What does machine code actually look like while being run?

"Look like" implies a metaphor. If we take "what will it look like" literally, it's going to look like a fancy etched piece of silicon sitting on its motherboard. Clearly metaphor was the goal. To ...
Cort Ammon's user avatar
  • 3,351
11 votes
Accepted

Are multiple interrupts generated when I hold down a key on my keyboard?

TL;DR: No. It depends on the OS and the keyboard. I'll show you how to determine this yourself on a Linux machine. I'm using Ubuntu 16.04 on an x86 processor. So if you are using a fairly modern ...
Hadi Brais's user avatar
11 votes

What does the program counter do?

Since this is a simple CPU, it's almost certainly to compute branch targets. Branch instructions typically represent the location to branch to as a small signed number to add to the program counter. ...
Pseudonym's user avatar
  • 22.1k
11 votes

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

Multiplying and dividing binary integers by powers of 2 is very cheap, like multiplying and dividing by 10 for decimal numbers. It's qualitatively different from other factors because the other bits ...
Peter Cordes's user avatar
  • 1,055
10 votes
Accepted

Would removing the branch delay slots change the instructions set architecture?

The instructions set architecture (ISA) is the contract between the hardware designer and the software designer. Anything that changes the contract, changes the ISA. The question you have to answer ...
Wandering Logic's user avatar
10 votes
Accepted

Why does the program counter increment before an instruction is completed?

The exact details of when (or even how) to increment the program counter are implementation specific details. There are however a few considerations that come into play across most computers. After ...
Peter Camilleri's user avatar
10 votes

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

I think you'd be hard pressed to find a processor that had addition taking more cycles than a bitwise operation. Partly because most processors must carry out at least one addition per instruction ...
pjc50's user avatar
  • 411
10 votes
Accepted

What is instruction throughput and instruction latency?

Latency = time from the start of the instruction until the result is available. If your division has a latency of 26 cycles, and you calculate (((x / a) / b) / c), then the result of the division by a ...
gnasher729's user avatar
10 votes

What does machine code actually look like while being run?

Check out this video, in particular 1:00 to 1:17. That's exactly what it looks like when a program is running on a computer. The two rows of lights show the current contents of the address register ...
JavaLatte's user avatar
  • 211
9 votes

A multi-user, multi-processing operating system cannot be implemented on hardware that does not support

I remember a counter-example from the 1980s: OS-9/68000 was quite popular then: a multi-user, multi-processing real-time operating system for the Motorola 68K processor family, loosely patterned ...
R. Kleberhoff's user avatar
9 votes
Accepted

Where does the CPU get its first instructions from?

1. (A summary of the answer-in-comments by Jukka) Startup code is stored in ROM (non-volatile memory) at a fixed address X. When you activate the "reset" signal in the CPU, the CPU will initialise ...
Ran G.'s user avatar
  • 20.7k
9 votes

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

At the gate level, you are correct that it takes more work to do addition, and thus takes longer. However, that cost is sufficiently trivial that doesn't matter. Modern processors are clocked. You ...
Cort Ammon's user avatar
  • 3,351
9 votes
Accepted

Why doesn't playing audio stop other tasks?

Since the CPU works in fixed clock cycles, nothing is really continuous, only seems so because the discretization is sensitive enough. Suppose your CPU clock rate is $1\text{GHz}=10^9Hz$. If the CPU ...
Ariel's user avatar
  • 13.4k
9 votes

Why doesn't playing audio stop other tasks?

40 years ago, you might have had a computer where the CPU controlled the speaker directly. Those times are over, long ago. You may have a computer with a primitive sound card. Such a sound card will ...
gnasher729's user avatar
9 votes
Accepted

Does overclocking a cpu speed up a poorly optimised process?

Optimization is not really something that should be guessed at. Instead you need to measure what is going on to determine the chokepoints and where changes need to be made. A faster processor may ...
Richard Chambers's user avatar
9 votes
Accepted

What are the advantages of x86 CPUs over ARM?

I'll start with the commonly known stuff, that are currently talked about the most. x86 All x86 processors are developed from the CISC (Complex Instruction Set Computers) architecture. The x86 ...
Georgi U's user avatar
  • 114

Only top scored, non community-wiki answers of a minimum length are eligible