Embedded Systems Structure
Amr Ali Abdel-Naby
Embedded Systems Developer
+2-012-3600-207
Embedded Systems Structure
Amr Ali AbdelNaby@2010
Outline
•
•
•
•
•
Composition of Embedded Systems
Processor
System Bus
Memory Devices
Peripherals
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Part I: Embedded Systems
Structure
•
•
•
•
•
Composition of Embedded Systems
Processor
System Bus
Memory Devices
Peripherals
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
What is an Embedded System?
• A system composed of HW + SW to perform a
dedicated function.
• On average, a human being meets 100s of
embedded systems daily
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Embedded System Components
Application SW
SW
Operating System
Device Drivers
H
W
Processor
Amr Ali Abdel-Naby@2010
Memory
Devices
Embedded Systems Structure
I/O Devices
Part I: Embedded Systems
Structure
•
•
•
•
•
Composition of Embedded Systems
Processor
System Bus
Memory Devices
Peripherals
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
The Processor
•
•
•
•
The core of a digital system
AKA CPU
Performs arithmetic, control, data, and I/O operations
A small IC that embeds everything a CPU needs is
called a microprocessor.
• Nowadays, this IC is called a SOC
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
The Processor Structure
•
•
•
•
Registers
ALU: Arithmetic Logic Unit
CU: Control Unit
Internal Bus
Registers
Internal Bus
ALU
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
CU
Registers
• Temporal storage inside the CPU
o
Flip-flops + latches
• General purpose register
o
Carry out program or data processing
• Control register
o
o
Controls the program or the processor
Program Counter (PC), …
• Status/flag register
o
Shows the current state of the processor
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
ALU
• Arithmetic operations
o
+, -, …
• Logical operators
o
AND, OR, …
• Writes operation results to the status register or the
flag register
o
Carry occurrence, overflow occurrence, …
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
CU
• Controls the internal data flow to decode and
execute an instruction
Program Counter
Memory Device
Instruction Register
Instruction Decoder
Control Signal Generator
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Instruction
Processor Bus
• A bus is a path that connects the various devices of
a system
• Internal bus
o
Between registers and ALU
• External bus
o
o
o
o
Between I/O devices, memories, and CPU
Data bus: transfers data
Address bus: transfers address information
Control bus: transfers control signals
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Pipeline
• Continuous and parallel streaming of instructions to
the CPU
CPU
W/O
Pipeli
ne
CPU
+
Pipeli
ne
Fetch 1
Execute 1
Fetch 1
Execute 1
Fetch 2
Fetch 2
Execute 2
Fetch 3
Amr Ali Abdel-Naby@2010
Execute 2
Execute 3
Embedded Systems Structure
Fetch 3
Execute 3
Various Processors
• i386
o
o
Long history
PCs
• ARM
o
o
Simple
Cell phones and PDAs
• PowerPC
o
Networking capabilities
• M68K
o
Network devices and portable terminals
• MIPS
o
High speed network devices
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
MCU, MPU, and SoC
• System on Chip (SoC)
o
o
o
Several semiconductors integrated into a single chip
Modern CPUs are in SoC forms
The whole system is integrated on a single chip
SW + HW
• MCU, MPU
o
Another naming of an SoC
Depends on vendor
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Program
• A list of acceptable processor instructions
• Designed to achieve a specific result
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Machine Code and Assembly
Language
• Machine code
o
o
o
1’s and 0’s only
Understood by processor only
Inconvenient to write a program with
• Mnemonic code
o
Machine code converted to symbols understood by
programmers
• Assembly language
o
Mnemonic code + pseudo instructions to improve programs
readability
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
C/Cs of Assembly Language
• Pros
Better readability and understanding compared to machine
code
o Easier to debug and maintain compared to machine code
o
• Cons
Knowledge of processor internal structure and HW is
necessary
o Different assembly for different processors
o
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Assembler and Assemble
• Assembler
o
A program that converts assembly language into machine
code
• Assemble
o
The process of converting assembly language into machine
code
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Instruction
• Instruction = Op Code + Operand
o
o
Op Code is an action taken by a processor
Operand is the target the Op Code should take action to
ADD A,B,C
Op Code: ADD
Operands: A, B, C
Symantec: Add register B and register C and put result in register
A
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Types of Processors
• Complex Instruction Set
Computers (CISC)
o
o
o
o
1960s
Memory referencing
operations
Complicated
Low performance
Amr Ali Abdel-Naby@2010
• Reduced Instruction Set
Computers (RISC)
o
o
o
o
1950s
Load/Store
Simple
High performance
Embedded Systems Structure
Part I: Embedded Systems
Structure
•
•
•
•
•
Composition of Embedded Systems
Processor
System Bus
Memory Devices
Peripherals
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
System Bus Architectures
• Von-Neumann
CPU
• Harvard
CPU
Instruction/Data
Memory
Instruction
Memory
Data Memory
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Part I: Embedded Systems
Structure
•
•
•
•
•
Composition of Embedded Systems
Processor
System Bus
Memory Devices
Peripherals
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
Types of Memories
Types
Volatile
Memory
NonVolatile
Memory
Speed
Cost
Use
SRAM
Several ns, Fast
High
Cache
DRAM
Tens of ns
Low
Main memory
EEPROM
Tens of ns
High
Small size data or
program storage
NAND
Tens of ns
Low
Data Storage
NOR
Tens of ns
High
Program and Data
Storage
Flash
Amr Ali Abdel-Naby@2010
Embedded Systems Structure
C/Cs
Read and WRITE
with block units,
High Capacity