J.Ramprabu AP-2/EEE/KCT
J.Ramprabu AP-2/EEE/KCT
Ramprabu AP-2/EEE/KCT
CISC RISC
Compiler Greater
Compiler
complexity
Code generation
Code generation
J.Ramprabu AP-2/EEE/KCT
RISC MACHINE
(Reduced instruction set computer)
• INSTRUCTIONS – Less number of instructions that does simple
operations that can execute in single cycle.
1. Processor size is small and low power consumption (portable device like mobile phones).
4. Incorporated debug technology -where the software engineers can see what is happening
inside the processor while executing a program. So engineers can easily resolve the issues
easily.
9. J.Ramprabu
Enhanced instructions like (DSP AP-2/EEE/KCT
applications , 16 X 16 multiplication)
EMBEDDED SYSTEM HARDWARE
J.Ramprabu AP-2/EEE/KCT
The Main Hardware components of ARM
1. The ARM PROCESSOR – Controls the whole embedded
system
2. CONTROLLERS – Coordinates the important functional block
(Interrupt and memory controller)
3. The PERIPHERALS – are Responsible for the inputs and
outputs connected external to the chip.
4. BUS- ARM uses ON chip bus which connects peripherals inside the
ARM core (older days we use Peripheral component interconnect bus
( PCI) that connect pripherals externally or off chip eg x86 PC’s)
Secondary storage
Memory size
J.Ramprabu AP-2/EEE/KCT
PERIPHERALS
J.Ramprabu AP-2/EEE/KCT
EMBEDDED SYSTEM SOFTWARE
Applications Embedded system – needs software to
drive the hardware
Operating system Software – 4 typical component software
are required to control the embedded
Initialization Device drivers system
Hardware Device
Initialization code –It is the first code executed on the board sets up the parts in
the board before handing control to the operating system.
Operating system- provides infrastructure to control application and manages
hardware resources.
Device drivers- third component which gives software interface to peripherals.
Applications- Task required for a device (mobile phone rquires diary application)
J.Ramprabu AP-2/EEE/KCT
ARM CORE DATA FLOW MODEL
(Architecture)
Data
Instruction
decoder
Sign extend
Write Read
A B A B Acc
Address register
Incrementer
J.Ramprabu AP-2/EEE/KCT
Address
ARM CORE DATA FLOW MODEL
Instruction decoder – Translates the instruction before executed.
Sign extend – it is hardware which converts signed 8 bit and 16 bit numbers to
32 bit value (taken from memory placed in register).
ALU & MAC – Takes the value from source regist through bus A and B and
computes the result and data processing instruction write
the result in Rd to the register file.
Barrel shifter- Together ALU and barrel shifter calculate the wide range of
addresses
Address rergister– Address register hold the address calculated by ALU &
BS.
– r13 – Stack pointer (sp) – holds the address of the head of the stack
– r14 – Link register (lr) – Core puts the return address whenever it
calls subroutine
– r15 – Program counter – Stores the address of the next instruction
to be executed J.Ramprabu AP-2/EEE/KCT
CPSR- CURRENT PROGRAM STATUS REGISTER
• CPSR – used to monitor and control the internal operation.
J.Ramprabu AP-2/EEE/KCT
PROCESSOR MODES
1. Abort – When processor failed access to memory it enters the abort mode.
2. Fast interrupt request- processor respond to the int level & enters the mode.
3. interrupt request - processor respond to the int level & enters the mode.
4. Supervisor – The processor enters into the mode after reset.
5. System – Special version of user mode allows read write the CPSR.
6. Undefined – processor enters the mode when undefined instruction executed.
7. User – used for program and applications
Priviliged mode (6) – (Mode 1- 6) Allows full read wite access to CPSR
NON Priviliged mode (1) – (user Mode–7) allows read access to control fields
J.Ramprabu AP-2/EEE/KCT
The ARM Register Set
CurrentVisible
Current VisibleRegisters
Registers
r0
r0
Abort
Undef
SVC
IRQ
FIQ
User Mode
Mode
Mode
Mode
Mode
Mode r1
r1
r2
r2
r3
r3 Bankedout
Banked outRegisters
Registers
r4
r4
r5
r5
r6
r6 User
User FIQ
FIQ IRQ
IRQ SVC
SVC Undef
Undef Abort
r7
r7
r8
r8 r8 r8
r8
r9
r9 r9 r9
r9
r10
r10 r10 r10
r10
r11
r11 r11 r11
r11
r12
r12 r12 r12
r12
r13 (sp)
r13 (sp) r13 (sp)
r13 (sp) r13 (sp)
r13 (sp) r13
r13 (sp)
(sp) r13
r13 (sp)
(sp) r13
r13 (sp)
(sp) r13 (sp)
r14 (lr)
r14 (lr) r14 (lr)
r14 (lr) r14 (lr)
r14 (lr) r14
r14 (lr)
(lr) r14
r14 (lr)
(lr) r14
r14 (lr)
(lr) r14 (lr)
r15 (pc)
r15 (pc)
cpsr
cpsr
spsr
spsr spsr
spsr spsr
spsr spsr
spsr spsr
spsr spsr
J.Ramprabu AP-2/EEE/KCT
Register Organization Summary
User FIQ IRQ SVC Undef Abort
r0
r1
User
r2 mode
r3 r0-r7,
r4 r15, User User User User
and mode mode mode mode Thumb state
r5
cpsr r0-r12, r0-r12, r0-r12, r0-r12, Low registers
r6
r15, r15, r15, r15,
r7 and and and and
r8 r8 cpsr cpsr cpsr cpsr
r9 r9
r10 r10 Thumb state
r11 r11 High registers
r12 r12
r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp)
r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr)
r15 (pc)
cpsr
spsr spsr spsr spsr spsr
J.Ramprabu AP-2/EEE/KCT
PIPELINE
Pipeline ? – parallel operation which speed up the execution of the
processor.
ARM7 – 3 stage pipeline
Fetch Decode Execute
cycle1 ADD
J.Ramprabu AP-2/EEE/KCT
• The five stages of pipeline are:
1. Fetch – The instruction is fetched from the memory and stored
in the instruction register.
J.Ramprabu AP-2/EEE/KCT
• ARM 10 –
• It is a six stage pipeline. Which in turn takes 6
cycles to complete the process.
J.Ramprabu AP-2/EEE/KCT
• An interrupt is a condition that makes the
CPU suspend the current program and
execute an ISR.
• An ISR is a specially written program to
service the condition that caused the
interrupt. After an interrupt is serviced, the
CPU returns to the main program, exactly at
the next instruction where it had left.
• Interrupt vectors are addresses that
inform the interrupt handler as to where to
find the ISR
J.Ramprabu AP-2/EEE/KCT
VECTOR TABLE ADDRESS
J.Ramprabu AP-2/EEE/KCT
• Reset vector is the location of the first instruction executed by the processor
when poweris applied. This instruction branches to the initialization code.
J.Ramprabu AP-2/EEE/KCT
ARM THUMB JAZELLE
J.Ramprabu AP-2/EEE/KCT
Condition codes
J.Ramprabu AP-2/EEE/KCT
ARM NOMENCLATURE
J.Ramprabu AP-2/EEE/KCT
ARM FAMILIES
J.Ramprabu AP-2/EEE/KCT
Example of an instruction with
Three operands
J.Ramprabu AP-2/EEE/KCT
Data Processing Instructions
• Move Instructions
J.Ramprabu AP-2/EEE/KCT
• Barrel Shifter:-
• A unique and powerful feature of the ARM processor is the ability to shift the
32-bit binary pattern in one of the source registers left or right by a specific
number of positions before it enters the ALU.
J.Ramprabu AP-2/EEE/KCT
J.Ramprabu AP-2/EEE/KCT
J.Ramprabu AP-2/EEE/KCT
Arithmetic Instructions
J.Ramprabu AP-2/EEE/KCT
J.Ramprabu AP-2/EEE/KCT
Using the Barrel Shifter with
Arithmetic
Instructions
• Register r1 is first shifted one location to the left to give the value of twice
r1. The ADD instruction then adds the result of the barrel shift operation to
register r1. The final resulttransferred into register r0 is equal to three times
the value stored in register r1.
J.Ramprabu AP-2/EEE/KCT
Logical Instructions
J.Ramprabu AP-2/EEE/KCT
Comparison Instructions
J.Ramprabu AP-2/EEE/KCT
Multiply Instructions
J.Ramprabu AP-2/EEE/KCT
J.Ramprabu AP-2/EEE/KCT