Chapter 2 - Dr. Syafeeza - 3
Chapter 2 - Dr. Syafeeza - 3
TECHNOLOGY
Chapter 2: The Architecture of ARM Processor
Introduction
Two types of processor architecture
• Complex instruction set computing (CISC) platform – e.g., 68k
• Reduced instruction set computing (RISC) platform – e.g.,ARM
CISC vs RISC Features
CISC RISC
Emphasis on hardware Emphasis on software
Includes multi-clock complex Single-clock, reduced instruction only
instructions (2 to 10 clock cycle)
Memory-to-memory: “LOAD” and Register to register: “LOAD” and
“STORE” incorporated in instructions “STORE” are independent instructions
Small code sizes, high cycles per Large code sizes, low cycles per
second second
CISC chips do all of the processing RISC chips distribute some of their
themselves processing to other chips
Many complex instructions Simple instructions, few in number
Variable length instructions Fixed length instructions
Complexity in microcode Complexity in compiler
Many instructions can access memory Only LOAD/STORE instructions
access memory
Many addressing modes Few addressing modes
CISC vs RISC Features (cont.)
CISC: Memory-to-memory: “LOAD” and “STORE” RISC: Register to register: “LOAD” and “STORE”
Register
Data Data
Memory Memory
Machine language is in
the form of binary numbers
Each instruction will
store data in binary form
To retrieve the
instruction stored in
memory, decoding is
required first.
ARM Architecture: Load-Store
Common architecture for RISC processors
What load-store architecture does?
• Instruction sets will only process (add, subtract, etc.) values that are in
registers only
• The results of the process will be stored in registers
• The operation that involve memory is copy memory content into register
(load instructions) and copy register content into memory (store instructions)
How about CISC like 68K?
• CISC processor allow processes involving memory with memory and between
memory and register
• E.g., Add memory content stored at address $2000 with memory content
stored at address $2004, or subtract memory content stored at address $3000
from register A content.
Brief History of ARM
In Thumb state, the Program Counter (PC) uses bit1 to select between alternate
halfwords.
Note: Transition between ARM and Thumb states does not affect the processor
mode or the register contents.You can switch the operating state between ARM
state and Thumb state using BX instruction.
Comparison between ARM state registers
and Thumb state registers
7 operating
mode
0: ARM state
1: Thumb state
1 byte (8-bits) in
1 memory
location
Example
For example, suppose we have a 32 bit quantity, written as
90AB12CD16, which is hexadecimal. Since each hex digit is 4 bits, we
need 8 hex digits to represent the 32 bit value.
So, the 4 bytes are: 90, AB, 12, CD where each byte requires 2 hex
digits.
It turns out there are two ways to store this in memory.
In little endian, you store the least In big endian, you store the most
significant byte in the smallest address. significant byte in the smallest address.
Here's how it would look: Here's how it would look:
90 AB 12 CD16
MSB LSB
Instruction execution
ARM is a RISC processor with a pipeline operation, while one instruction is being executed,
the one to be executed next is being decoded and the one after is being fetched.
Fetch – Instructions are fetch from memory and placed in the instruction pipeline. The control unit in
the CPU uses the address in the PC and fetch, read the contents of the memory at this address. Once the
contents are in CPU, the value in the PC is advanced by adding 4 to it.
Decode – Instructions are decoded and the data path control signals prepared for the next cycle.
The 32-bit value fetched is decoded to determine which instruction it represents
Execute – the operands are read from the register bank, shifted, combined in the ALU and the result
written back
Instruction Set: A group of instructions that can be given to the computer. These instructions direct
the computer in terms of data manipulation. A typical instruction consists of 2 parts: Opcode and
Operand
Opcode (operational code): the instruction applied
Operand: the memory register or data upon which instruction is applied.