SlideShare a Scribd company logo
1 of 44
1
ARM
The first encounter
Authors:
Nemanja Perovic, nemanjaizbg@yahoo.com
Prof. Dr. Veljko Milutinovic, vm@etf.bg.ac.yu
2
What Is ARM?
Advanced RISC Machine
First RISC microprocessor
for commercial use
Market-leader for low-power
and cost-sensitive embedded applications
3
ARM Powered Products
4
Features
Architectural simplicity
which allows
Very small implementations
which result in
Very low power consumption
5
The History of ARM
Developed at Acorn Computers Limited,
of Cambridge, England,
between 1983 and 1985
Problems with CISC:
Slower then memory parts
Clock cycles per instruction
6
The History of ARM (2)
Solution – the Berkeley RISC I:
Competitive
Easy to develop (less than a year)
Cheap
Pointing the way to the future
7
ARM Architecture
Typical RISC architecture:
Large uniform register file
Load/store architecture
Simple addressing modes
Uniform and fixed-length instruction fields
8
ARM Architecture (2)
Enhancements:
Each instruction controls the ALU and shifter
Auto-increment
and auto-decrement addressing modes
Multiple Load/Store
Conditional execution
9
ARM Architecture (3)
Results:
High performance
Low code size
Low power consumption
Low silicon area
10
Pipeline Organization
Increases speed –
most instructions executed in single cycle
Versions:
 3-stage (ARM7TDMI and earlier)
 5-stage (ARMS, ARM9TDMI)
 6-stage (ARM10TDMI)
11
Pipeline Organization (2)
3-stage pipeline: Fetch – Decode - Execute
Three-cycle latency,
one instruction per cycle throughput
cycle
Fetch Decode Execute
Fetch Decode Execute
Fetch Decode Execute
i
n
s
t
r
u
c
t
i
o
n
t t+1 t+2 t+3 t+4
i
i+1
i+2
12
Write-back
Buffer/data
Execute
Decode
Pipeline Organization (3)
5-stage pipeline:
 Reduces work per cycle =>
allows higher clock frequency
 Separates data and
instruction memory =>
reduction of CPI
(average number
of clock Cycles Per Instruction)
Stages:
Fetch
13
Pipeline Organization (4)
Pipeline flushed and refilled on branch,
causing execution to slow down
Special features in instruction set
eliminate small jumps in code
to obtain the best flow through pipeline
14
Operating Modes
Seven operating modes:
 User
 Privileged:
System (version 4 and above)
FIQ
IRQ
Abort
Undefined
Supervisor
exception modes
15
Operating Modes (2)
User mode:
 Normal program
execution mode
 System resources
unavailable
 Mode changed
by exception only
Exception modes:
 Entered
upon exception
 Full access
to system resources
 Mode changed freely
16
Exceptions
Table 1 - Exception types, sorted by Interrupt Vector addresses
Exception Mode Priority IV Address
Reset Supervisor 1 0x00000000
Undefined instruction Undefined 6 0x00000004
Software interrupt Supervisor 6 0x00000008
Prefetch Abort Abort 5 0x0000000C
Data Abort Abort 2 0x00000010
Interrupt IRQ 4 0x00000018
Fast interrupt FIQ 3 0x0000001C
17
ARM Registers
31 general-purpose 32-bit registers
16 visible, R0 – R15
Others speed up the exception process
18
ARM Registers (2)
Special roles:
 Hardware
R14 – Link Register (LR):
optionally holds return address
for branch instructions
R15 – Program Counter (PC)
 Software
R13 - Stack Pointer (SP)
19
ARM Registers (3)
Current Program Status Register (CPSR)
Saved Program Status Register (SPSR)
On exception, entering mod mode:
 (PC + 4)  LR
 CPSR  SPSR_mod
 PC  IV address
 R13, R14 replaced by R13_mod, R14_mod
 In case of FIQ mode R7 – R12 also replaced
