CPU and Memory Flashcards

1
Q

What are the three main components of a computer?

A

The CPU
The Memory
The I/O Devices

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

What does the arithmetic logic unit do?

A

Performs operations between two input registers putting the result in an output register

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

What is the definition of a bit, a byte, and a word?

A
Bit = 0 or 1
Byte = 8 Bits
Word = 2, 4 or 8 Bytes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the control unit do?

A

It fetches instructions from memory as determined by the program register counter.

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

Define temporal locality in the CPU

A

If an item in memory is referenced, then it is likely to be referenced again soon

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

How do programs exhibit spatial locality

A

If an item in memory is referenced, then it is likely that those nearby will be referenced soon

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

What is a cache hit and a cache miss?

A

A cache hit is where data can be read from the cache and a miss is where it has to be read from memory

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

What is a direct mapped cache?

A

A memory address is mapped to exactly one cache address

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

What is a fully associative cache?

A

A memory address is mapped to the least recently used memory address in the cache

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

What is an S-way associative cache?

A

The cache is divided into N slots, each cache set can store S memory blocks.

A memory address is mapped to exactly one cache set, and to the least recently used place in that set

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

S way set associative cache vs a 1 way associative cache

A

1 set of size S vs s sets of size 1

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

Dealing with a write hit

A

For a write hit, there are two options:
write-back — write into cache only
write-through — write into both cache and memory

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

Dealing with a write miss

A

For a write miss, there are two options:
write around — write into memory only
write allocate — write into memory and read into cache

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

Two types of write request

A

A write request may be
a write hit — the address we want to write to is present in the cache
a write miss — the address we want to write to is not present in the cache

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

What is virtual memory divided into?

A

Pages and addresses are seen as ( virtual page number, offset ) pairs

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

What is physical memory divided into?

A

Frames. Addresses are seen as (physical-frame-number, offset) pairs.

17
Q

What is a page table?

A

It maps virtual page numbers to physical frame numbers