Microprocessor Systems Simplified
Microprocessor Systems Simplified
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
Microprocessor Microcontroller
Since memory and I/O are connected externally, Since memory and I/O are present together, the
the circuit becomes large in size. internal circuit is small in size.
It cannot be used in compact systems It can be used in compact systems.
RAM, ROM, I/O units, and other peripherals are not RAM, ROM, CPU and other peripherals are
embedded on a single chip. embedded on a single chip.
Do not have power saving mode. Have a power-saving mode.
Complex and expensive due to a large number of Simple and inexpensive due to less number of
instructions to process. instructions to process.
Can run at a very high speed. Can run up to 200MHz or more.
1
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
What is a microprocessor?
Microprocessor is a type of computer processor in which both the data processing logic and control
are included on a single integrated circuit or on small numbers of integrated circuits. These
processors consist of logic, control and arithmetic circuits. Its integrated circuit is capable of
interpreting and executing program instructions. These are multiple-purpose, clock-driven and
register-based digital integrated circuits that accept input in binary data and process it as per the
instruction stored in its memory.
Components of a Microprocessor
Types of Microprocessors
Microprocessors are segregated according to their usage. There are three main types of
microprocessors:
1. CISC Microprocessor
Complex instruction set computer (CISC) microprocessors are designed for executing complex
instructions that minimize the total number of instructions per program. In a complex instruction,
there are multiple instructions, such as reading from memory or any arithmetic operation. It requires
multiple machine cycles for executing an instruction due to the large size of the instruction set that
has multiple addressing modes in a single instruction.
These are the microprocessors that are designed for processing any signal such as radar, sonar,
image processing, image processing, etc. They can process multiple signals at a time in parallel
operation. These microprocessors convert between analogue (ADC) and digital (DAC) signals. Then,
they process them by filtering, compressing and applying algorithms in the digital format.
3. RISC Microprocessor
2
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
A Reduced Instruction Set Computer (RISC) is designed for executing simple instructions. The
number of instructions is reduced to 30-40. Instructions are simplified to reduce execution time. The
format and the size of these instructions is fixed and limited. Since the instruction is completed in a
clock cycle, more lines of program code and more memory are required for storing the instruction.
There is less load on hardware and more on either compiler or software.
These are the special processors that control and manage the input-output tasks in a computer. They
have direct access to memory, and unlike CPUs, they only process the I/O peripherals. While the CPU
sends instructions for operation, IOP executes them.
These microprocessors combine identical BSMs to form microprocessors of the desired word size.
The objective is to design microprocessors of the desired width by increasing the bit size. Two or more
identical BSMs are cascaded to form processors of both conventional and unconventional word
sizes.
6. Graphics Processors
These are the special types of microprocessors that accelerate the process of image creation. GPU
consists of a graphic processor and other essential components such as cooling components and
RAM. They parallelly execute instructions, due to which they perform faster than CPUs. Graphic
processors are found in gaming consoles, smartphones and computers and are used for rendering
images in CGI or video games.
7. Coprocessor
These are the special-purpose microprocessors that aid the primary processor in processing
complex tasks to improve its performance. The Coprocessor shares its processing power with the
primary processor to reduce the load off. It works independently and is very fast in executing tasks
due to limited instruction sets. This microprocessor is used for single processing, I/O interfacing
operations, complex arithmetic and graphic operations. It is physically distinct from the CPU.
The 8085 is an accumulator based 8-bit The 8086 is a register based 16-bit
Definition microprocessor which can process 8-bit of data microprocessor which can process 16-bit
at a time. of data at a time.
3
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
The 8085 microprocessor has a data bus of 8-bit The size of the data bus of the 8086
Data bus size
size. microprocessor is 16-bit.
The size of the address bus of the 8085 The size of the address bus of the 8086
Address bus size
microprocessor is 16-bit. microprocessor is 20-bit.
ALU (Arithmetic
The 8085 microprocessor has an 8-bit ALU. The 8086 microprocessor has 16-bit ALU.
Logic Unit) size
Number of The 8085 microprocessor consists of 6500 The 8086 microprocessor consists of
transistors transistors in its structure. 29000 transistors.
The 8085 microprocessor can perform addition, The 8086 microprocessor is able to
subtraction, increase, decrease, compare, AND, perform all the operations of the 8085
Operations
OR, X-OR, shift and complement. However, it microprocessor, as well as multiplication
does not support multiplication and division. and division.
Pipelining The pipelining architecture is not supported by The 8086 microprocessor supports
architecture the 8085 microprocessor. pipelining architecture.
4
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
What is a microcontroller?
A microcontroller is a small, low-cost microcomputer on a single VLSI integrated circuit (IC) chip. It
controls portions of an electronic system through a microprocessor unit (MOU) and some
peripherals. Microcontroller contains processor cores with additional peripherals such as serial
interface, time, programmable I/O, and memory on the same chip. It interacts with other
components due to its functionality resulting from combining digital memory and a digital processor
with additional hardware. A microcontroller is also an Embedded controller, a single-chip-computer,
or a computer on a chip.
Components of a Microcontroller
Microcontrollers consist of the following mentioned components:
• Central Processing Unit (CPU)
• Program Memory (ROM)
• Data Memory (RAM)
• Timers and Counters
• I/O Ports (I/O – Input/Output)
• Serial Communication Interface
• Clock Circuit (Oscillator Circuit)
• Interrupt Mechanism
• CAN (Controlled Area Network)
• SPI (Serial Peripheral Interface)
• I2C (Inter-Integrated Circuit)
• DAC (Digital to Analog Converter)
• ADC (Analog to Digital Converter)
• USB (Universal Serial Bus
5
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
Types of Microcontrollers
• 8-bit Microcontroller: These are 8-bit microcontrollers that are 1 byte wide long. These
microcontrollers use a word size of 8 bits. Such a microcontroller can transfer and process
information of 8 bits in a single cycle. Each cycle has a final bit data width range of 0×00 –
0xFF (0-255). These can clock at decently high frequencies in applications that do not require
many rapid calculations. Here, internal registers are 8 bits wide, and memory access also
reads 8 bits at a time. However, an 8 bits microcontroller may sometimes have a 16-bit
address. ‘ATmega328p’ used in the Arduino Uno is an 8/16-bit hybrid microcontroller.
• 16-bit microcontroller: These have more precision and better performance than an 8-bit
microcontroller. This is due to their bit data width having a range of 0×0000 – 0xFFFF (0-
65535) for each cycle. It is a self-contained system that includes a processor, memory, and
peripherals that can be embedded into any system. It allows better management of data and
calculations at once. They have a faster clock speed and less power consumption than an 8-
bit microcontroller.
• 32-bit microcontroller: These microcontrollers can execute functions with fewer instruction
cycles due to their wider data bus. These have more memory and peripherals such as USB,
Ethernet Mac, CAN, and SD/MMC that might not be available in 8-bit MCU. These
microcontrollers operate at higher frequencies between tens to hundreds of Mhz.
• External Memory Microcontroller: These microcontrollers do not have all functional blocks
on a chip.
Microcontrollers vs Microprocessors:
Similarities Between Microcontrollers and Microprocessors
Microprocessors and microcontrollers are different types of electronic devices that have a number
of differences. However, both have a few similarities as well. The following points highlight the
similarities between microcontrollers and microprocessors:
• Both microprocessor and microcontroller are semiconductor components that are built on
IC.
6
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
• Microcontroller and microprocessor both have a CPU through which both components
process instructions and perform calculations.
• Both consist of ALU, CPU, registers, address bus, data bus and control bus.
• Both microprocessors and microcontrollers are built with internal registers. However, the
number of registers is higher in microcontrollers as compared to microprocessors.
B. Fetch-Decode-Execute Cycle
7
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
The central processing unit (CPU) is like the brain of the computer. It works by following a basic
process called the fetch-decode-execute cycle, or instruction cycle. This cycle is how the CPU
handles instructions from a program.
The first step in the instruction cycle is fetching the instruction from memory. The CPU relies on a
special register called the program counter (PC) to keep track of the address of the next instruction
to be executed.
• The CPU sends a signal to the memory to retrieve the instruction at that address.
This stage is crucial because it ensures that the CPU knows what task to perform next.
Once the instruction is fetched, the next step is to decode it. The control unit (CU) of the CPU is
responsible for this process.
• The CPU breaks down the instruction into its components, typically an operation
code (opcode -> The part of a machine language instruction that specifies the operation to
be performed) and operands(The components of an instruction that provide the data or
addresses needed for the operation).
• The opcode indicates the type of operation to be performed, such as addition, subtraction,
data transfer, or control operations like jumps.
• The operands specify the data to be used or the addresses of the data involved.
Decoding translates the instruction into signals that can trigger the appropriate actions within the
CPU.
The final stage is execution. Here, the CPU carries out the decoded instruction using its arithmetic
logic unit (ALU) and other components.
• Fetching any necessary data from registers or memory as specified by the instruction.
• Performing the operation defined by the opcode (e.g., adding two numbers, moving data from
one place to another, or branching to a different part of the program).
8
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
This stage effectively completes the task defined by the original instruction, modifying the system’s
state accordingly.
To fully understand the fetch-decode-execute cycle, it’s essential to know the primary components
involved
• Control Unit (CU): Decodes the instruction and manages the execution process.
• Registers: Small, fast storage locations for temporary data and instructions.
Example
1. Fetch: The PC points to the memory address 100. The instruction at this address, ADD A, B,
is fetched and stored in the IR.
2. Decode: The CU decodes the ADD A, B instruction, identifying it as an addition operation and
determining the locations of operands A and B.
3. Execute: The CPU fetches the values from locations A and B, performs the addition, and
stores the result in a specified register or memory location.
9
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
o Logical operations: Carrying out logical operations such as AND, OR, NOT, and
XOR.
o Comparison operations: Comparing values to make decisions based on the
results.
3. Control:
o Fetching instructions: Retrieving instructions from memory.
o Decoding instructions: Interpreting instructions to determine the required actions.
o Executing instructions: Performing the operations specified by the instructions.
o Sequencing instructions: Controlling the order in which instructions are executed.
4. Data Storage:
o Storing data: Temporarily holding data in registers or permanently storing data in
memory.
o Managing memory: Allocating and deallocating memory as needed.
D. Instruction Set
An instruction set is a collection of commands that a microprocessor understands and can execute.
Each instruction is a binary code that tells the microprocessor to perform a specific operation, such
as adding two numbers, moving data from one location to another, or making a decision based on a
condition.
Types of Instructions
Instruction sets typically include several categories of instructions:
1. Data Transfer Instructions:
o Move data between registers.
o Load data from memory into registers.
o Store data from registers into memory.
o Input/output operations.
2. Arithmetic Instructions:
o Addition, subtraction, multiplication, and division.
o Increment, decrement, and negation.
3. Logical Instructions:
o AND, OR, NOT, XOR operations.
o Shift and rotate operations.
4. Control Flow Instructions:
o Jump to a specific address.
o Conditional jumps based on flags.
o Call and return from subroutines.
5. Stack Operations:
o Push data onto the stack.
o Pop data from the stack.
10
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
Instruction Format
Instructions are typically represented in a specific format, which includes:
• Opcode: The operation code, which specifies the type of operation to be performed.
• Operands: The data or memory addresses involved in the operation.
Simple 8085 assembly program to swap the contents of two memory locations:
; Initialize memory locations
MVI A, 10H ; Load 10 into the accumulator
MVI B, 20H ; Load 20 into the B register
MVI M, A ; Store the value of A at memory location pointed to by HL
MVI M, B ; Store the value of B at the same memory location
; End of program
HLT
11
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
Explanation:
1. Data Initialization:
o MVI A, 10H: Loads the value 10 into the accumulator.
o MVI B, 20H: Loads the value 20 into the B register.
o MVI M, A: Stores the value of the accumulator (10) at the memory location pointed
to by the HL register pair.
o MVI M, B: Stores the value of the B register (20) at the same memory location.
2. Swapping:
o LDA 1000H: Loads the value at memory location 1000H (which is 20) into the
accumulator.
o MOV B, M: Moves the value at the memory location pointed to by HL (which is 20) to
the B register.
o LDA 1001H: Loads the value at memory location 1001H (which is 10) into the
accumulator.
o STA 1000H: Stores the value of the accumulator (10) at memory location 1000H.
o MOV M, B: Stores the value of the B register (20) at memory location 1001H.
3. Program Termination:
o HLT: Halts the processor.
This code demonstrates the use of basic data transfer instructions to swap the contents of two
memory locations.
E. I/O Interfacing
I/O interfacing is the process of connecting input and output devices to a microprocessor or
microcontroller. It involves hardware and software components that enable the system to
communicate with external devices.
12
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025
b. Interface Devices
Interface devices are hardware components that facilitate communication between the
microprocessor and external devices. Some common interface devices include:
• Parallel Port: Transfers multiple bits of data simultaneously.
• Serial Port: Transfers data bit by bit, one at a time.
• USB Port: A high-speed serial port for connecting various devices like keyboards, mice, and
printers.
• Ethernet Port: For network connectivity.
• I²C Bus: A serial bus for communication between multiple devices.
• SPI Bus: A serial bus for communication between master and slave devices.
c. Time-Based I/O
Time-based I/O is a method of data transfer where the timing of data transfer is controlled by a clock
signal. This method is often used for simple devices like keyboards and displays. The microprocessor
periodically checks the input device for data or sends data to the output device.
d. Handshaking
Handshaking is a synchronization technique used to ensure reliable data transfer between devices.
It involves a series of signals exchanged between the devices to coordinate the transfer process.
Common handshaking protocols include:
• Request/Acknowledge: The device requests data, and the microprocessor acknowledges
the request.
• Strobe: A signal is used to indicate the start and end of data transfer.
• Three-Wire Handshake: Uses three signals: Request, Acknowledge, and Data Valid.
13
Instructor: Engr. Daniel Gracias V. Esquejo