CPU and Memory Flashcards
What are the three main components of a computer?
The CPU
The Memory
The I/O Devices
What does the arithmetic logic unit do?
Performs operations between two input registers putting the result in an output register
What is the definition of a bit, a byte, and a word?
Bit = 0 or 1 Byte = 8 Bits Word = 2, 4 or 8 Bytes
What does the control unit do?
It fetches instructions from memory as determined by the program register counter.
Define temporal locality in the CPU
If an item in memory is referenced, then it is likely to be referenced again soon
How do programs exhibit spatial locality
If an item in memory is referenced, then it is likely that those nearby will be referenced soon
What is a cache hit and a cache miss?
A cache hit is where data can be read from the cache and a miss is where it has to be read from memory
What is a direct mapped cache?
A memory address is mapped to exactly one cache address
What is a fully associative cache?
A memory address is mapped to the least recently used memory address in the cache
What is an S-way associative cache?
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
S way set associative cache vs a 1 way associative cache
1 set of size S vs s sets of size 1
Dealing with a write hit
For a write hit, there are two options:
write-back — write into cache only
write-through — write into both cache and memory
Dealing with a write miss
For a write miss, there are two options:
write around — write into memory only
write allocate — write into memory and read into cache
Two types of write request
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
What is virtual memory divided into?
Pages and addresses are seen as ( virtual page number, offset ) pairs