MCES-21CS43 Module-1 Notes
MCES-21CS43 Module-1 Notes
An ARM processor is one of a family of CPUs based on the RISC (reduced instruction set computer)
architecture developed by Acorn Computers in the 1980s. Now it is developed by Advanced RISC
Machines(ARM).
ARM does not make CPUs. They sell licenses for others to build and sell CPUs of their design and
architecture.
ARM makes 32-bit and 64-bit RISC multi-core processors.
Processors can have a single core or multiple cores. A processor with two cores is called a dual-core
processor and four cores are called a quad-core processor. The more cores a processor has, computation
isfaster.
A core is the processing unit which receives instructions and performs calculations, or actions, based on
thoseinstructions.
One of ARM’s most successful cores is the ARM7TDMI and is known for its high code density and low
powerconsumption.
ARM processors are extensively used in consumer electronic devices such as smartphones, tablets,
multimedia players and other mobile devices.
Because of their reduced instruction set, operate at a higher speed (executes millions of instructions per
second (MIPS), they require fewer transistors, which enables a smaller die size for the integrated
circuitry (IC) and lower power consumption.
Harvard architecture:
♦ Harvard machine has separate memories for data and program.
♦ A two set of address/data bus between CPU and memory, this increases the performance.
♦ Harvard allows two simultaneous memory fetches. Most DSPs use Harvard architecture
These design rules allow a RISC processor to be simpler, and thus the core can operate at higher clock
frequencies. In contrast, CISC processors are more complex and operate at lower clock frequencies
Figure shows a typical embedded device based on an ARM core. Each box represents a feature or
function. The lines connecting the boxes are the buses carrying data.
Four main hardware components:
The ARM processor controls the embedded device. Different versions of the ARM processor are
available to suit the desired operation.
Controllers coordinate important functional blocks of the system. Two commonly found controllers are
interrupt and memory controllers.
The peripherals: provide all the input-output capability external to the chip.
A bus is used to communicate between different parts of the device.
Memory
An embedded system has some form of memory to store and execute code.
Hierarchy
All computer systems have memory arranged in some form of hierarchy.
Figure shows the memory trade-offs: the fastest memory cache is physically located nearer the ARM
processor core and the slowest secondary memory is set further away.
Generally the closer memory is to the processor core, the more it costs and the smaller its capacity.
The cache is placed between main memory and the core. It is used to speed up data transfer between the
processor and main memory.
The main memory is large—around 256 KB to 256 MB (or even greater), depending on the application
Secondary storage is the largest and slowest form of memory. Hard disk drives and CD-ROM drives are
examples of secondary storage. These days secondary storage may vary from 600 MB to 60GB.
Types
Some of the most popular memory devices found in ARM-based embedded systems are:
Read-only memory (ROM) its main use is for storing long term data that needs to be preserved after
power is off.
Many devices also use a ROM to hold boot code.
Pipeline
A pipeline is the mechanism a RISC processor uses to execute instructions.
Using a pipeline speeds up execution by fetching the next instruction while other instructions are being
decoded and executed.
Figure shows a ARM7 three-stage pipeline:
Fetch: loads an instruction from memory or the instruction is fetched from memory.
Decode: identifies the instruction to be executed or the instruction’s opcode and operands are decoded
to determine what function to perform.
Execute: processes the instruction and writes the result back to a register or the decoded instruction is
executed.
Processor Modes:
The processor mode determines which registers are active and the access rights to the cpsr register.
Each processor mode is either privileged or non-privileged:
A privileged mode allows full read-write access to the cpsr.
A non-privileged mode only allows read access to the control field in the cpsr but still allows read-write
access to the condition flags.
There are seven processor modes in total: six privileged modes (abort, fast interrupt request, interrupt
request, supervisor, system, and undefined) and one non privileged mode (user).
The processor enters abort mode when there is a failed attempt to access memory.
Fast interrupt request and interrupt request modes correspond to the two interrupt levels available on the
ARM processor.
Supervisor mode is the mode that the processor is in after reset.
System mode is a special version of user mode that allows full read-write access to the cpsr.
Undefined mode is used when the processor encounters an instruction that is undefined or not supported
by the implementation.
User mode is used for programs and applications.
Figure shows all 37 registers in the register file. Of those, 20 registers are hidden from a program at
different times. These registers are called banked registers and are identified by the shading in the
diagram.
They are available only when the processor is in a particular mode; for example, abort mode has banked
registers r13_abt, r14_abt and spsr_abt.
Banked registers of a particular mode are denoted by_mode.
Every processor mode except user mode can change mode by writing directly to the mode bits of the
cpsr.
Figure also shows a new register appearing in interrupt request mode: r13_irq ,r14_irq and spsr.
The saved program status register (spsr), which stores the previous mode’s cpsr.
Conditional Execution
Conditional execution controls whether or not the core will execute an instruction.
Prior to execution, the processor compares the condition attribute with the condition flags in the cpsr.
If they match, then the instruction is executed; otherwise the instruction is ignored.
The condition attribute is post-fixed to the instruction mnemonic.
When a condition mnemonic is not present, the default behavior is to set it to always (AL)execute.
Second: Separate caches for data and instruction uses Harvard-style cores and has separate caches for
data and instruction.
Assignment Questions:
1. Explain the ARM design philosophy?5M
2. Explain the RISC design philosophy?5M
3. Explain embedded system hardware with diagrambriefly?8M
4. Mention any five differences between RISC and CISC?5M
5. Mention any five differences between µp and µc?5M
6. Explain embedded system software?4M
7. With neat diagram explain ARM core Data flow model?10M
8. Briefly explain various fields of CPSR with neat diagram?12M
9. What is pipeline? Explain ARM7 three stage pipeline?6M
10. What are Exceptions, Interrupts, and the Vector Table?8M
11. Explain with neat diagram ARM registers?7M
12. What is banked register? Explain with neat diagram.7M
13. What is the different state of ARM processor? Mention its instruction size and status of J and T bit?5M
14. Discuss briefly how coprocessors can be attached to ARM processor?5M
15. Explain the concept of pipeline and interrupts used in ARM processor?8M
16. Explain registers used under various modes?4M
17. Explain programmer’s model of ARM processor with complete register set available? 5M
18. Describe the various modes of operation of ARM processor? 7M
19. Explain the architecture of a typical embedded device based on ARM core with a neatdiagram?10M
20. Discuss the following with neat diagram.8M
a) Von Neumann architecture withCache
b) Harvard architecture with TCM