20
ARM Registers (4)
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13
R14
R15 (PC)
CPSR
System & User
R0
R1
R2
R3
R4
R5
R6
R7_fiq
R8_fiq
R9_fiq
R10_fiq
R11_fiq
R12_fiq
R13_fiq
R14_fiq
R15 (PC)
CPSR
SPSR_fiq
FIQ
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13_irq
R14_irq
R15 (PC)
CPSR
SPSR_irq
IRQ
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13_svc
R14_svc
R15 (PC)
CPSR
SPSR_svc
Supervisor
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13_abt
R14_abt
R15 (PC)
CPSR
SPSR_abt
Abort
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13_und
R14_und
R15 (PC)
CPSR
SPSR_und
Undefined
21
Instruction Set
Two instruction sets:
 ARM
Standard 32-bit instruction set
 THUMB
16-bit compressed form
Code density better than most CISC
Dynamic decompression in pipeline
22
ARM Instruction Set
Features:
 Load/Store architecture
 3-address data processing instructions
 Conditional execution
 Load/Store multiple registers
 Shift & ALU operation in single clock cycle
23
ARM Instruction Set (2)
Conditional execution:
 Each data processing instruction
prefixed by condition code
 Result – smooth flow of instructions through pipeline
 16 condition codes:
EQ equal MI negative HI
unsigned
higher
GT
signed greater
than
NE not equal PL
positive or
zero
LS
unsigned
lower or same
LE
signed less
than or equal
CS
unsigned
higher or
same
VS overflow GE
signed greater
than or equal
AL always
CC
unsigned
lower
VC no overflow LT
signed less
than
NV
special
purpose
24
ARM Instruction Set (3)
ARM instruction set
Data processing
instructions
Data transfer
instructions
Software interrupt
instructions
Block transfer
instructions
Multiply instructions
Branching instructions
25
Data Processing Instructions
Arithmetic and logical operations
3-address format:
 Two 32-bit operands
(op1 is register, op2 is register or immediate)
 32-bit result placed in a register
Barrel shifter for op2 allows full 32-bit shift
within instruction cycle
26
Data Processing Instructions (2)
Arithmetic operations:
 ADD, ADDC, SUB, SUBC, RSB, RSC
Bit-wise logical operations:
 AND, EOR, ORR, BIC
Register movement operations:
 MOV, MVN
Comparison operations:
 TST, TEQ, CMP, CMN
27
Data Processing Instructions (3)
Conditional codes
+
Data processing instructions
+
Barrel shifter
=
Powerful tools for efficient coded programs
28
Data Processing Instructions (4)
e.g.:
if (z==1) R1=R2+(R3*4)
compiles to
EQADDS R1,R2,R3, LSL #2
( SINGLE INSTRUCTION ! )
29
Data Transfer Instructions
Load/store instructions
Used to move signed and unsigned
Word, Half Word and Byte to and from registers
Can be used to load PC
(if target address is beyond branch instruction range)
LDR Load Word STR Store Word
LDRH Load Half Word STRH Store Half Word
LDRSH Load Signed Half Word STRSH Store Signed Half Word
LDRB Load Byte STRB Store Byte
LDRSB Load Signed Byte STRSB Store Signed Byte
30
Block Transfer Instructions
Load/Store Multiple instructions
(LDM/STM)
Whole register bank or a subset
copied to memory or restored
with single instruction
R0
R1
R2
R14
R15
Mi
Mi+1
Mi+2
Mi+14
Mi+15
LDM
STM
31
Swap Instruction
Exchanges a word
between registers
Two cycles
but
single atomic action
Support for RT
semaphores
R0
R1
R2
R7
R8
R15
32
Modifying the Status Registers
Only indirectly
MSR moves contents
from CPSR/SPSR
to selected GPR
MRS moves contents
from selected GPR
to CPSR/SPSR
Only in privileged
modes
R0
R1
R7
R8
R14
R15
CPSR
SPSR
MSR
MRS
33
Multiply Instructions
Integer multiplication (32-bit result)
Long integer multiplication (64-bit result)
Built in Multiply Accumulate Unit (MAC)
Multiply and accumulate instructions add product
to running total
34
Multiply Instructions
Instructions:
MUL Multiply 32-bit result
MULA Multiply accumulate 32-bit result
UMULL Unsigned multiply 64-bit result
UMLAL Unsigned multiply accumulate 64-bit result
SMULL Signed multiply 64-bit result
SMLAL Signed multiply accumulate 64-bit result
35
Software Interrupt
SWI instruction
 Forces CPU into supervisor mode
 Usage: SWI #n
 Maximum 224 calls
 Suitable for running privileged code and
