10/20/2025
Lecture 2: Microprocessor
Systems
Seyed-Hosein Attarzadeh-Niaki
Some slides from Hongzi Zhu
Microprocessors and Interface Circuits 1
Review
• Early computers
• Mechanical age
• Electrical age
• Electronic age
– Transistors
– Integrated circuits
• Evolution of x86 and ARM processors
Microprocessors and Interface Circuits 2
1
10/20/2025
Outline
• Microcomputer systems
• Types of processors
• Components of microcomputer systems
Microprocessors and Interface Circuits 3
Von Neumann Architecture
[Link] components partitioning
• Input
• Output I/O devices
• Memory Memory
• ALU
• Control unit CPU
2. Three key concepts
– Both instructions and data are stored in a single
read-write memory
– The contents of memory are addressable by location,
without regard to the type of data
– Execution occurs in a sequential fashion Harvard architecture
Microprocessors and Interface Circuits 4
2
10/20/2025
Microprocessors and Interface Circuits 5
Microprocessors
• The CPU circuitry can be reduced to the IC
(Integrated Circuit) scale, 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)
Microprocessors and Interface Circuits 6
3
10/20/2025
Microcomputer
• CPU: processes information stored in the memory
– Microprocessor
• Memory: stores both instructions and data
– ROM, RAM
• 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: interconnecting all parts together
– Address bus
– Data bus
– Control bus
Microprocessors and Interface Circuits 7
Microcomputer System
Microcomputer System
Microcomputer
Microprocessor
• Microcomputer ALU CU Registers
BUS
• Peripheral I/O devices
• Software RAM ROM I/O Port I/O Port
– System software System software Appl. software I/O device I/O device
• e.g., OS, compilers, drivers
– Application software
• e.g. Word, MATLAB, Media player, Latex…
Microprocessors and Interface Circuits 8
4
10/20/2025
Microcomputer System Structure
ALU
Microprocessor
CU
(μP)
Microcomputer
Memory Registers
( μC )
I/O ports
Microcomputer
system
(μCS) I/O devices
System software
Application software
Microprocessors and Interface Circuits 9
Microcomputer/Microcontroller
• A microcontroller is a computer-on-a-chip
– A type of microprocessor emphasizing self-sufficiency and
cost-effectiveness, in contrast to a general-purpose
microprocessor
• Main difference between a microcontroller and a
microprocessor
– Microprocessor is a CPU with ALU, control unit and
registers
– Microcontroller has a simple CPU with additional elements
like ROM, RAM, peripherals (timer, I/O ports, etc).
• The boundary can be blurred
– Intel Atom, AMD Geode
Microprocessors and Interface Circuits 10
5
10/20/2025
Basic Components of a Microcontroller
Microprocessors and Interface Circuits 11
Programmable Logic Controller (PLC)
• A specialized form of a microcontroller for
industrial automation
• Ruggedized and adapted for the control of
manufacturing processes
• Originated as replacements for control
circuits using electrical relays to control
machinery
• Classically programmed using ladder logic
– A graphical notation originally used to specify
logic constructed with relays and switches
• Today PLCs: Microcontrollers
with suitable IO interfaces
Remote Terminal Units (RTUs) and Intelligent Electronic Devices (IEDs)
are other types of industrial computer systems
Microprocessors and Interface Circuits 12
6
10/20/2025
Digital Signal Processor (DSP)
• Processors designed • Characteristics
specifically to support – Harvard architecture
numerically intensive signal
processing applications – Addressing modes
• Applications: Audio and supporting auto-
video processing, radar, increment, circular buffers,
sonar, medical electronics, and bit-reversed
etc. addressing (for FFT)
– Large amounts of data – Support fixed-point data
– Perform sophisticated precisions of 16-24 bits
mathematical operations on • Difficult to program
the data
• System identification, – Assembly or specialized
frequency analysis, machine (assembly-coded) C
learning, and feature
extraction libraries
Microprocessors and Interface Circuits 13
Graphics Processor Unit (GPU)
• A specialized many-core processor designed
especially to perform the calculations required
in graphics rendering
– Render text and graphics, combine multiple
graphic patterns, draw objects, 3D graphics,
shading, and digital video
• GPUs have evolved towards more general
programming models (CUDA, OpenCL)
• Typically quite power hungry
Microprocessors and Interface Circuits 14
7
10/20/2025
Hardware: CPU
Input Input
➢ Arithmetic Logic Unit (ALU)
– Arithmetic functions: add, subtract, multiply and divide
– Logic functions: AND, OR, and NOT control ALU
signal
• Control Unit works under instructions
• An instruction is a pre-defined code which defines a
specific operation, processing and exchanging results
information among CPU, memory and I/O devices.
• CU contains an instructor decoder
– decodes an instruction and generates all control signals,
coordinating all activities within the computer
• CU contains a program counter
– points to the address of the next instruction to be executed
Microprocessors and Interface Circuits 15
Registers
• Registers are specialized locations that the
CPU uses to read or write a binary number
• Registers are used to hold data and address
values
• The number and types of registers depends on
the CPU design
• Registers are used both by the CPU and the
I/O subsystem
Microprocessors and Interface Circuits 16
8
10/20/2025
Instruction Set
Arithmetic and Logic Operations Decisions
Operation Comment Decision Comment
Addition Zero Test a number for zero or not
Subtraction zero
Multiplication Sign Test a number for positive or
negative
Division
AND Logical Carry Test for a carry after addition
Multiplication or a borrow after subtraction
OR Logical Addition Parity Test a number for an even or
an odd number of ones
NOT Logical Inversion
Overflow Test for an overflow that
NEG Arithmetic Inversion
indicates an invalid signed
Shift result after addition or
Rotate subtraction
Microprocessors and Interface Circuits 17
Reflection
• What if we need hardware support for more
complex operations?
– Square root
– Complex filters
–…
Microprocessors and Interface Circuits 18
9
10/20/2025
Instruction Sets
CISC (Complex Instruction Set Computers)
• Variable instruction length (1 word- n words)
• Variable execution time of different format instructions
• More instruction formats
• Upwardly compatible (new instruction set contains earlier generation’s
instructions)
• e.g., 80x86 family has more than 3000 instructions
RISC (Reduced Instruction Set Computers)
• Fixed size (1 word)
• Fixed time for all instructions
• Easy to pipeline the RISC instructions (fast)
• Fewer formats (simple hardware, shorter design cycle)
• e.g., PowerPC, MIPS, ARM, PIC’s MCU
Microprocessors and Interface Circuits 19
Hardware: Memory
Internal External
Cache memory memory
CPU
• Memory hierarchy
– Cache
– Primary memory: ROM, RAM
– Secondary memory: magnetic disk, optical memory, tape, …
Microprocessors and Interface Circuits 20
10
10/20/2025
Discrete Memory Module Organization
To organize a memory module
FFFFFF
FFFFFF ❑ If the module needs bigger unit of
• 8-bit FFFFFF
FFFFFE
FFFFFE
8 MB8 MB transfer than that of given memory chips,
FFFFFE
…………
88-bit
8-bit MB bit extension
……
000001
000001
8-bit ❑ If the module needs larger number of
000001
000000
000000
000000D7~D0
D7~D0 words than that of given memory chips,
FFFFFF
FFFFFF D7~D0 FFFFFE word extension
FFFFFE
FFFFFF
FFFFFD FFFFFE
FFFFFC
• 16-bit? FFFFFD
FFFFFD8 MB
…………
8 MB
88-bit
8-bit MB
FFFFFC
FFFFFC8 MB
…………
8 MB
88-bit
8-bit MB
……
000003
000003 ……
000002
000002
8-bit 8-bit
000003
000001
000001 000002
000000
000000
000001 D15~D8
D15~D8 000000D7~D0D7~D0
• 32-bit?
FFFFFF
FFFFFF FFFFFE
FFFFFE
D15~D8
FFFFFD
FFFFFD
D7~D0
FFFFFC
FFFFFC
FFFFFF
FFFFFB
FFFFFB FFFFFE
FFFFFA
FFFFFA FFFFFD
FFFFF9
FFFFF9 FFFFFC
FFFFF8
FFFFF8
8 MB 8 MB 8 MB 8 MB
FFFFFB8 MB …………
………… FFFFFA8 MB
…………FFFFF9 8 MB ………… FFFFF8 8 MB
88-bit
8-bit MB 88-bit
8-bit MB 88-bit
8-bit MB 88-bit
8-bit MB
……
000007
000007 ……
000006
000006 ……
000005
000005 ……
000004
000004
8-bit 8-bit 8-bit 8-bit
000007
000003
000003 000006
000002
000002 000005
000001
000001 000004
000000
000000
000003 D31~D24 000002
D31~D24 D23~D15 000001
D23~D15 D15~D8
D15~D8 000000D7~D0
D7~D0
Microprocessors and Interface Circuits 21
D31~D24 D23~D15 D15~D8 D7~D0
Memory Characteristics I
Location
• CPU (registers), Internal (Cache, main memory), External (Disk, tape,
DVD)
Capacity
• Word size, Number of words
Unit of transfer
• Internal: Word, External: Usually a block
• Addressable unit: Normally a Byte for internal memory, Cluster on
disks
Microprocessors and Interface Circuits 22
11
10/20/2025
Memory Characteristics II
Access method
• Sequential (tape), Direct (hard disk), Random (RAM, ROM), Associative (Cache)
Performance
• Access time, memory Cycle time, transfer Rate
Physical type
• (Check next slides)
Organization
• Memory hierarchy
• Chip Organization
Microprocessors and Interface Circuits 23
Types of Memory I
• Random-access memory (RAM): Same amount
of time is required to access any location on
the same chip
– Dynamic random-access memory (DRAM):
periodic refresh is required to maintain the
contents of a DRAM chip
– Static random-access memory (SRAM): no
periodic refresh is required
Microprocessors and Interface Circuits 24
12
10/20/2025
Types of Memory II
• Read-only memory (ROM): Can only be read but not
written by the processor
– Mask-programmed read-only memory (MROM): programmed
when being manufactured
– Programmable read-only memory (PROM): the memory chip
can be programmed by the end user
– Erasable programmable ROM (EPROM): electrically
programmable many times
• erased by ultraviolet light (through a window)
• erasable in bulk (whole chip in one erasure operation)
– Electrically erasable programmable ROM (EEPROM): electrically
programmable many times
• electrically erasable many times
• can only be erased in bulk
Microprocessors and Interface Circuits 25
Types of Memory III
• Flash memory
– electrically programmable many times
– electrically erasable many times
– can be erased one location, one row, or whole
chip in one operation
Microprocessors and Interface Circuits 26
13
10/20/2025
I/O Devices
• Input devices such as switches and keyboards
provide binary information to the
microprocessor
• Output devices such as LEDs, video screens,
and printers receive information from the
microprocessor
Microprocessors and Interface Circuits 27
I/O Operation Techniques
Programmed I/O
• Data is exchanged between the processor and the I/O module
• Processor executes a program that gives it direct control of the I/O operation
• When the processor issues a command it must wait until the I/O operation is complete
• If the processor is faster than the I/O module this is wasteful of processor time
Interrupt-driven I/O
• Processor issues an I/O command, continues to execute other instructions, and is interrupted by the
I/O module when the latter has completed its work
Direct memory access (DMA)
• The I/O module and main memory exchange data directly without processor involvement
No Interrupts Use of Interrupts
I/O-to-memory transfer Programmed I/O Interrupt-driven I/O
through processor
Direct I/O-to-memory Direct memory access (DMA)
transfer
Microprocessors and Interface Circuits 28
14
10/20/2025
Three
Techniques
for Input of a
Block of Data
Microprocessors and Interface Circuits 29
IO Devices in a Microcontroller
Microprocessors and Interface Circuits 30
15
10/20/2025
Hardware: Bus
• A bus is a group of wires acting as a communication
pathway connecting two or more devices
• A shared transmission medium: one device at a time
• Transfer address, data, and control information
between microprocessor, memory and I/O
• Arbitration:
– Distributed protocols
• e.g., CSMA/CD
– Centralized scheme
• Master/Slave
– Master activates a bus
– Slave passively waits for command
Microprocessors and Interface Circuits 31
Bus Structure Illustration
Microprocessors and Interface Circuits 32
16
10/20/2025
Hardware: Bus
• Type
– Dedicated (e.g., physical dedication)/Multiplexed (e.g., time
multiplexing)
• Arbitration
– Centralized: bus controller responsible for allocating time on a bus
– Distributed: each module has access control logic and collaborate
• Timing
– Synchronous: events on the bus is determined by a global clock, a
single 1-0 transmission is referred to as a bus cycle
– Asynchronous: devices have their own clocks and communicate before
and after an event
Microprocessors and Interface Circuits 33
Data Bus
• Used to provide a path for moving data between
system modules
• Bidirectional
– CPU read: Memory (I/O device) -> CPU
– CPU write: CPU -> Memory (I/O device)
• The width of data bus
– is as wide as the registers of a CPU (i.e. the width of a word)
– determines how much data the processor can read or
write in one memory or I/O cycle
– Which also defines a word of this computer
Microprocessors and Interface Circuits 34
17
10/20/2025
Address Bus
• Used to designate the source or destination of the data
on the data bus that the processor intends to
communicate with
• Unidirectional
– CPU -> memory| I/O device
• The width of the address bus, n
– determines the total number of memory locations addressable
by a given CPU, which is 2n
– e.g., 8086 has a 20-bit address bus which corresponds to 220
addresses or 1M (1 Meg) addresses or memory locations;
– Pentium has 32-bit address bus, what is the size of its
addressable memory?
– How to calculate the capacity (size) of memory that a CPU can
support then?
Microprocessors and Interface Circuits 35
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
• Consists of two sets of unidirectional control signals
– Command signal: CPU -> Memory (I/O device)
– State signal: Memory (I/O device) -> CPU
• Input/Output is defined from the processor’s point of view
– e.g., when Memory (I/O device) Read is active, data is input to the
processor
Microprocessors and Interface Circuits 36
18
10/20/2025
Single-bus Structure
AB
IO device
CPU RAM ROM I/O ports
IO device
DB
CB
A bus connects all modules
• Pro: simple
• Con: poor performance in terms of throughput
Microprocessors and Interface Circuits 37
CPU-Central Dual-Bus Structure
I/O bus
CPU
I/O ports I/O ports I/O ports
Memory bus
Memory
IO device IO device IO device
• A dedicated bus between CPU and memory, and a dedicated bus between
CPU and I/O devices
– Pro: efficient in terms of data transfer
– Con: information between memory and I/O devices has to go through CPU.
Therefore, poor CPU performance
Microprocessors and Interface Circuits 38
19
10/20/2025
Memory-Central Dual-Bus Structure
I/O bus
Memory I/O port I/O port
CPU Memory
bus
• Gain both High CPU IO device IO device
performance and data
transfer throughput
Microprocessors and Interface Circuits 39
Addressing scheme to accessing
memory and I/O modules
Memory-mapped I/O Isolated I/O
• One single address space • Two separate address
for both memory and I/O spaces for memory and
• Status and data registers I/O modules
of I/O modules are • Using different sets of
treated as memory accessing instructions
locations
• Using the same machine
instructions to access
both
Microprocessors and Interface Circuits 40
20
10/20/2025
Memory-mapped I/O
Address
Address Memory
CPU Address chosen
decoder
chosen I/O
address
M/IO
Microprocessors and Interface Circuits 41
Isolated I/O
MA address
Address Memory address Memory
chosen
CPU CPU
IOA address I/O address I/O
chosen
M/IO M/IO
Dedicated address lines Multiplexing address lines
What is the essential difference between the memory-mapped
and isolated I/O addressing schemes?
Microprocessors and Interface Circuits 42
21
10/20/2025
System Clock
• A particular type of signal that oscillates between a
high and a low state
• Coordinates actions of circuits
• Circuits may become active at either the rising edge or
the falling edge
– in the case of double data rate, on both edges
• System clock determines the speed of the
microprocessor
– If the clock is sped up by a small amount, the
microprocessor will probably still work, at the faster rate
– If the clock is sped up by a larger amount,
the microprocessor will start to make errors.
Instructions will not be executed correctly.
Microprocessors and Interface Circuits 43
Timer/Counter
• A special register which its
content is automatically
incremented/decremented
on each incoming pulse
– Timer: the pulse is generate
by an oscillator
– Counter: the pulse is an
external signal
• An interrupt signal can be
generated upon
overflow/zero
Microprocessors and Interface Circuits 44
22
10/20/2025
Serial Communication
• Suitable for long distance communications
• Different types of serial communication
– How many devices communicate?
– How fast they communicate?
– What is the distance between devices?
– Is it necessary to send and receive data simultaneously?
Microprocessors and Interface Circuits 45
A time and temperature system
Microcontroller based design Microprocessor based design
Microprocessors and Interface Circuits 46
23
10/20/2025
Embedded Systems
• An embedded system uses a microcontroller or a
microprocessor to do one task and one task only
– Example: toys, TV remote, keyless entry, etc.
• Using microcontrollers is cheap but sometimes inadequate for
the task
• Microcontrollers differ in terms of their RAM,ROM, I/O sizes
and type.
– ROM (often used as program memory, like BIOS)
• OTP (One Time-Programmable)
• UV-ROM, EEPROM
• Flash memory
– RAM (can be used as both program mem and data mem)
• SRAM(static RAM): cache
• DRAM(Dynamic RAM): main memory
– SDRAM (Synchronous DRAM)
– DDR DRAM (Double Data Rate DRAM)
– DDRII
Microprocessors and Interface Circuits 47
24