Module 5
Module 5
Introduction:
The British computer manufacturer Acorn Computers first developed the Acorn
RISC Machine architecture (ARM) in the 1980s to use in its personal computers.
The official Acorn RISC Machine project started in October 1983. They chose VLSI
Technology as the silicon partner, as they were a source of ROMs and custom
chips for Acorn. Wilson and Furber led the design.
https://www.mepits.com/tutorial/194/arm/ar
m.
Some of the advantages of ARM processors are listed below:
ARM processors vs. Intel processors: When you purchase a processor you will get
to know that some of the designs use Intel Atom processors while the other uses ARM
architecture. These both processors are designed in a way for low-power
operation. They are created to give the mobile a long battery life. But they are both
based on different ideology. The ARM structure is made very simple and is intended
to keep the energy wastage to the minimum. Intel processors are made of complicated
designs to match the compatibility of the company‘s desktop and laptop CPU’s. ARM
processors are being used in the portable devices from a very long time but Intel has
just entered to this area. Intel is believed to have a serious competition with the ARM
technology. The power chips of ARM processors are relatively low in price, so if Intel
will have to reconsider their pricing strategies to compete with it. The entry of ARM
The ARM Instruction
processors and Set - ARM
their University
wide usage Program - V1.0
has forced Intel to2 increase their efficiency.
Simulation is the process of using a simulation software (simulator) to verify the
functional correctness of a digital design that is modeled using a HDL (hardware
description language) like Verilog.
https://www.elprocus.com/difference-between-avr-arm-8051-and-pic-
microcontroller/.
http://www.firmcodes.com/difference-arm-microcontrollers/.
8051 microcontroller is an 8-bit family of microcontroller is developed by the Intel in the year
1981. This is one of the popular families of microcontroller are being used all across the world.
This microcontroller was moreover referred as “system on a chip” since it has 128 bytes of
RAM, 4Kbytes of a ROM, 2 Timers, 1 Serial port, and 4 ports on a single chip. The CPU can
also work for 8bits of data at a time since 8051 is an 8-bit processor. In case the data is bigger
than 8 bits, then it has to be broken into parts so that the CPU can process easily. Most
manufacturers contain put 4Kbytes of ROM even though the number of ROM can be exceeded
up to 64 K bytes.
PIC Microcontroller
AVR microcontroller was developed in the year of 1996 by Atmel Corporation. The structural
design of AVR was developed by the Alf-Egil Bogen and Vegard Wollan. AVR derives its name
from its developers and stands for Alf-Egil Bogen Vegard Wollan RISC microcontroller, also
known as Advanced Virtual RISC. The AT90S8515 was the initial microcontroller which was
based on the AVR architecture, though the first microcontroller to hit the commercial market was
AT90S1200 in the year 1997.
TinyAVR:- Less memory, small size, appropriate just for simpler applications.
MegaAVR:- These are the mainly popular ones having a good quantity of memory (up to 256
KB), higher number of inbuilt peripherals and appropriate for modest to complex applications.
XmegaAVR:- Used in commercial for complex applications, which need large program memory
and high speed.
■ SP (R13): Stack Pointer. There is no stack in the ARM architecture. Even so,
R13 is usually reserved as a pointer for the program-managed stack
■ CPSR : Current Program Status Register. Holds the visible status register
■ SPSR : Saved Program Status Register. Holds a copy of the previous status
register while executing exception or interrupt routines
- It is copied back to CPSR on the return from the exception or interrupt
- No SPSR available in User or System modes
Flag
[Rn] Register
Address accessed is value found in Rn.
Example:
ldr r0, [r1] @ r0 *r1 Memory
.
.
.
r1 r0 Destination
0x200 0x5 0x5 Register
0x200 for ldr
.
.
Memory
Example: .
.
ldr r2, [r1, #12] @ r2 ← *(r1 + 12) .
r1 Destination
188 Register
for ldr
r2
200 27 27
Example:
ldr r2, [r0, r1] @ r2 ← *(r0 + r1)
Example:
ldr r0, [r1, r2, lsl #2] @ r0 ← *(r1 + r2*4)
Example:
ldr r2, [r1, #12]! @ r1 ← r1 + 12 then r2 ← *r1
Example:
ldr r2, [r0, r1]! @ r0 ← r0 + r1 then r2 ← *r0
Example:
ldr r2, [r0, r1, lsl #2]! @ r0 ← r0 + r1*4 then r2 ← *r0
Example:
str r2, [r1], +4 @ *r1 ← r2 then r1 ← r1 + 4
31 28 24 20 16 12 8 4 0
Cond
* Instead it has a barrel shifter which provides a mechanism to carry out shifts
as part of other instructions.
CF Destination 0
Result
The ARM Instruction Set - ARM University Program - V1.0 47
Second Operand :
Shifted Register
* The amount by which the register is to be shifted is contained in
either:
• the immediate 5-bit field in the instruction
– NO OVERHEAD
– Shift is done for free - executes in single cycle.
• the bottom byte of a register (not PC)
– Then takes extra cycle to execute
– ARM doesn’t have enough read ports to read 3 registers at
once.
– Then same as on other processors where shift is
separate instruction.
* If no shift is specified then a default shift is applied: LSL #0
• i.e. barrel shifter has no effect on value in register.
r0 Memory
Source
Register 0x5
for STR
r1 r2
Base Destination
Register 0x200 0x200 0x5 0x5 Register
for LDR
r1
Base
Register 0x200 0x200
r1 Offset r0
Updated Source
Base 0x20c 12 0x20c
0x5 Register
Register for STR
0x200 0x5
r1
Original
Base 0x200
Register
* To auto-increment the base register to location 0x1f4 instead use:
• STR r0, [r1], #-12
* If r2 contains 3, auto-incremenet base register to 0x20c by multiplying
this by 4:
• STR r0, [r1], r2, LSL #2
* When used in a privileged mode, this does the load/store with user mode
privilege.
• Normally used by an exception handler that is emulating a memory
access instruction that would normally execute in user mode.
31 28 27 25 24 23 0
Cond 1 0 1 L Offset
PUSH
{1,2,3} POP
SP 3 Result of
2 SP 2 pop = 3
1 1
SP
BASE BASE
BASE
0x418
SP r5 SP
r4 r5
r3 r4
r1 r3
r0 r1
Old SP Old SP r5 Old SP Old SP r0 0x400
r5 r4
r4 r3
r3 r1
r1 r0
SP r0 SP
0x3e8
1
Rn
temp
2 3
Memory
Rm Rd
* Thus to implement an actual swap of contents make Rd = Rm.
* The compiler cannot produce this instruction.
Condition Field
* The ARM uses a pipeline in order to increase the speed of the flow of
instructions to the processor.
• Allows several operations to be undertaken simultaneously, rather than
serially.
ARM
ARM7TDMI
ARM decode
Instruction Thumb→ARM Reg Reg
Shift ALU
Fetch decompress Read Write
Reg Select
ARM9TDMI
ARM or Thumb
Instruction Inst Decode Memory Reg
Shift + ALU Write
Fetch Reg Reg Access
Decode Read
FETCH DECODE EXECUTE MEMORY WRITE
ARM11
Saturat
Shift ALU
e
Data Data
Addres
Cache Cache
s
1 2
Interrupt
Controlle
r
nIRQ nFIQ Peripherals I/O
ARM
Core
8 bit ROM
High Timer
Bandwidth AHB
APB
External
Bridge
Memory
Interface Keypad