making OS calls
Cond Opcode Ordinal
31 28 27 24 23 0
36
Branching Instructions
Branch (B):
jumps forwards/backwards
up to 32 MB
Branch link (BL):
same + saves (PC+4) in LR
Suitable for function call/return
Condition codes for conditional branches
37
Branching Instructions (2)
Branch exchange (BX) and
Branch link exchange (BLX):
same as B/BL +
exchange instruction set (ARM  THUMB)
Only way to swap sets
38
Thumb Instruction Set
Compressed form of ARM
 Instructions stored as 16-bit,
 Decompressed into ARM instructions and
 Executed
Lower performance (ARM 40% faster)
Higher density (THUMB saves 30% space)
Optimal –
“interworking” (combining two sets) –
compiler supported
39
THUMB Instruction Set (2)
More traditional:
 No condition codes
 Two-address data processing instructions
Access to R0 – R8 restricted to
 MOV, ADD, CMP
PUSH/POP for stack manipulation
 Descending stack (SP hardwired to R13)
40
THUMB Instruction Set (3)
No MSR and MRS,
must change to ARM to modify CPSR
(change using BX or BLX)
ARM entered automatically after RESET
or entering exception mode
Maximum 255 SWI calls
41
The Next Step
New ARM Cortex family of processors
 New NEON™ media and
signal processing extensions
 Thumb®-2 blended 16/32-bit instruction set
for performance and low power
 Improved Interrupt handling
42
Summary
Adoption of ARM technology
has increased efficiency and lowered costs
ARM is the world’s leading architecture today
 3 billion ARM Powered chips and counting
43
References
www.arm.com
ARM Limited ARM Architecture Reference Manual,
Addison Wesley, June 2000
Trevor Martin The Insiders Guide To The Philips ARM7-
Based Microcontrollers, Hitex (UK) Ltd., February 2005
Steve Furber ARM System-On-Chip Architecture
(2nd edition), Addison Wesley, March 2000
44
The End
Authors:
Nemanja Perovic, nemanjaizbg@yahoo.com
Prof. Dr. Veljko Milutinovic, vm@etf.bg.ac.yu

More Related Content

Similar to ARM_2.ppt

Similar to ARM_2.ppt (20)

ARM Micro-controller
ARM Micro-controllerARM Micro-controller
ARM Micro-controller
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
Arm corrected ppt
Arm corrected pptArm corrected ppt
Arm corrected ppt
 
arm 7 microprocessor architecture ans pin diagram.ppt
arm 7 microprocessor architecture ans pin diagram.pptarm 7 microprocessor architecture ans pin diagram.ppt
arm 7 microprocessor architecture ans pin diagram.ppt
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
arm-intro.ppt
arm-intro.pptarm-intro.ppt
arm-intro.ppt
 
arm_3.ppt
arm_3.pptarm_3.ppt
arm_3.ppt
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
EC8791 ARM Processor and Peripherals.pptx
EC8791 ARM Processor and Peripherals.pptxEC8791 ARM Processor and Peripherals.pptx
EC8791 ARM Processor and Peripherals.pptx
 
ARM stacks, subroutines, Cortex M3, LPC 214X
ARM  stacks, subroutines, Cortex M3, LPC 214XARM  stacks, subroutines, Cortex M3, LPC 214X
ARM stacks, subroutines, Cortex M3, LPC 214X
 
