0% found this document useful (0 votes)
30 views13 pages

Microprocessor Systems Simplified

Uploaded by

Denver Sumbagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views13 pages

Microprocessor Systems Simplified

Uploaded by

Denver Sumbagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

NUEVA VIZCAYA STATE UNIVERSITY

College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025

A. Structural Components of Microprocessor/Microcontroller

Difference between Microprocessor and Microcontroller

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.

Cost is high Cost is low


It is not suitable for devices that run on stored It can be used on devices that use stored power
power since total power consumption is high due to since total power consumption is low due to less
external components. external components.

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.

Used in personal computers. Used in embedded systems.

Less number of registers. More number of registers.


Uses an external bus. Uses an internal controlling bus.

Based on the Von Neumann model Based on the Harvard architecture


It is a byproduct of the development of
It is a central processing unit on a single silicon-
microprocessors with a CPU along with other
based integrated chip.
peripherals.

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.

Detailed Differences Between Microprocessor and Microcontroller

Microprocessor and Microcontroller are different in the following ways:


• Microprocessor only consists of Central Processing Unit, whereas Microcontroller has
memory, a CPU and I/O. All these are integrated into one chip.
• A microprocessor uses external bus to interface to ROM, RAM, and other peripherals.
Microcontroller, on the other hand, uses internal controlling bus.
• A microprocessor is used in personal computers whereas microcontroller is used in
embedded system.

1
Instructor: Engr. Daniel Gracias V. Esquejo
NUEVA VIZCAYA STATE UNIVERSITY
College of Engineering
Department of Computer Engineering
Microprocessor Systems 2024-2025

• Microprocessor is based on the Von Neumann model whereas Microcontroller is based on


the Harvard architecture.
• A microprocessor is complicated in nature, with a large set of instructions to process.
Microcontroller is not that expensive and less complex with fewer instructions to process.

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

A microprocessor has the following components


• I/O Units
• Control units
• Arithmetic Logic Unit (ALU)
• Cache
• Registers

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.

2. DSP (Digital Signal Processor)

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.

4. Input/Output Processor (IOP)

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.

5. Bit-Slice Microprocessors (BSM)

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.

Difference between 8085 and 8086 Microprocessors

The comparison between 8085 and 8086 microprocessors in a tabular format:

Parameter 8085 Microprocessor 8086 Microprocessor

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

Parameter 8085 Microprocessor 8086 Microprocessor

The 8086 microprocessor is a 16-bit


Microprocessor The 8085 microprocessor is an 8-bit
general-purpose register-based
type accumulator-based microprocessor.
microprocessor.

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.

Maximum The 8086 microprocessor has a maximum


The maximum accessible memory capacity of
Accessible Memory accessible memory capacity of 2^20 bytes
the 8085 microprocessor is 2^16 bytes or 64 kB.
capacity or 1 MB.

ALU (Arithmetic
The 8085 microprocessor has an 8-bit ALU. The 8086 microprocessor has 16-bit ALU.
Logic Unit) size

The 8086 microprocessor is available in


The 8085 microprocessor has an on-chip
Clock frequency three versions with a clock speed
oscillator of 3 MHz.
(frequency) of 5 MHz, 8 MHz and 10 MHz.

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.

The 8086 microprocessor has 9 flags:


The 8085 microprocessor has 5 flags, named carry, auxiliary carry, parity, zero, sign,
Number of flags
carry, auxiliary carry, parity, zero and sign flag. trap, interrupt, direction, and overflow
flag.

It supports memory segmentation as it is


Memory segmented, meaning a 20-bit address bus
Does not support memory segmentation.
segmentation accesses 1 MB of memory but uses just
four 64 kB segments from it.

Supports two modes of operation:


Modes of operation Supports a single mode of operation.
minimum mode and maximum mode.

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

Parameter 8085 Microprocessor 8086 Microprocessor

Processor 8085 is a single-processor configuration 8086 is a multiprocessor configuration


configuration microprocessor. microprocessor.

8086 microprocessor has an instruction


8085 microprocessor does not have an
Instruction queue queue of 6 bytes, which is stored in the
instruction queue.
FIFO (First In, First Out) register.

