33
votes
Accepted
How do computers remember where they store things?
I'd suggest you look into the wonderful world of Compiler Construction! The answer is that it's a bit of a complicated process.
To try to give you an intuition, remember that variable names are ...
27
votes
Accepted
If the virtual address space can be larger than the physical address space, how are the address mappings stored in memory?
The trick to making this work is "paging." When bringing data from a hard disk into physical memory, you don't just bring a few bytes. You bring an entire page. 4k bytes is a very common page size.
...
24
votes
How do computers remember where they store things?
When a computer stores a variable, when a program needs to get the variable's value, how does the computer know where to look in memory for that variable's value?
The program tells it. Computers do ...
7
votes
Accepted
RAM can be accessed hundreds of times faster than a hard drive. Explain How?
Wikipedia has great information on this topic, but as a brief, simplified explanation, know that it boils down mainly to the involvement of mechanical moving parts in a traditional Hard Disk Drive (...
6
votes
Accepted
Relevance of memory reads while calculating the time complexity of an algorithm
For a memory read to be relevant to the algorithm, the information read in must be processed in some way.
If the information is never compared or used as input to any operator, it will not affect the ...
6
votes
Why sequential access is faster than random access?
They are talking about two different things.
One is about a medium that supports sequential access versus random access. The other is about reading data that is arranged sequentially or spread out ...
6
votes
Accepted
What are pointers in low-level language like C
In general, a pointer is a variable which holds the address of a variable. You can use https://godbolt.org/ to find out the assembly equivalent of a pointer. For example,
...
6
votes
How to allocate memory in NASM without C functions (x64)?
On Linux you can use the brk syscall to extend you data segment.
First call brk(0) to find the break point and then extend your ...
5
votes
Are constants faster than variables?
Some machine instruction sets include instructions for which 'small' constants are part of the instruction, either explicitly or implicitly. E.g the set of 'add' instructions can include 'add ...
5
votes
Accepted
Cache effective access time calculation
This is the kind of case where all you need to do is to find and follow the definitions. There is nothing more you need to know semantically. What is actually happening in the physically world should ...
5
votes
Why don't integer multiplication algorithms use lookup tables?
If you want to use lookup tables, and you have 4GB of memory, you'll only be able to use a lookup table with about $2^{32}$ entries or fewer, so you'll only be able to handle multiplication of numbers ...
D.W.♦
- 164k
5
votes
Accepted
How does a TLB lookup compare all keys simultaneously?
Computer hardware is fundamentally parallel. Even a modern single CPU core is pipelined, meaning that at the same instant in time, one physical part of the CPU is initiating a fetch of an instruction,...
4
votes
How does RAM is shared in multi core environment?
Memory access is not fully independent.
As long as the cores work on different memory ranges (with distance considerably larger than the size of a "cache line", which caches consecutive memory values)...
4
votes
Understanding non-faulting and faulting software prefetches
It's unclear what you mean.
A prefetch is faulting exactly when the actual access to the same data would be faulting.
On the other hand, hardware that allows pre-fetches might not actually ...
4
votes
Accepted
Does word addressable memory have more bytes than byte addressable memory?
If you had a byte addressable architecture where pointers have a fixed size, and every or almost every bit pattern is a valid pointer to a distinct byte address, and a word addressable architecture ...
4
votes
Accepted
Row Major Vs Column Major Order: 2D arrays access in programming languages
The way you access the array affects performance.
It depends on how the matrix is represented and stored in memory. Often a matrix is stored in row-major order, so that consecutive elements of a row ...
D.W.♦
- 164k
4
votes
Exactly why the time taken by 'memory reads', is not considered while calculating time complexity of an algorithm?
People don't usually refer to the hard drive as "memory" though the term "external memory" is common in this area of the literature. As far as disk accesses are concerned, they are taken into account ...
4
votes
Accepted
Question on "Hitting the memory wall, implications of the obvious"
You have it backwards. $t_m$ is what's growing exponentially relative to $t_c$. Or rather, $t_c$ is decreasing exponentially at a rate faster than $t_m$. $t_c$ and $t_m$ are the times the accesses ...
4
votes
Accepted
Valid bit incoherence between TLB and Page Table
The typical scenario where this kind of incoherence can occur is when the page table has been changed. In this case, an invalid PTE has become valid; perhaps the area of address space has been ...
4
votes
Accepted
Why don't integer multiplication algorithms use lookup tables?
Some integer multiplication algorithms do use lookup tables.
The IBM 1620 Model I "CADET" lacked a conventional ALU:
addition and subtraction used a 100 digit table; multiplication used a ...
4
votes
In a DBMS what are the implementation details that make set operations faster than cursors?
Set-based operations are iterative at a "low level", and are not necessarily any faster to execute than cursors under all circumstances.
The main advantage with set-based operations is that ...
4
votes
Accepted
Are there absolute reasons to prefer row/column-major memory ordering?
Whether row-major or column-major order is more efficient, depends on the storage access patterns of a specific application.
The underlying principle of computing is that accessing storage in ...
4
votes
Accepted
How are processor instructions stored in RAM?
Some processors - generally, 32-bit RISC ones - make sure that all instructions fit in one location in memory. This works for them because 32 bits is enough to fit plenty of instructions, and it makes ...
3
votes
Does word addressable memory have more bytes than byte addressable memory?
How is it possible that tha same ram, i.e given the ram size is 4 GB, would contain different number of bytes depending on byte/ word addressable memory?
It isn't. a 4GB amount of ram would either ...
3
votes
Accepted
How does RAM is shared in multi core environment?
I learnt that multi core processors have more than one processing units
Well having more than one processing unit is something present even outside multi-code processors. Processors which are able ...
3
votes
How does a computer determine the data type of a byte?
Datatypes are not a hardware feature. The CPU knows a couple (well, a lot) of
different commands. Those are called the instruction set of a CPU.
One of the
best known ones is the x86 instruction set.
...
3
votes
Relevance of memory reads while calculating the time complexity of an algorithm
If you follow D.W.'s definition, a "memory read operation" is an operation and can read only one item from memory, so from that definition alone the number of operations must be the same or larger ...
3
votes
Is PREFETCH an asynchronous operation?
If it is implemented in hardware, prefetching is typically done asynchronously.
It's also possible for a compiler to insert extra prefetch instructions into the code. Thus, the initiation of the ...
D.W.♦
- 164k
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
memory-access × 170computer-architecture × 60
memory-management × 43
memory-hardware × 43
cpu-cache × 34
cpu × 21
memory-allocation × 20
operating-systems × 17
virtual-memory × 15
algorithms × 10
data-structures × 7
algorithm-analysis × 5
performance × 5
c × 5
assembly × 5
cache × 5
asymptotics × 3
terminology × 3
binary-trees × 3
arrays × 3
time-complexity × 2
runtime-analysis × 2
databases × 2
c++ × 2
multiplication × 2