Arm cortex-m4 programmer model
Arm cortex-m4 programmer modelArm cortex-m4 programmer model
Arm cortex-m4 programmer model
 
ARM - Advance RISC Machine
ARM - Advance RISC MachineARM - Advance RISC Machine
ARM - Advance RISC Machine
 
arm
armarm
arm
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
 
06. thumb instructions
06. thumb instructions06. thumb instructions
06. thumb instructions
 
A0220105
A0220105A0220105
A0220105
 
Lecture8
Lecture8Lecture8
Lecture8
 
80x86_2.pdf
80x86_2.pdf80x86_2.pdf
80x86_2.pdf
 
heuring_jordan_----------ch02(1) (1).pptx
heuring_jordan_----------ch02(1) (1).pptxheuring_jordan_----------ch02(1) (1).pptx
heuring_jordan_----------ch02(1) (1).pptx
 

More from MostafaParvin1

ARM Embedded System Essentials + ZLG.docx
ARM Embedded System Essentials + ZLG.docxARM Embedded System Essentials + ZLG.docx
ARM Embedded System Essentials + ZLG.docxMostafaParvin1
 
ARM 嵌入式系统实验教程(二)扩展实验.docx
ARM 嵌入式系统实验教程(二)扩展实验.docxARM 嵌入式系统实验教程(二)扩展实验.docx
ARM 嵌入式系统实验教程(二)扩展实验.docxMostafaParvin1
 
ARM 嵌入式系统实验教程(1).docx
ARM 嵌入式系统实验教程(1).docxARM 嵌入式系统实验教程(1).docx
ARM 嵌入式系统实验教程(1).docxMostafaParvin1
 
20090814102834_嵌入式C与C++语言精华文章集锦.docx
20090814102834_嵌入式C与C++语言精华文章集锦.docx20090814102834_嵌入式C与C++语言精华文章集锦.docx
20090814102834_嵌入式C与C++语言精华文章集锦.docxMostafaParvin1
 

More from MostafaParvin1 (10)

ARMInst.ppt
ARMInst.pptARMInst.ppt
ARMInst.ppt
 
ARM.ppt
ARM.pptARM.ppt
ARM.ppt
 
ARM11.ppt
ARM11.pptARM11.ppt
ARM11.ppt
 
ARM7_Architecture.ppt
ARM7_Architecture.pptARM7_Architecture.ppt
ARM7_Architecture.ppt
 
ARM7TDMI-S_CPU.ppt
ARM7TDMI-S_CPU.pptARM7TDMI-S_CPU.ppt
ARM7TDMI-S_CPU.ppt
 
ARM Embedded System Essentials + ZLG.docx
ARM Embedded System Essentials + ZLG.docxARM Embedded System Essentials + ZLG.docx
ARM Embedded System Essentials + ZLG.docx
 
ARM 嵌入式系统实验教程(二)扩展实验.docx
ARM 嵌入式系统实验教程(二)扩展实验.docxARM 嵌入式系统实验教程(二)扩展实验.docx
ARM 嵌入式系统实验教程(二)扩展实验.docx
 
ARM 嵌入式系统实验教程(1).docx
ARM 嵌入式系统实验教程(1).docxARM 嵌入式系统实验教程(1).docx
ARM 嵌入式系统实验教程(1).docx
 
20090814102834_嵌入式C与C++语言精华文章集锦.docx
20090814102834_嵌入式C与C++语言精华文章集锦.docx20090814102834_嵌入式C与C++语言精华文章集锦.docx
20090814102834_嵌入式C与C++语言精华文章集锦.docx
 
IOT Persentation1.pdf
IOT Persentation1.pdfIOT Persentation1.pdf
IOT Persentation1.pdf
 

Recently uploaded

怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证tufbav
 
Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证wpkuukw
 
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...drmarathore
 
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...samsungultra782445
 
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证wpkuukw
 
Point of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryPoint of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryoyebolasonuga14
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证wpkuukw
 
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信oopacde
 
