3 Microprocessor Systems
3 Microprocessor Systems
Microprocessor
Mohammad Hosseini
Microprocessor Systems
2
Outline
❖ Microcomputer systems
❖ Types of processors
1
2/24/2024
3
Von Neumann Architecture
4
Harvard Architecture
❖ Von Neumann architecture
➢ Program instructions and data share the same
memory and pathways
➢ The CPU cannot simultaneously read an instruction
and read or write data from or to the memory.
❖ Harvard architecture
➢ Separate storage, signal pathways, and
address spaces for instructions and data
➢ The CPU can both read an instruction
and perform a data memory access at
the same time
2
2/24/2024
5
CPU and Microprocessor
❖ Microprocessor
➢ A single-chip implementation of a CPU, consisting of ALU, CU and registers
➢ Contains no RAM, ROM, or I/O ports on the chip itself
➢ e.g., Intel’s x86 family (8088, 8086, 80386, 80386, 80486, Pentium);
Motorola’s 680x0 family (68000, 68010, 68020, etc)
6
Microcomputer
❖ CPU: processes information stored in the memory
➢ Microprocessor
❖ Memory: stores both instructions and data
➢ RAM, ROM
❖ Input/Output ports: provide a means of communicating with the CPU
❖ Connecting I/O devices, e.g., keyboard, monitor, tape, disk, printer and etc.
❖ Bus: strips of wire interconnecting the parts. Bus carries information from place to place
➢ Address bus
➢ Data bus CU Address bus
➢ Control bus
CPU Memory I/O Ports
ALU
Control bus
3
2/24/2024
7
Microcomputer System
❖ Microcomputer
❖ Peripheral I/O devices
❖ Software
➢ Software system
✓ OS, Compiler, Drivers, …
➢ Application software Sometimes we refer to Microcomputer System
✓ Word, Matlab, Media player, … simply just as Computer
CU Address bus
8
Microcontroller
❖ Microcontroller: a microcomputer on a single chip
➢ A microcontroller incorporates all of the necessary computing components
onto a single chip: CPU, memory, interrupt controls, timer, serial interfaces,
I/O ports, and other peripherals.
▪ Compared to microprocessor:
➢ Specific task or application (typically in embedded systems such as
automobile engine control systems, implantable medical devices, remote
controls, office machines, home appliances, toys, …)
➢ Simpler CPU
➢ Lower clock speed
➢ Lower power consumption
➢ Less design time
➢ Results in simpler board design
4
2/24/2024
Block Diagram of
LPC1768 microcontroller
10
System on a Chip
❖ SoC: integrates not only CPU, memory, and typical peripherals, but also
advanced peripherals like graphics processing unit (GPU), Wi-Fi interface
controller, and mixed-signal functions in a single chip.
5
2/24/2024
11
Programmable Logic Controller
❖ PLC: a specialized form of a microcontroller ruggedized and adapted
for the control of manufacturing processes, such as assembly lines,
machines, robotic devices.
12
Digital Signal Processor
❖ DSP: a type of processor optimized for the operational needs of digital signal
processing, including specific math operations to be performed quickly and
efficiently (typically in real time).
➢ Applications: audio and video processing, image processing, radar, medical
electronics, …
➢ Operations: multiply–accumulates (MAC), matrix operations (convolution for
filtering, dot product)
➢ Large amounts of data
➢ Harvard architecture
➢ Highly parallel multiplier–accumulators (MAC units)
➢ Addressing modes: supporting auto-increment, circular buffers, and bit-reversed
addressing (for FFT)
➢ Supports fixed-point arithmetic to speed up arithmetic processing
➢ Difficult to program: Assembly or specialized (assembly-coded) C Libraries
6
2/24/2024
13
Graphics processing unit
❖ GPU: A specialized many-core processor designed especially to
perform the calculations required in graphics rendering
14
More on CPUs
❖ To perform the actions of fetch and execute, all CPUs are equipped with
resources such as the following …
7
2/24/2024
15
Inside CPUs
Registers
❖ Control Unit (CU): works under instructions
➢ Instruction Register
➢ Instructor decoder
✓ Interprets the instruction fetched into CPU and generates all control signals,
coordinating all activities within the computer
➢ Program Counter
✓ Points to the address of the next instruction to be executed. Its contents are placed
on the address bus to find and fetch the desired instruction
16
Memory System
Address bus
Primary storage
Secondary storage
CPU (main memory,
I/O (external memory)
internal memory)
[HDD, SSD]
[RAM, ROM]
Cache
Data bus
8
2/24/2024
17
Types of Memories
❖ Flash Memory
18
Memory Characteristics
❖ Location
➢ CPU (register), Internal (cache, RAM), External (Disk, DVD)
❖ Capacity
➢ Word size, Number of words
❖ Unit of transfer
➢ Word or Block
❖ Access method
➢ Sequential (tape), Direct (hard disk), Random (RAM, ROM), Associative (Cache)
❖ Performance
➢ Access time (latency), transfer Rate
9
2/24/2024
19
Random-Access Memory (RAM)
❖ Same amount of time is required to access any location on
the same chip
❖ Typically used to store working data and machine code
❖ Volatile (loses its data quickly when power is removed)
20
Random-Access Memory (RAM)
Where are DRAM and SRAM used?
DRAM SRAM
10
2/24/2024
21
Read-Only Memory (ROM)
❖ Can only be read but not written by the processor
❖ For storing software that is rarely changed during the life of the system (Firmware)
❖ Non-volatile
➢ Mask-programmed read-only memory (MROM)
▪ Programmed when being manufactured (hard-wired, cheap)
➢ Programmable read-only memory (PROM)
▪ The memory chip can be programmed by the end user (can’t be reprogrammed)
➢ Erasable programmable ROM (EPROM)
▪ Electrically programmable many times
✓ erasable by ultraviolet light (through a window, at a slow speed)
✓ erasable in bulk (whole chip in one erasure operation)
➢ Electrically erasable programmable ROM (EEPROM)
▪ Electrically programmable many times
✓ Electrically erasable many times
✓ Typically can only be erased in bulk
22
Flash Memory
❖ Non-volatile
❖ Electrically programmable many times
❖ Electrically erasable many times
❖ Can be erased and programmed in blocks (pages)
11
2/24/2024
23
I/O Devices
24
Data Bus
❖ Bidirectional
➢ CPU read: Memory (I/O device) → CPU
➢ CPU write: CPU → Memory (I/O device)
12
2/24/2024
25
Control Bus
❖ Used to control each module and the use of data and address
buses
➢ Command and timing information between modules
➢ e.g., memory read/write, IO read/write, Bus request/grant
26
Address Bus
❖ Unidirectional
➢ From CPU to memory and I/O device
13
2/24/2024
27
A Simple Example
An imaginary CPU:
➢ Registers: A, B, C, and D
➢ 8-bit data bus Memory Contents
➢ 16-bit address bus (can access memory from 0000 to FFFFH) address
❖ Action (program): adding values 21H, 42H, and 12H 1400 B0
1401 21
➢ CPU opcode for moving a value to register A: 10110000 (B0H)
1402 04
➢ CPU opcode for adding a value to register A: 00000100 (04H)
1403 42
1404 04
Action Code Data
Move value 21H into register A B0H 21H 1405 42
Add value 42H to register A 04H 42H 1406 F4 halt
Add value 12H to register A 04H 12H
28
Assembly Programming
❖ A CPU can work only in binary (0 and 1)
❖ A program that consists of 0s and 1s is called machine language
❖ It is quite tedious and slow for humans to deal with 0s and 1s in order to program
a computer
❖ Assembly languages were developed, which provide mnemonics for the
machine code instructions, plus other features that made programming
faster and less prone to error.
➢ An Assembly language instruction consists of a mnemonic
(command to the CPU), optionally followed by one or two MOV A, 21H
operands (data items being manipulated).
❖ Assembly language programs must be translated into machine code by a
program called an assembler.
❖ Assembly language is referred to as a low-level language because it deals
directly with the internal structure of the CPU.
14
2/24/2024
29
I/O Approaches
➢ Memory-mapped I/O
30
Memory-mapped I/O
15
2/24/2024
31
Isolated I/O (Port-mapped)
MA Address
IOA
32
CPU Performance
16
2/24/2024
33
CPU Design Philosophies
Program for CPU1 Program for CPU2
MULT [0200H], [0100H], [0104H] LOAD A, [0100H]
LOAD B, [0104H]
MULT A, B
STORE [0200H], A
34
CPU design philosophies
CISC RISC
Complex Instruction Set Computer Reduced Instruction Set Computer
Less and easier work to translate Compiler
Less RAM is required to store
the program RAM
Transistors fewer
17
2/24/2024
35
Expressing a Computer’s Performance
RISC does the opposite, reducing the cycles per instruction at the cost of the
number of instructions per program.
36
Performance Measurement Units
18