8 Microprocessor & Microcontroller System and Design
8 Microprocessor & Microcontroller System and Design
MICROELECTRONICS
The science and technology of designing, fabrica�ng, and
u�lizing electronic devices and circuits on a microscopic scale.
serves as the founda�on for both microprocessors and
microcontrollers.
• Microprocessor Unit
• Process
• Registers CPU Microprocessor
• Memory Example analogy:
• Control Unit CPU = human brain
Body parts = external devices (mouse, keyboard, wifi,
• Other Parts of Microprocessor Bluetooth card, etc.)
• Architecture Each one of these components houses its own
• How Microprocessor works embedded system which contains
microprocessor.
• Microcontroller vs Microprocessor
• Power supply
Feature Microprocessor CPU
Integrated Circuits (IC) A single IC that contains all The electronic circuitry
AKA Solid State Circuit, chip of the components of a that executes
A circuit of transistor, resistors, and capacitors Defini�on CPU instruc�ons
specific device designed to perform specific func�ons.
ALU, registers, control unit, ALU, registers, control
memory management unit, unit, and memory
Micro- Micro- Micro- and I/O interface management unit
Parts
Feature processor controller computer
Typically, much larger
Small Small
Size Varies than a microprocessor
Type CPU computer computer
Compo- CPU, memory, CPU, memory, Loca�on On a motherboard On a chip
nents CPU I/O ports I/O ports, OS To control the opera�ons
Applica- General- Embedded Personal or Purpose To execute instruc�ons of a computer
�ons purpose systems business
CLOCK
clock of a digital system is a periodic signal.
usually, a square wave to trigger memory latches
simultaneously throughout the system.
Clock circuit controls the opera�on of the microprocessor.
KEY POINTS:
• The Control Unit is like the conductor, orchestra�ng the
Fetch – Decode – Execute Cycle.
• The ALU is the workhorse, performing calcula�ons and logical
opera�ons.
• Registers provide quick access to frequently used data and
instruc�ons.
• This cycle repeats con�nuously, allowing the microprocessor to
execute programs and perform tasks.
Microprocessors and Microcontrollers
BASIC MICROPROCESSOR SYSTEM I/O chip as well but again, this causes no problem because its
chip select line is keeping it switched off.
9. The number 25 is now safely stored in the RAM chip and will
remain there un�l it is over-writen with new informa�on, or
the power is switched off.
Instruc�on: Send the number 25H which is in the ROM and store it
in the RAM at address 2500H.
FLAGS
single-bit indicators that may be set or cleared to show the Types of register:
results of logical or arithme�c opera�on. • MDR (Memory Data Registers)
• MAR (Memory Address Registers)
• MBR (Memory Buffer Registers)
• CIR (Current Instruc�on Registers)
• AC (Accumulator)
• PC (Program Counter)
Accumulator (Ac)
Where intermediate arithme�c and logic results are stored.
Program Counter
Contains the address of the next instruc�on to be executed.
Register Array
consists of registers iden�fied by leters like B, C, D, E, H, L and
accumulator.
1. Primary Storage
It stores and provides the data very fast.
temporary in nature.
To store the data permanently, the data has to be
transferred to the secondary memory.
2. Secondary Storage
slower and cheaper than the primary memory.
Hard Disk, SSD, flash drive, CD etc.
The program that you run on the computer is first
transferred to the primary memory before it is actually
run. Whenever the results are saved, again they get
stored in the secondary memory.
Sta�c RAM (SRAM)
Holds values as long as power is on.
Access �me is very fast.
basic element of SRAM is a latch memory cell.
Row Decoders only.
Vola�le
Data erase when power is off.
Non-Vola�le
Data stored are accessible even a�er power is off.
Microprocessors and Microcontrollers
Dynamic RAM (DRAM)
comprises a Capacitor and a MOSFET.
Since it uses capacitors, it stores informa�on as long as Parameters Cache Memory Register
power is applied, and the memory is refreshed periodically. Defini�on Cache is the fastest The registers are
holds a value of '1' when the capacitor is charged and '0' when and smallest fast storage
it is discharged. component of elements present in
memory in a a very small
major applica�on of RAM is its use in CACHE memories.
computer system. amount in the
Row and Column Address
computer
processor.
Data Stored The recently used The data that the
info/data of a computer’s CPU is
computer gets currently
stored in the cache. processing gets
stored in the
registers.
Used by CPU The CPU u�lizes a The CPU u�lizes
cache for detec�ng registers for
the data that was processing all the
stored previously. data and info that
is new.
Loca�on We can locate the The registers form
cache of a system a part of a
on its motherboard computer device’s
or inside the CPU. CPU.
Data Processing It stores data in a It stores data in an
processed form. unprocessed form.
CPU Memory The CPU of a When opera�ng on
Access Speed system can access registers, a CPU can
the cache memory operate on its
much faster than contents at a rate
that of the register of mul�ple
memory. opera�ons in a
single clock cycle.
Examples Database Query The loop is an
Cache, Dynamic example of the
Page Cache, etc., registers.
are a few examples
Cache Memory of Cache memory.
high-speed memory that comparable with that of the CPU.
located between the main memory and the CPU.
communicates directly with the CPU at high-speed. Stack Memory
stores the most recently used instruc�ons or data. area of memory for keeping temporary data.
CPU uses cache memory to store instruc�ons that are data is added or removed in a "Last-In-First-Out" (LIFO)
repeatedly required to run programs, improving overall system manner.
speed. logical construct or memory management technique
When the processor needs data, it. checks in the high-speed implemented on top of physical hardware memory, typically
cache to see if the data are there. If they are there, called a ' the main memory (RAM).
cache hit', then CPU accesses the data from the cache. If they used by the CALL instruc�on to keep the return address for
are not there, called a 'cache miss', then the CPU retrieves procedures.
them from the rela�vely slower main memory.
Microprocessors and Microcontrollers
Read Only Memory (ROM) .BUSES.
used for permanent or semi-permanent storage of data. “Transmission line”, bus = line: address bus = address line
stores cri�cal programs such as the program that boots the Is a signal lines that enable the flow of electrical impulses (data)
computer (firmware). between components inside a computer or between
Non-vola�le, data retained even a�er the power is turned off. computers.
Data Bus
two-way transmission line (CPU memory, I/O)
Electrically Erasable PROM (EEPROM) connects all the internal computer components to the CPU and
main memory.
Ultraviolet-Erasable PROM (UVEPROM) transfers data bits from processor to memory and from
memory to I/O.
Flash Memory
high-density non-vola�le read/write memory.
combines the low cost and high-density features of an UV
Address Bus
EPROM and the in-circuit electrical erasability feature of one-way transmission line (CPU memory, etc.)
EEPROM without compromising the high-speed access of both. transfer address bits to the memory.
Structurally, the memory cell of a flash memory is like that of In memory or RAM, every memory loca�on has some address.
an EPROM. The processor assigns addresses to the memory and these
addresses are transferred through the address bus.
2. Harvard architecture
Mul�core architecture has two separate memory spaces dedicated to data and
has mul�ple processing cores on a single chip. program/instruc�on code,
1. Symmetric mul�processing (SMP) two address buses,
all cores share the same memory and I/O resources. two data buses for accessing two memory spaces.
This can improve performance for applica�ons that can offers fetching and execu�ons in parallel.
use all of the cores simultaneously.
2. Heterogeneous mul�processing (HMP)
cores may have different capabili�es.
This can improve performance for applica�ons that can
use the specific capabili�es of each core.
Von
Feature Neumann Harvard RISC CISC
Instruc�on Large and Small and Small and Large and
set complex simple simple complex
Instruc�on Complex Simple and Simple and Complex
decoding and slow fast fast and slow
Good for Good for
general- Good for Good for high-
Perfor- purpose scien�fic embedded performance
mance compu�ng compu�ng systems compu�ng
Power
consum-
p�on High Low Low High
Feature
Von Neumann
architecture Harvard architecture
.MICROCONTROLLER.
Single IC that is typically used for specific applica�on and
Single memory space designed to implement certain tasks.
for instruc�ons and Separate memory spaces incorporates all the features that are found in a microprocessor
Memory data for instruc�ons and data + built in ROM, RAM, parallel/serial I/O, counters, and a clock
circuit.
Can be slower for Heart of the Embedded system
applica�ons that Can be faster for
require a lot of memory applica�ons that require a
Performance accesses lot of memory accesses
2 clock cycle/
Execu�on instruc�on 1 clock cycle/instruc�on
Microcontroller
Clock speed
Typical Computers, laptops, Cars, appliances,
applica�ons smartphones, tablets industrial equipment
Microprocessors and Microcontrollers
.COMPUTER LANGUAGES. .TRANSLATORS.
shared w/ Computer Programming
High-level languages
In this language, program (source code/program) is writen in
English-like words syntax and these programs are executed on a
microprocessor using a translator named as compiler or an
interpreter.
Assembly language
uses mnemonics (shorthand for machine instruc�ons) to make
the code easier to read and write.
The 8085 microprocessor has 246 such bit paterns, amoun�ng
to 74 different instruc�ons for performing various opera�ons.
These 74 different instruc�ons are called its instruc�on set.
Hardware
Binary codes to pulses. Interpreter
is a program that converts one statement of a program at a
�me.
Third
1960s – 1970s Integrated Circuit Based
Genera�on
Fourth
1970s – Present Microprocessor Based
Genera�on
Ar�ficial Intelligence
Fi�h
Present – Future Based, Quantum
Genera�on
compu�ng