Hilti's Latest Battery - Hire Depot.pptx
Hilti's Latest Battery - Hire Depot.pptxHilti's Latest Battery - Hire Depot.pptx
Hilti's Latest Battery - Hire Depot.pptxhiredepot6
 
Guwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime Guwahati
Guwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime GuwahatiGuwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime Guwahati
Guwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime Guwahatimeghakumariji156
 
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证ehyxf
 
Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...
Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...
Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...Priya Reddy
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证tufbav
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证ehyxf
 
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxCRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxRishabh332761
 
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in DammamAbortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammamahmedjiabur940
 

Recently uploaded (20)

怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
 
Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Ratlam [ 7014168258 ] Call Me For Genuine Models We...
 
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
 
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
 
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
 
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
 
Abortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get CytotecAbortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get Cytotec
 
Point of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryPoint of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratory
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
 
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
 
Hilti's Latest Battery - Hire Depot.pptx
Hilti's Latest Battery - Hire Depot.pptxHilti's Latest Battery - Hire Depot.pptx
Hilti's Latest Battery - Hire Depot.pptx
 
Critical Commentary Social Work Ethics.pptx
Critical Commentary Social Work Ethics.pptxCritical Commentary Social Work Ethics.pptx
Critical Commentary Social Work Ethics.pptx
 
Guwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime Guwahati
Guwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime GuwahatiGuwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime Guwahati
Guwahati Escorts Service Girl ^ 9332606886, WhatsApp Anytime Guwahati
 
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
 
Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...
Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...
Mankhurd Call Girls, 09167354423 Mankhurd Escorts Services,Mankhurd Female Es...
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
 
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pillsIn Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxCRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
 
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in DammamAbortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
 

