CpE 323 –
Microprocessor Systems
This is a property of
PRESIDENT RAMON MAGSAYSAY STATE UNIVERSITY
NOT FOR SALE
CpE 323 – Microprocessor Systems
First Edition, 2025
Copyright. Republic Act 8293 Section 176 provides that “No copyright shall subsist in any work of
the Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such agency or
office may, among other things, impose as a condition the payment of royalties.
Borrowed materials included in this module are owned by their respective copyright holders. Every
effort has been exerted to reach and seek permission to use these materials from their respective
copyright owners. The University and authors do not claim ownership over them.
Learning Module Development Team
Assigned
Title Author
Chapter
Structural Components of
Chapter 1:
Microprocessor/Microcontroller
Chapter 2: Data Representation and Number Systems
Chapter 3: Fetch-Decode-Execute
Functional Operations of Microprocessor/ Dionisio M. Martin Jr.
Chapter 4:
Microcontroller
Chapter 5:
Chapter 6:
Chapter 7:
Evaluators:
Dr. Marlon James Dedicatoria, Program Chair
Engr. Ferndinand Tabligan, Program Chair
Engr. Gilbert Deboma, Dean
Course Overview
Introduction
The Microprocessor Systems course is a four-unit professional course which offers an in-
depth exploration of microprocessors and their application in embedded systems. It provides
students with the foundational knowledge required to understand, program, and interface
microprocessors with various peripherals.
This course provides a comprehensive introduction to microprocessor architecture,
programming, and embedded system design. It combines theoretical learning with practical,
hands-on experience to prepare students for working in the rapidly evolving fields of
electronics, embedded systems, and automation.
By the end of the course, students will gain practical skills in designing, programming, and
debugging microprocessor-based systems used in a wide range of modern technologies such as
robotics, automation, communication devices, and consumer electronics.
Course General Objectives
At the end of the semester, 85% of the students have attained 90% level of understanding for
being aware in the computer engineering, locally and globally.
1. Understand the structure and architecture of microprocessor systems.
2. Learn how to program and interface microprocessors with peripherals.
3. Explore microprocessor components, such as ALU, control unit, registers, memory,
and I/O systems.
4. Develop skills in assembly language programming and higher-level languages for
microprocessor systems.
5. Understand microprocessor communication protocols (e.g., I2C, SPI, UART).
6. Implement real-time systems and control applications using microprocessor-based
systems.
Course Details:
Course Code: CpE 323
Course Title: Microprocessor Systems
No. of Units: 4-unit lecture
Classification: Lecture with Laboratory-based
Pre-requisite / Co-Requisite: Logic Circuit and Design
Semester and Academic Year: 2nd Semester, AY 2025-2026
Schedule: BSCpE 3A – Monday and Wednesday, 9:00 AM - 10:30 AM
BSCpE 3B – Tuesday and Thursday, 12:30 PM - 2:00 PM
Name of Faculty: Dionisio M. Martin Jr.
Contact Details
Email: dmmartinjr@[Link]
Mobile Number: 0939-906-0585
FB Account: Dionisio Martin Jr.
Consultation
Day: MWF
Time: 1:00-2:00PM
Learning Management System
The University LMS will be used for asynchronous learning and assessment. The link and class
code for LMS will be provided at the start of class through the class’ official Facebook Group.
Edmodo
Google Classroom
University LMS
Assessment with Rubrics
Students will be assessed in a regular basis thru quizzes, assignments, individual/group outputs
using synchronous and/or asynchronous modalities or submission of SLM exercises. Rubrics
are also provided for evaluation of individual/group outputs.
Major examinations will be given as scheduled. The scope and coverage of the examination
will be based on the lessons/topics as plotted in the course syllabus.
0323
Module Overview
Introduction
The Microprocessor Systems course introduces students to the fundamental concepts of
microprocessors and their role in embedded systems. It covers the architecture, operation,
programming, and applications of microprocessors, equipping students with the knowledge
and skills to work with microprocessors in real-world projects.
Microprocessors form the backbone of modern electronics, from simple household devices to
complex industrial control systems. As the demand for embedded systems continues to grow,
understanding how microprocessors work, how they are programmed, and how they interface
with external systems is crucial for engineering students. The Microprocessor Systems course
prepares students for careers in electronics, automation, robotics, and embedded system design
by providing the foundation needed to work with real-time systems and hardware interfaces.
The course emphasizes practical application, enabling students to design, build, and
troubleshoot microprocessor-based systems. It integrates theoretical learning with laboratory
sessions and project work, where students can apply their knowledge to solve real-world
problems.
Table of Contents
Chapter 1: Structural Components of Microprocessor/Microcontroller
Chapter 2: Data Representation and Number Systems
Chapter 3: Fetch-Decode-Execute
Chapter 4: Functional Operations of Microprocessor/ Microcontroller
Chapter 5:
Chapter 6:
Chapter 7:
Microprocessor Systems
Chapter 4
Functional Operations of
Microprocessor/
Microcontroller
Chapter 4
Functional Operations of Microprocessor/ Microcontroller
Introduction
Microprocessors and microcontrollers are the core components of digital computing and
embedded systems. They function as processing units that execute instructions, control devices,
and manage data. While both serve computational purposes, their functional operations differ
based on their applications.
A microprocessor is a general-purpose processing unit that performs arithmetic and logical
operations but requires external components (such as memory and input/output peripherals) to
function. It is commonly used in computers and high-performance computing applications.
A microcontroller, on the other hand, is an integrated system that includes a microprocessor,
memory, and input/output peripherals on a single chip. It is optimized for specific control
applications such as automation, robotics, and IoT devices.
Specific Objectives
At the end of the lesson, the students should be able to:
- describe the key functions such as instruction execution, data processing, memory
management, input/output handling, and communication.
- identify the components and functions of a microcontroller.
- explain how interrupts and timers enhance real-time processing in embedded systems.
Duration
Chapter 4: Functional Operations of Microprocessor/ = 2 hours
Microcontroller (1.5-hours discussion;
0.5-hour assessment)
_____________________________________________
FUNCTIONS AND STRUCTURES
Structure and Function
Structure – is the way in which components relate to each other.
Function – is the operation of individual components as part of the structure.
Basic Functions of Computer
In general, computer functions are:
data processing data movement
data storage control
A Functional View of the Computer
Internal Structure of Computer
The Computer Top-Level Structure
Four main structural components of computer:
Central processing unit (CPU): Controls the operation of the computer and
performs its data processing functions; often simply referred to as processor.
Main memory: Stores data.
I/O: Moves data between the computer and its external environment.
System interconnection: Some mechanism that provides for communication among
CPU, main memory, and I/O. A common example of system interconnection is by
means of a system bus.
Functional Operations of Microprocessors
A microprocessor is the central unit of a computing system responsible for executing
instructions, processing data, and controlling hardware. Its functional operations can be
categorized into four main areas:
1. Data Movement (Data Transfer Operations)
Microprocessors move data between different locations, such as registers,
memory, and input/output devices.
Microprocessors functions are:
Register-to-Register Transfer – Moving data between processor registers.
Memory-to-Register Transfer – Loading data from memory to registers.
Register-to-Memory Transfer – Storing processed data from registers into
memory.
I/O Operations – Sending and receiving data from external devices (e.g.,
sensors, displays, storage).
Example:
Copying a value from a memory address into a CPU register for processing.
Below is an examples demonstrating data movement using 8085 Assembly Language.
Moving Data Between Registers and Memory
MVI A, 25H ; Load immediate value 25H into Acc(A)
MOV B, A ; Copy value from register A to B (Reg-Reg transfer)
LXI H, 2000H ; Load HL register pair with memory address 2000H
MOV M, A ; Store value of A into memory (Reg-Mem transfer)
MOV C, M ; Load value from memory into register C (Mem-Reg transfer)
2. Data Processing (Arithmetic and Logical Operations)
The microprocessor performs calculations and logical operations on data. And
these are:
Arithmetic Operations – Addition, subtraction, multiplication, division.
Logical Operations – AND, OR, XOR, NOT for decision-making.
Bitwise Operations – Shifting and rotating bits in a binary number.
Comparison Operations – Checking if values are equal, greater, or smaller.
Example:
A microprocessor adds two numbers from registers and stores the result.
Below is an examples demonstrating data processing using 8085 Assembly Language.
Arithmetic Operations (Addition, Subtraction, Multiplication, Division)
MVI A, 05H ; Load 5 into A
MVI B, 03H ; Load 3 into B
ADD B ; A = A + B (5 + 3 = 8)
MVI C, 10H ; Load 10 into C
SUI 04H ; A = A - 4 (8 - 4 = 4)
MVI D, 02H ; Load 2 into D
MOV A, D
MUL D ; Mul is not directly supported in 8085, requires subroutine
MVI A, 10H ; Load 10 into A
MVI B, 02H ; Load 2 into B
DIV B ; Div is not directly supported in 8085, requires subroutine
Logical Operations (AND, OR, XOR, NOT)
MVI A, 0AH ; Load A with 0AH (1010 in binary)
MVI B, 05H ; Load B with 05H (0101 in binary)
ANA B ; A = A AND B (1010 AND 0101 = 0000)
MVI A, 0AH
ORA B ; A = A OR B (1010 OR 0101 = 1111)
MVI A, 0AH
XRA B ; A = A XOR B (1010 XOR 0101 = 1111)
CMA ; Complement A (NOT operation)
3. Data Storage (Memory Operations)
The microprocessor temporarily or permanently stores data in different memory
units.
Storage functions are:
Register Storage – Storing frequently used data in fast-access registers.
Cache Memory Access – Using small, high-speed memory to store recently
accessed instructions.
RAM Storage – Holding temporary data for program execution.
Permanent Storage (ROM, Hard Disk, SSD) – Storing firmware, boot
instructions, and large datasets.
Example:
A microprocessor stores temporary results in RAM for quick access during
program execution.
Below is an examples demonstrating data storage using 8085 Assembly Language.
Storing and Retrieving Data from Memory
MVI A, 12H ; Load A with 12H
LXI H, 2000H ; Load HL with address 2000H
MOV M, A ; Store A's value at memory location 2000H
LXI H, 2000H ; Load HL with address 2000H
MOV A, M ; Load value from memory 2000H into A
4. Control (Instruction Execution & System Management)
The microprocessor controls the flow of program execution and coordinates
hardware operations.
Execution and system managements are:
Fetching Instructions – Retrieving program instructions from memory.
Decoding Instructions – Interpreting what actions to perform.
Executing Instructions – Carrying out arithmetic, logical, or I/O operations.
Interrupt Handling – Pausing execution to handle urgent tasks.
Power Management – Adjusting power consumption for energy efficiency.
Example:
A microprocessor fetches an instruction to read sensor data, processes it, and
sends the output to a display.
Below is an examples demonstrating control operations using 8085 Assembly Language.
Jump and Loop Operations
MVI C, 05H ; Load loop counter with 5
LOOP_START:
DCR C ; Decrement counter
JNZ LOOP_START ; Jump back to LOOP_START if C ≠ 0
Example: Interrupt Handling (RST 7.5)
EI ; Enable interrupts
MVI A, 0FFH ; Load A with FFH
OUT 01H ; Send A's value to port 01H
HLT ; Halt the processor
FUNCTIONS OF MICROPROCESSOR
Microprocessors perform a variety of function many electronic computing devices
and embedded systems. As microprocessors act as the brain of all computing devices like
computers, laptops, smartphones, autonomous vehicles, etc.
Functions of Microprocessor
The major functions of a microprocessor are explained below with the help of examples:
1. Arithmetic Operations
It is the most fundamental function that a microprocessor performs. A microprocessor
is capable in performing basic arithmetic calculations like addition, subtraction,
multiplication, and division. These operations are very important in many computing
tasks such as solving math problems, enabling graphics, processing financial data, etc.
Some practical examples of arithmetic operations performed by microprocessors are:
Calculating the total of numbers
Measuring distances in GPS-based navigation system
Calculating interest rates in banking systems, etc.
2. Logical Operations
Logical operation is another key function that microprocessors perform. To perform
logical operations, microprocessors compare two or more values and make a decision
depending on the logical condition.
Examples of logical operations performed by microprocessors include:
Verifying if a password is correct during login
Sorting list of items based on specified parameters
Filtering messages or emails as read/unread/spam/important based on keywords,
etc.
3. Data Handling
Data handling is another important function that microprocessors perform. Data
handling involves moving data among different parts of the system, storing, and
retrieving data, etc.
Some of the practical examples of data handling in microprocessors include:
Fetching data or webpages from a server
Saving a document, pdf, image, or any other type of file
Moving or copying photos or videos from a computer to a pen drive, etc.
4. Control Operations
Microprocessor also controls the flow of instruction and defines the sequence in
which tasks will be performed. The following are examples of control operations that
microprocessors perform:
Controlling the speed of cooling fan in a laptop depending on the temperature
Regulating temperature in a microwave oven
Controlling the sequence of traffic lights depending on the traffic density, etc.
5. Instruction Execution
Instruction execution is the most fundamental function of a microprocessor.
Microprocessors execute different kinds of instructions to perform specific tasks. For
example:
Opening a software like Microsoft Word in laptop
Removing the background in an image
Scanning a computer by using an antivirus, etc.
6. Interrupt Handling
Microprocessors also handle interrupts. This function of microprocessor allows to
prioritize important tasks and temporarily stop other less important processes. For
example:
It pauses a video when battery is low
When a message is received, it displays a pop-up notification
Stops the printing process immediately, when cancel button is pressed, etc.
7. Power Management
Microprocessor also manages the power consumption by the system. It issues
commands to put unused components into low-power state to save energy. For example:
When the computer is not in use, it reduces the power consumed by processor,
memory unit, peripherals, etc.
It turns off the backlight of the screen when the device is inactive for a certain
period.
Reduces the cooling fan speed when device’s temperature is normal, etc.
FUNCTIONS OF MICROCONTROLLER
A microcontroller is a compact integrated circuit that controls specific functions
within embedded systems. It consists of a processor, memory, and input/output peripherals on
a single chip. Here are its main functions:
1. Processing & Control
The microcontroller’s CPU (Central Processing Unit) executes program instructions
stored in memory. It processes data, performs calculations, and makes decisions based on
logic. For example,
Executes assembly or high-level programming instructions (C, C++, Python, etc.).
Manages system operations and coordinates different components.
Controls input and output devices based on logic and user-defined programs.
2. Memory Management
A microcontroller has different types of memory for storing programs and data:
Flash Memory – Stores the program code permanently (non-volatile).
RAM (Random Access Memory) – Stores temporary data while the
microcontroller is running (volatile).
EEPROM (Electrically Erasable Programmable Read-Only Memory) – Stores
user-configurable settings that must be retained after power loss (non-volatile).
3. Input Handling
Microcontrollers interact with external sensors and devices through GPIO (General-
Purpose Input/Output) pins. For example,
Reads digital inputs (e.g., push buttons, switches).
Reads analog inputs using an Analog-to-Digital Converter (ADC) (e.g.,
temperature sensors, light sensors).
4. Output Handling
The microcontroller sends signals to control external devices. For example,
Turns LEDs ON/OFF.
Drives motors using Pulse Width Modulation (PWM) signals.
Displays data on LCD/OLED screens.
Sends signals to relays, buzzers, and actuators.
Controls actuators and relays.
5. Communication
Microcontrollers communicate with other devices using wired or wireless protocols. It
interfaces with external devices like computers, sensors, and modules (Wi-Fi, Bluetooth,
GSM, etc.). The following communication protocols are:
UART (Universal Asynchronous Receiver-Transmitter) – Serial communication.
Example: A common application in microcontrollers is wireless
communication using a Bluetooth module and Serial Monitor.
I2C (Inter-Integrated Circuit) – Communication with multiple devices using
fewer pins.
Example: Interfacing a microcontroller with an LCD display module through
an I2C interface.
SPI (Serial Peripheral Interface) – Faster data transfer between microcontroller
and peripherals.
Example: Interfacing a microcontroller with an SD Card module for data
logging.
CAN (Controller Area Network) – Used in automotive applications for
communication between sensors and controllers.
Example: Sending engine temperature data from a sensor microcontroller to
the vehicle dashboard using the CAN protocol.
6. Timing & Counting
Microcontrollers use timers and counters for precise timing operations. It generates
delays, measures time intervals, and creates PWM (Pulse Width Modulation) signals for
controlling brightness or motor speed.
7. Interrupt Handling
An interrupt is a mechanism that allows the microcontroller to stop its current task
and handle a high-priority event.
Types of Interrupts:
External Interrupts – is triggered by external events like a button press.
Internal Interrupts – is triggered by timers or communication interfaces.
8. Power Management
To improve efficiency, microcontrollers have low-power modes to save energy.
Power-Saving Features:
Sleep Mode – Disables unused peripherals to reduce power consumption.
Wake-up on Event – The microcontroller can wake up when an input event occurs.
9. Analog-to-Digital & Digital-to-Analog Conversion
Microcontrollers process digital signals, but many real-world applications use analog
signals. For example,
Converts analog sensor signals to digital values using ADC (Analog-to-Digital
Converter).
Converts digital values back to analog using DAC (Digital-to-Analog Converter).
10. Embedded System Integration
Microcontrollers serve as the brain in embedded systems, integrating all components for
automation and control. The following are examples of a system that uses microcontrollers:
Industrial Automation – Controls conveyor belts, robotic arms, and monitoring
systems.
IoT (Internet of Things) Devices – Smart home devices like thermostats and
security cameras.
Medical Devices – Heart rate monitors and insulin pumps.
_____________________________________________
References/Additional Resources/Readings
[Link]
Activity Sheet
ACTIVITY 4
Name: ___________________________ Course/Year/Section: ___________ Score: _________
Direction: Encircle the letter of the best answer.
1. What is the key difference between a microprocessor and a microcontroller?
a) A microprocessor has built-in memory and I/O, while a microcontroller needs
external components.
b) A microcontroller is for general computing, while a microprocessor is for embedded
systems.
c) A microprocessor requires external memory and I/O, while a microcontroller
integrates them.
d) A microcontroller cannot perform arithmetic operations, but a microprocessor can.
2. In an 8085 microprocessor, which of the following is NOT a valid data transfer operation?
a) Register-to-Register Transfer b) Memory-to-Register Transfer
c) Register-to-Memory Transfer d) Direct Memory-to-Memory Transfer
3. Which type of memory is best suited for storing frequently accessed data to improve processing
speed in a microprocessor system?
a) ROM b) Cache Memory c) EEPROM d) Flash Memory
4. What is the main function of the system bus in a computer system?
a) To provide power to the microprocessor
b) To interconnect the CPU, memory, and I/O devices for data transfer
c) To execute arithmetic and logical operations
d) To permanently store the operating system
5. Which of the following operations is NOT directly supported by the 8085 microprocessor and
requires a software subroutine?
a) Addition b) Subtraction c) Multiplication d) Logical AND
6. What is the primary role of an interrupt in a microprocessor-based system?
a) To execute loops more efficiently
b) To pause program execution and handle urgent events
c) To increase clock speed dynamically
d) To store permanent data in registers
7. Which of the following best explains why microcontrollers use GPIO pins?
a) To perform arithmetic calculations faster
b) To communicate with sensors, actuators, and external devices
c) To increase the clock speed of the microcontroller
d) To store large datasets for data processing
8. Which of the following statements about power management in microcontrollers is TRUE?
a) Microcontrollers have no power-saving features and always operate at full power.
b) Sleep mode disables unused peripherals to reduce power consumption.
c) Power management is only applicable to microprocessors, not microcontrollers.
d) Reducing power consumption is impossible without external components.
9. In an 8085 microprocessor, which register pair is commonly used for addressing memory locations?
a) BC b) DE c) HL d) SP
10. What happens in the execution cycle of a microprocessor when a conditional jump instruction is
encountered and the condition is NOT met?
a) The microprocessor continues execution sequentially.
b) The microprocessor halts immediately.
c) The microprocessor resets all registers.
d) The microprocessor ignores the instruction and moves to the next loop iteration.
11. Which of the following memory types in a microcontroller retains data even when power is lost?
a) RAM b) Cache Memory c) EEPROM d) Register Memory
12. In 8085 assembly language, what is the effect of the HLT instruction?
a) It resets all registers to zero. b) It stops program execution indefinitely.
c) It clears the accumulator. d) It jumps to the reset vector.
13. Which of the following operations requires an ISR in a microprocessor?
a) Basic arithmetic operations b) Handling external events like keypress detection
c) Loop execution d) Moving data between registers
14. In the context of system interconnection, what is the primary role of the address bus?
a) To transfer control signals between components
b) To carry memory addresses from the processor to memory locations
c) To exchange data between the CPU and peripherals
d) To generate clock signals
15. In an 8085 microprocessor, what does the MOV M, A instruction accomplish?
a) Moves data from memory to the accumulator
b) Moves data from the accumulator to a memory location pointed to by the HL register
c) Moves data from register A to register M
d) Moves data from a general-purpose register to a memory location
16. Which of the following is TRUE about timers in a microcontroller?
a) Timers always run at a fixed frequency and cannot be adjusted.
b) Timers can be used to generate precise time delays and count external events.
c) Timers are only used for generating PWM signals.
d) Timers do not work in low-power modes.
17. Why is the fetch-decode-execute cycle critical in microprocessor operations?
a) It defines the method by which a microprocessor executes instructions step by step.
b) It ensures data is stored permanently in memory.
c) It determines the voltage levels required for different operations.
d) It is only applicable to microcontrollers, not microprocessors.
18. In the context of microprocessor, which of the following best describes the role of a system bus?
a) It generates clock signals for the processor.
b) It interconnects the CPU, memory, and I/O devices for data communication.
c) It stores frequently accessed instructions to improve performance.
d) It provides a power supply to different components of the processor.
19. When a microprocessor receives an external interrupt request, what is the first step it takes?
a) It immediately resets the system.
b) It completes the current instruction before handling the interrupt.
c) It ignores the request until power is cycled.
d) It clears all register values before servicing the interrupt.
20. Which type of memory in a microprocessor is primarily used to store frequently accessed
instructions and improve performance?
a) RAM b) ROM c) Cache Memory d) Hard Disk
Direction: Match the items in column A to their descriptions in column B. write only the letter of your
choice on the space provided.
A B
_____ 1. Data Movement a. Interpreting instructions before execution.
_____ 2. Fetch-Decode-Execute Cycle b. Fast storage for frequently used data.
_____ 3. Register-to-Memory Transfer c. Retrieving, decoding, and executing instructions.
_____ 4. Logical Operation d. Pausing execution to handle urgent tasks.
_____ 5. Interrupt Handling e. Moving values from registers to memory.
_____ 6. Cache Memory f. Transferring data between registers, memory, and I/O.
_____ 7. Maskable Interrupt g. Memory that retains data after power loss.
_____ 8. Direct Addressing Mode h. Interrupts that can be enabled or disabled.
_____ 9. EEPROM i. Memory access using a direct address.
_____ 10. Instruction Decoding j. AND, OR, XOR, and NOT operations.
Direction: Give the complete terms for the following abbreviated words.
1. RAM
2. ADC
3. GPIO
4. PWM
5. UART
6. I2C
7. SPI
8. HLT
9. JNZ
10. ISR