The CPU starts by fetching the reset vector, then uses the memory map to find which memory region an address belongs to, such as ROM, RAM, or peripherals, and accesses it accordingly.
Execution Sample
ARM Architecture
Address = 0x00000000
If Address in ROM:
Read instruction
Else if Address in RAM:
Read/Write data
Else if Address in Peripherals:
Access device registers
This simple logic shows how the CPU decides what to do based on the address range in the ARM memory map.
Analysis Table
Step
Address
Memory Region
Action
Result
1
0x00000000
ROM
Read instruction
Instruction fetched from ROM
2
0x20000000
RAM
Write data
Data stored in RAM
3
0x40000000
Peripherals
Access device registers
Peripheral device controlled
4
0x60000000
Undefined
No access
Access fault or ignored
💡 Execution stops when an invalid address outside defined memory regions is accessed.
State Tracker
Variable
Start
After Step 1
After Step 2
After Step 3
After Step 4
Address
N/A
0x00000000
0x20000000
0x40000000
0x60000000
Memory Region
N/A
ROM
RAM
Peripherals
Undefined
Action
N/A
Read instruction
Write data
Access device registers
No access
Result
N/A
Instruction fetched
Data stored
Peripheral controlled
Access fault
Key Insights - 3 Insights
Why does the CPU read instructions from ROM but write data to RAM?
ROM is read-only memory where program instructions are stored permanently, so the CPU reads instructions from there. RAM is read-write memory used for temporary data storage, so the CPU can write data there. This is shown in execution_table steps 1 and 2.
What happens if the CPU tries to access an address not defined in the memory map?
Accessing an undefined address causes an access fault or is ignored, as shown in step 4 of the execution_table where the address 0x60000000 is outside known regions.
How does the CPU know which memory region an address belongs to?
The CPU uses the memory map ranges to check the address. For example, addresses starting at 0x00000000 belong to ROM, 0x20000000 to RAM, and 0x40000000 to peripherals, as shown in the concept_flow and execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what memory region does address 0x20000000 belong to at step 2?
ARAM
BPeripherals
CROM
DUndefined
💡 Hint
Check the 'Memory Region' column in execution_table row for step 2.
At which step does the CPU perform a write operation to memory?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Look at the 'Action' column in execution_table to find where 'Write data' occurs.
If the address 0x40000000 was changed to 0x10000000, what would happen according to the memory map?
ARead instruction from ROM
BAccess fault
CWrite data to RAM
DAccess peripheral device
💡 Hint
Refer to the address ranges in the concept_flow and execution_table to see where 0x10000000 fits.
Concept Snapshot
ARM Memory Map Overview:
- CPU uses memory map to find address regions
- ROM (e.g., 0x00000000) stores instructions (read-only)
- RAM (e.g., 0x20000000) stores data (read/write)
- Peripherals (e.g., 0x40000000) control devices
- Access outside defined regions causes faults
Full Transcript
The ARM CPU starts execution by fetching the reset vector from a specific address in ROM. It uses the memory map to determine which memory region an address belongs to. Addresses in ROM are used to read instructions, RAM addresses are used for reading and writing data, and peripheral addresses are used to control hardware devices. If the CPU tries to access an address outside these defined regions, it results in an access fault or no operation. This process ensures the CPU interacts correctly with different types of memory and devices during program execution.
Practice
(1/5)
1. Which memory region in the ARM memory map is typically used to store the program code that does not change during execution?
easy
A. ROM (Read-Only Memory)
B. RAM (Random Access Memory)
C. Peripheral registers
D. System control registers
Solution
Step 1: Understand the purpose of ROM
ROM is used to store code and data that should not be changed during program execution, such as firmware or boot code.
Step 2: Compare with other memory types
RAM is for temporary data storage, peripherals control hardware devices, and system control registers manage system settings.
Final Answer:
ROM (Read-Only Memory) -> Option A
Quick Check:
Non-changeable program code = ROM [OK]
Hint: Code that doesn't change is stored in ROM [OK]
Common Mistakes:
Confusing RAM with ROM
Thinking peripherals store program code
Assuming system control holds program instructions
2. Which of the following is the correct syntax to represent the start address of RAM in an ARM memory map?
easy
A. 0x00000000
B. 0xE0000000
C. 0x20000000
D. 0x40000000
Solution
Step 1: Recall standard ARM memory map addresses
RAM typically starts at address 0x20000000 in many ARM Cortex-M microcontrollers.
Step 2: Identify other addresses
0x00000000 is usually ROM start, 0x40000000 is peripheral base, and 0xE0000000 is system control space.
Final Answer:
0x20000000 -> Option C
Quick Check:
RAM start address = 0x20000000 [OK]
Hint: RAM usually starts at 0x20000000 in ARM maps [OK]
Common Mistakes:
Mixing ROM and RAM start addresses
Confusing peripheral and system control addresses
Using decimal instead of hex notation
3. Given the ARM memory map where peripherals start at 0x40000000 and RAM ends at 0x3FFFFFFF, what happens if a program tries to access address 0x3FFF0000?
medium
A. Accesses peripheral registers
B. Accesses RAM memory
C. Causes a memory fault
D. Accesses ROM memory
Solution
Step 1: Analyze the address ranges
RAM ends at 0x3FFFFFFF, so any address below or equal to this is in RAM.
Step 2: Check the given address
0x3FFF0000 is less than 0x3FFFFFFF, so it lies within RAM.
Final Answer:
Accesses RAM memory -> Option B
Quick Check:
Address < RAM end = RAM access [OK]
Hint: Address below RAM end means RAM access [OK]
Common Mistakes:
Assuming peripherals start at 0x3FFF0000
Confusing RAM end with peripheral start
Thinking address causes fault without checking range
4. A developer tries to access system control registers at address 0xE0001000 but gets a fault. What is the most likely cause?
medium
A. The memory map is incorrectly configured
B. The system control registers are write-protected
C. The address is outside the system control region
D. The address is in the peripheral region
Solution
Step 1: Verify system control address range
System control registers usually start at 0xE0000000 and cover a specific range including 0xE0001000.
Step 2: Consider causes of fault
If access faults, it often means memory map settings (like MPU or MMU) block access.
Final Answer:
The memory map is incorrectly configured -> Option A
Quick Check:
Fault at valid address = memory map config error [OK]
Hint: Fault at valid address usually means config error [OK]
Common Mistakes:
Assuming address is outside system control
Thinking write protection causes fault always
Confusing peripheral and system control regions
5. You need to design a memory layout for an ARM system where RAM starts at 0x20000000 and must not overlap with peripherals starting at 0x40000000. If RAM size is 0x1FFF0000 bytes, what is the highest valid RAM address?