8086 microprocessor is relatively more


Cost 8085 microprocessor is cheaper.
expensive than the 8085 microprocessors

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

The different types of microcontrollers based on different parameters.

1. Microcontrollers According to the size

• 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.

2. Microcontrollers According to Memory Device

• Embedded Memory Microcontroller: Any embedded system with a microcontroller unit


that consists of all functional blocks on a chip is known as an embedded microcontroller.

• 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.

• These are used in different modern electronic equipment to automate processes.

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.

*** The basic differences between a microcontroller and a microprocessor: While


microprocessors are the controlling unit of a micro-computer that is wrapped within a small chip,
microcontrollers are chips that are optimized to control electronic devices. The two differ in their
size, functionality and architecture on which they are based.

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 Three Stages of the Instruction Cycle


1. Fetch: Retrieving the Instruction

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 PC points to the memory address of the instruction.

• The CPU sends a signal to the memory to retrieve the instruction at that address.

• The retrieved instruction is then stored in the instruction register (IR).

This stage is crucial because it ensures that the CPU knows what task to perform next.

2. Decode: Interpreting the Instruction

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.

3. Execute: Performing the Operation

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

• Storing the result back in a register or memory location as required.

This stage effectively completes the task defined by the original instruction, modifying the system’s
state accordingly.

Components That Involved in This Process

To fully understand the fetch-decode-execute cycle, it’s essential to know the primary components
involved

• Program Counter (PC): Keeps track of the next instruction’s address.

• Instruction Register (IR): Holds the current instruction being executed.

• Control Unit (CU): Decodes the instruction and manages the execution process.

• Arithmetic Logic Unit (ALU): Performs arithmetic and logical operations.

• Registers: Small, fast storage locations for temporary data and instructions.

• Memory: Stores the program and data needed by the CPU.

Example

Consider a simple instruction to add two numbers stored in memory.

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.

C. Functional Operations of Microprocessor/Microcontroller


A microprocessor or microcontroller, the "brain" of a computer system, performs four primary
functions:
1. Data Movement:
o Transferring data: Moving data between different memory locations, registers, and
input/output devices.
o Loading and storing data: Reading data from memory and writing data to memory.
2. Data Processing:
o Arithmetic operations: Performing calculations like addition, subtraction,
multiplication, and division.

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.

Example: 8085 Microprocessor Instruction Set


The 8085 microprocessor, a popular 8-bit microprocessor, has a rich instruction set that includes
instructions for:
• Data Transfer: MOV, MVI, LDA, STA, LHLD, SHLD
• Arithmetic: ADD, ADC, SUB, SBB, INR, DCR, INX, DCX, DAD
• Logical: ANA, ORA, XRA, CMP, RLC, RRC, RAL, RAR
• Control Flow: JMP, JNZ, JZ, JC, JNC, JM, JNP, CALL, RET
• Stack Operations: PUSH, POP

Choosing an Instruction Set


The choice of an instruction set depends on various factors, including:
• Processor architecture: The underlying hardware design of the processor.
• Target applications: The types of tasks the processor is intended to perform.
• Performance requirements: The speed and efficiency needed for the processor.
• Power consumption: The amount of power the processor consumes.
• Cost: The cost of manufacturing the processor.

Example: Swapping Two Numbers

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

; Swap the values


LDA 1000H ; Load the value at 1000H into the accumulator
MOV B, M ; Move the value at 1000H to the B register
LDA 1001H ; Load the value at 1001H into the accumulator
STA 1000H ; Store the value of A at 1000H
MOV M, B ; Store the value of B at 1001H

; 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.

a. Interfacing of Input/Output Devices


Interfacing an input/output device typically involves:
1. Physical Connection:
o Connecting the device's physical pins to the microprocessor's I/O ports using cables
or connectors.
2. Device Driver:
o Writing software code (device driver) to control the device and handle data transfer.
o The device driver interacts with the operating system and the microprocessor to
manage the device's operations.
3. I/O Port:
o A set of pins on the microprocessor used to communicate with external devices.
o The I/O port can be configured as input or output, and data can be transferred through
these pins.

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

You might also like