ARM_2.ppt

  • 1. 1 ARM The first encounter Authors: Nemanja Perovic, nemanjaizbg@yahoo.com Prof. Dr. Veljko Milutinovic, vm@etf.bg.ac.yu
  • 2. 2 What Is ARM? Advanced RISC Machine First RISC microprocessor for commercial use Market-leader for low-power and cost-sensitive embedded applications
  • 4. 4 Features Architectural simplicity which allows Very small implementations which result in Very low power consumption
  • 5. 5 The History of ARM Developed at Acorn Computers Limited, of Cambridge, England, between 1983 and 1985 Problems with CISC: Slower then memory parts Clock cycles per instruction
  • 6. 6 The History of ARM (2) Solution – the Berkeley RISC I: Competitive Easy to develop (less than a year) Cheap Pointing the way to the future
  • 7. 7 ARM Architecture Typical RISC architecture: Large uniform register file Load/store architecture Simple addressing modes Uniform and fixed-length instruction fields
  • 8. 8 ARM Architecture (2) Enhancements: Each instruction controls the ALU and shifter Auto-increment and auto-decrement addressing modes Multiple Load/Store Conditional execution
  • 9. 9 ARM Architecture (3) Results: High performance Low code size Low power consumption Low silicon area
  • 10. 10 Pipeline Organization Increases speed – most instructions executed in single cycle Versions:  3-stage (ARM7TDMI and earlier)  5-stage (ARMS, ARM9TDMI)  6-stage (ARM10TDMI)
  • 11. 11 Pipeline Organization (2) 3-stage pipeline: Fetch – Decode - Execute Three-cycle latency, one instruction per cycle throughput cycle Fetch Decode Execute Fetch Decode Execute Fetch Decode Execute i n s t r u c t i o n t t+1 t+2 t+3 t+4 i i+1 i+2
  • 12. 12 Write-back Buffer/data Execute Decode Pipeline Organization (3) 5-stage pipeline:  Reduces work per cycle => allows higher clock frequency  Separates data and instruction memory => reduction of CPI (average number of clock Cycles Per Instruction) Stages: Fetch
  • 13. 13 Pipeline Organization (4) Pipeline flushed and refilled on branch, causing execution to slow down Special features in instruction set eliminate small jumps in code to obtain the best flow through pipeline
  • 14. 14 Operating Modes Seven operating modes:  User  Privileged: System (version 4 and above) FIQ IRQ Abort Undefined Supervisor exception modes
  • 15. 15 Operating Modes (2) User mode:  Normal program execution mode  System resources unavailable  Mode changed by exception only Exception modes:  Entered upon exception  Full access to system resources  Mode changed freely
  • 16. 16 Exceptions Table 1 - Exception types, sorted by Interrupt Vector addresses Exception Mode Priority IV Address Reset Supervisor 1 0x00000000 Undefined instruction Undefined 6 0x00000004 Software interrupt Supervisor 6 0x00000008 Prefetch Abort Abort 5 0x0000000C Data Abort Abort 2 0x00000010 Interrupt IRQ 4 0x00000018 Fast interrupt FIQ 3 0x0000001C
  • 17. 17 ARM Registers 31 general-purpose 32-bit registers 16 visible, R0 – R15 Others speed up the exception process
  • 18. 18 ARM Registers (2) Special roles:  Hardware R14 – Link Register (LR): optionally holds return address for branch instructions R15 – Program Counter (PC)  Software R13 - Stack Pointer (SP)
  • 19. 19 ARM Registers (3) Current Program Status Register (CPSR) Saved Program Status Register (SPSR) On exception, entering mod mode:  (PC + 4)  LR  CPSR  SPSR_mod  PC  IV address  R13, R14 replaced by R13_mod, R14_mod  In case of FIQ mode R7 – R12 also replaced
  • 20. 20 ARM Registers (4) R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 (PC) CPSR System & User R0 R1 R2 R3 R4 R5 R6 R7_fiq R8_fiq R9_fiq R10_fiq R11_fiq R12_fiq R13_fiq R14_fiq R15 (PC) CPSR SPSR_fiq FIQ R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13_irq R14_irq R15 (PC) CPSR SPSR_irq IRQ R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13_svc R14_svc R15 (PC) CPSR SPSR_svc Supervisor R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13_abt R14_abt R15 (PC) CPSR SPSR_abt Abort R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13_und R14_und R15 (PC) CPSR SPSR_und Undefined
  • 21. 21 Instruction Set Two instruction sets:  ARM Standard 32-bit instruction set  THUMB 16-bit compressed form Code density better than most CISC Dynamic decompression in pipeline
  • 22. 22 ARM Instruction Set Features:  Load/Store architecture  3-address data processing instructions  Conditional execution  Load/Store multiple registers  Shift & ALU operation in single clock cycle
  • 23. 23 ARM Instruction Set (2) Conditional execution:  Each data processing instruction prefixed by condition code  Result – smooth flow of instructions through pipeline  16 condition codes: EQ equal MI negative HI unsigned higher GT signed greater than NE not equal PL positive or zero LS unsigned lower or same LE signed less than or equal CS unsigned higher or same VS overflow GE signed greater than or equal AL always CC unsigned lower VC no overflow LT signed less than NV special purpose
  • 24. 24 ARM Instruction Set (3) ARM instruction set Data processing instructions Data transfer instructions Software interrupt instructions Block transfer instructions Multiply instructions Branching instructions
  • 25. 25 Data Processing Instructions Arithmetic and logical operations 3-address format:  Two 32-bit operands (op1 is register, op2 is register or immediate)  32-bit result placed in a register Barrel shifter for op2 allows full 32-bit shift within instruction cycle
  • 26. 26 Data Processing Instructions (2) Arithmetic operations:  ADD, ADDC, SUB, SUBC, RSB, RSC Bit-wise logical operations:  AND, EOR, ORR, BIC Register movement operations:  MOV, MVN Comparison operations:  TST, TEQ, CMP, CMN
  • 27. 27 Data Processing Instructions (3) Conditional codes + Data processing instructions + Barrel shifter = Powerful tools for efficient coded programs
  • 28. 28 Data Processing Instructions (4) e.g.: if (z==1) R1=R2+(R3*4) compiles to EQADDS R1,R2,R3, LSL #2 ( SINGLE INSTRUCTION ! )
  • 29. 29 Data Transfer Instructions Load/store instructions Used to move signed and unsigned Word, Half Word and Byte to and from registers Can be used to load PC (if target address is beyond branch instruction range) LDR Load Word STR Store Word LDRH Load Half Word STRH Store Half Word LDRSH Load Signed Half Word STRSH Store Signed Half Word LDRB Load Byte STRB Store Byte LDRSB Load Signed Byte STRSB Store Signed Byte
  • 30. 30 Block Transfer Instructions Load/Store Multiple instructions (LDM/STM) Whole register bank or a subset copied to memory or restored with single instruction R0 R1 R2 R14 R15 Mi Mi+1 Mi+2 Mi+14 Mi+15 LDM STM
  • 31. 31 Swap Instruction Exchanges a word between registers Two cycles but single atomic action Support for RT semaphores R0 R1 R2 R7 R8 R15
  • 32. 32 Modifying the Status Registers Only indirectly MSR moves contents from CPSR/SPSR to selected GPR MRS moves contents from selected GPR to CPSR/SPSR Only in privileged modes R0 R1 R7 R8 R14 R15 CPSR SPSR MSR MRS
  • 33. 33 Multiply Instructions Integer multiplication (32-bit result) Long integer multiplication (64-bit result) Built in Multiply Accumulate Unit (MAC) Multiply and accumulate instructions add product to running total
  • 34. 34 Multiply Instructions Instructions: MUL Multiply 32-bit result MULA Multiply accumulate 32-bit result UMULL Unsigned multiply 64-bit result UMLAL Unsigned multiply accumulate 64-bit result SMULL Signed multiply 64-bit result SMLAL Signed multiply accumulate 64-bit result
  • 35. 35 Software Interrupt SWI instruction  Forces CPU into supervisor mode  Usage: SWI #n  Maximum 224 calls  Suitable for running privileged code and making OS calls Cond Opcode Ordinal 31 28 27 24 23 0
  • 36. 36 Branching Instructions Branch (B): jumps forwards/backwards up to 32 MB Branch link (BL): same + saves (PC+4) in LR Suitable for function call/return Condition codes for conditional branches
  • 37. 37 Branching Instructions (2) Branch exchange (BX) and Branch link exchange (BLX): same as B/BL + exchange instruction set (ARM  THUMB) Only way to swap sets
  • 38. 38 Thumb Instruction Set Compressed form of ARM  Instructions stored as 16-bit,  Decompressed into ARM instructions and  Executed Lower performance (ARM 40% faster) Higher density (THUMB saves 30% space) Optimal – “interworking” (combining two sets) – compiler supported
  • 39. 39 THUMB Instruction Set (2) More traditional:  No condition codes  Two-address data processing instructions Access to R0 – R8 restricted to  MOV, ADD, CMP PUSH/POP for stack manipulation  Descending stack (SP hardwired to R13)
  • 40. 40 THUMB Instruction Set (3) No MSR and MRS, must change to ARM to modify CPSR (change using BX or BLX) ARM entered automatically after RESET or entering exception mode Maximum 255 SWI calls
  • 41. 41 The Next Step New ARM Cortex family of processors  New NEON™ media and signal processing extensions  Thumb®-2 blended 16/32-bit instruction set for performance and low power  Improved Interrupt handling
  • 42. 42 Summary Adoption of ARM technology has increased efficiency and lowered costs ARM is the world’s leading architecture today  3 billion ARM Powered chips and counting
  • 43. 43 References www.arm.com ARM Limited ARM Architecture Reference Manual, Addison Wesley, June 2000 Trevor Martin The Insiders Guide To The Philips ARM7- Based Microcontrollers, Hitex (UK) Ltd., February 2005 Steve Furber ARM System-On-Chip Architecture (2nd edition), Addison Wesley, March 2000
  • 44. 44 The End Authors: Nemanja Perovic, nemanjaizbg@yahoo.com Prof. Dr. Veljko Milutinovic, vm@etf.bg.ac.yu