Arch: Memory Flashcards

1
Q

SRAM and DRAM access times

A
  • SRAM: 0.5 to 2.5 ns
  • DRAM: 50 to 70 ns
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Access times for Flash and disk drives

A
  • Flash: 5000 to 50,000 ns
  • disk drive: 5,000,000 - 20,000,000 ns
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Memory hierarchy of a computer in ascending order?

A

Fastest to slowest

  • Registers
  • Caches ( 3 levels )
  • RAM
  • SSD
  • HDD
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Storage for registers, SSDs and HDDs

A
  1. Registers: 100s of bytes
  2. SDD: few 100s of GBs
  3. HDD: few TBs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Different levels of caches and their storage sizes

A
  • Level 1 cache: 10x kbs
  • Level 2 cache: 100x kbs
  • Level 3 cache: 1000x kbs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is nearline storage?

A

Archives of tapes controlled by robot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why do fast processors need to be small in size?

Why is there a hierarchy in the different types of memory.

A

If a processor has a clock cycle of 4GHz ( 4 billion clock cycles in 1 second ), then it can complete one clock cycle in about .25 nano seconds ( after doing the math ). Light can travel about 7.5 cm in that time (.25 ns) which is the time taken for one clock cycle. The speed of electric signals is about 2/3 of that of light at the best. Therefore, the farthest it can travel is about (2/3) * 7.5 = 5cm for one clock cycle. Therefore, the smaller the size, the less distance is to be travelled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are some other factors ( 7 ) that are to be considered while designing a process apart from speed.

A
  • Access Paradigms: serial vs random access
  • Writeability: write once , rewrite-able
  • Energy usage while idle and in use
  • Volatility: persistent data even when the power is off
  • latency vs bandwidth
  • density: space requirements
  • dependability and error correction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Most efficient way to make use of the memory technologies?

A
  • Keep most frequently used data in the fast memory
  • Everything else to be kept in the slow memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Disadvanatages of keeping a working copy of the data in the fast memory.

A
  • Need to maintain 2 copies of the data
  • Keeping them consistent is complex
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the concept of virtual memory and how does it work?

A

Virtual memory is the concept of using disks to create the illusion of extra RAM .

Combines:

  • Speed of the top level
  • Size of the bottom level
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Apart from extra RAM, what else is virtual memory used for and what are the drawbacks?

A

Virtual memory is also used for multi-tasking as each process gets its own virtual address space

Need to make sure that there is protection by making sure that stray pointers in one V address space cannot access another address space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the basics of caching.

A

In caching, data is split into small chunks or lines or pages

The address is split into a chunk identifier and an offset which refers to data within chunks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does caching work?

A

Data is divided into chunks for caching and some of these chunks are stored within the fast memory. When the user tries to access a chunk of data, one of 2 things can happen.

  • The chunk is present in the fast memory, then find where exactly in the fast memory and then access it from there.
  • Otherwise, it is not present in the fast memory then make space for it in the fast memory, get the chunk from the slow memory and store it in the fast memory and access it from there.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is spatial locality?

A

Memory that is accessed is often near memory that was accessed recently

Give an example

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is temporal locality?

A

Memory that is accessed frequently is often grouped together.

Give an example

17
Q

Direct Mapped Caching

A

Each chunk is allocated a specific place in memory and these can be occupied by multiple chunks one at a time.

There is a specific overhead to determine which chunk in the fast memory holds which chunk in the slow memory.

18
Q

Fully Associative Caching

A
19
Q

Name three instruction groups and give examples for those?

A

3 Instructions groups are:

  1. Data transfer
    1. mov,
  2. Arithmetic
    1. add, imul
  3. Control flow
    1. call, ret
20
Q

Which instruction exchanges source and destination?

A

The xchg instruction does this.

21
Q

What is write through?

A

Write through is when

  • Any changes or writes to the cache is immediately written to the main memory.
  • Keeps everything consistent as the main memory always has an upto date copy of the cache.
22
Q

What is write back?

A

In write back:

Writing to the cache is delayed

  • This saves time as the main memory is not constantly accessed for every write.
  • Requires dirty indicating that the cache line hasn’t been written to the main memory.