Week 4 Flashcards
What is the Octal System?
Base 8
symbols: 0,1,2,3,4,5,6,7
4096 512 64 8 1
8^4 8^3 8^2 8^1 8^0
What is the Binary System?
Base 10
10000 1000 100 10 1
10^4 10^3 10^2 10^1 10^0
What is the Hexadecimal System?
Base 16
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
65536 4096 256 16 1
16^4 16^3 16^2 16^1 16^0
What is the purpose of memory?
Stores both code and data
Memory is divided into units of 1 byte (8 bits)
Memory with 2^n addressable units requires n-bit addresses
8 bits = 256 addresses
32 bit = 2^32 addresses (roughly 4gb)
What is the CPU (Central Processing Unit)
Controls the execution of instructions
What are Registers (hint: memory locations)?
Small, fast memory locations within CPU
What is the purpose of General Purpose Registers?
Data storage, address calculations and arithmetic operations
What is the purpose of Special Purpose Registers?
One that has a specific control or data handling task to carry out
What is the Stack Pointer?
Points to the top of the stack
What is the Base Pointer (hint: current frame)?
Points to the start (base) of the current frame
What is the Link Register (LR) (hint: function completion)?
Stores return address for after function completion
What is a Program Counter (PC)?
Stores the address of the next instruction to be executed
What is the Arithmetic Logic Unit (ALU)?
The ALU handles arithmetic and logical operations
What is the Status Register (hint: contains)?
Contains status and mode bits
What are Assembly Languages?
Simple Instructions
Difficult programming language
What is Branching (Branch Instructions)?
Branch instructions will “jump” to a different instruction
They do so by changing the program counter
What is Temporal Locality?
Items accessed recently are likely to be accessed again soon
If you want to discard data, start with the one that has not been requested in a long time
What is Spatial Locality?
Items located near each other in memory are likely to be accessed within a short period of time
Most programs exhibit spatial location
Copy additional memory locations into the cache
What are the 2 outcomes of a memory request?
Cache hit
Cache miss
What is a Cache Hit?
Cache contains the data (faster data return)
What is a Cache Miss?
Cache does not contain requested data - first read from memory
What are the 3 Cache Designs?
Direct Mapping
Fully-associative Mapping
Set-associative Mapping
What is a Direct-Mapped Cache?
Each block of main memory maps to one unique cache line
What are the pros and cons of a Direct-Mapped Cache?
Pros:
Simple, easy to implement and search
Cons:
Inefficient use of the cache space