Unit - I Microprocessor
Unit - I Microprocessor
Many people use the words microcomputer and personal computer interchangeably. The reason
for this is the compact size and design of this device makes it ideal for personal use. While
there's another way to identify a microcomputer, the prevailing definition is it's a complete small-
scale computer system for use by one individual. Its common types include desktop computers,
laptops, tablets, and smartphones.
Central processing unit (CPU): This is a computer's main component and responsible for
processing instructions and data, receiving input and producing output, and running applications
and the operating system. A single-chip microprocessor is the CPU of microcomputer devices.
Operating system (OS): The OS is software that serves as a platform for other computer
programs and enables individuals to use the device through an interface. Its primary task is to
manage the computer's resources.
Memory or random access memory (RAM): This component stores instructions and data for
the CPU's use. It also loads and runs the various applications in a personal computer.
Storage: A computer's storage is a device that contains the digital data a user saved. Examples of
this are a solid state drive (SSD) or a hard disk drive (HDD).
Input and output (IO) devices: Input devices such as a keyboard and mouse enable a user to
bring data to the computer. Output devices like a monitor, printer, and speaker allow the
computer to send output to the user, depending on the data it received.
Examples of a microcomputer
There are numerous types of microcomputers, including electronic devices for everyday use,
such as desktop computers, notebooks or laptops, and smartphones. Depending on its definition,
a microcomputer can also be a video game console or a pocket calculator. While these differ in
appearance, they're all microcomputing devices because their CPU consists of a single
microprocessor chip. Here are common examples of these devices that people and companies use
today:
Desktop computer
People may refer to a desktop computer as a personal computer. It's a computing device that
typically fits on top of a regular office desk. While its design makes it ideal for regular use, its
portability may be an issue, especially for individuals who prefer a device that allows them to
use it in different locations. Aside from a CPU, memory, and storage, the basic parts of many
desktop computers are:
Graphics card: A video card that enables the display of images on the monitor.
Motherboard: The main board that supplies the power necessary for computer hardware to
function.
Tower or case: A metal or plastic cabinet that contains many of the computer's components.
Input and output (IO) devices: The usual input and output devices of desktop computers are
the mouse, keyboard, and monitor.
Many individuals looking for a computing device for personal use choose a desktop computer
because of its advantages. For example, it's usually more affordable compared to a laptop with
similar processing power. It's also easier to repair, remove, and upgrade its parts. Another
advantage is a desktop's customizability. Businesses often use desktop computers because they
can assemble their own units depending on the organizaton's unique requirements.
Workstation computer
Workstation computers share many similarities with desktop units. They often comprise the
same components and are also ideal for single users. Their major difference is their processing
power. A workstation computer is a high-performance device with a typically more powerful
processor for its CPU, larger memory and storage, and more advanced graphics system. It also
often connects to a local area network (LAN) to enable its user to share and access data and
resources and communicate with other workstation users.
Laptop and notebook
Laptops and notebooks are portable alternatives to desktop computers. While these three devices
typically possess similar components, there are several differences. A desktop unit is stationary
and comprises various separate parts. A laptop and notebook are both all-in-one computer
systems with many built-in IO devices, such as a screen, keyboard, trackpad for use as a mouse,
and speaker. And while desktop computers are highly customizable, laptops and notebooks offer
few options in terms of upgrades.
Tablet computer
A tablet is larger compared to a smartphone and smaller than a laptop. While tablets differ in
their size and features, many possess an operating system (OS) and a touchscreen that serves as
the user interface. These devices are for personal use and companies rarely issue them to
employees for work-related tasks. They're typically only capable of running small applications
and lack the processing power and memory to perform on the same level as a desktop or laptop.
ROM
Types of ROM
The early ROMs were hard-wired instruments that consisted of a pre-programmed set of
data or instructions. These types of ROMs are called masked ROMs, which are
comparatively inexpensive.
PROM is a type of read-only memory that can be amended only once by a user. The
user buys an empty PROM and inputs the required data using a PROM program. It
consists of the small fuses inside which are burnt open during programming. It is
possible to program this memory only once and is not erasable.
Input Output Ports
Ports: The connection point acts as an interface between the computer and external devices
like printers, modems, etc.
1. Internal Port: It connects the system’s motherboard to internal devices like hard disk,
CD drive, internal Bluetooth, etc.
2. External Port: It connects the system’s motherboard to external devices like a mouse,
printer, USB, etc.
Some important types of ports are as per follows:
1. Serial Port :
Used for external modems and older computer mouse
Two versions-9pin,25pin
Data travels at 115 kilobits per second
2. Parallel Port :
Used for scanners and printers
25 pin model
4. Firewire Port:
Transfers large amounts of data at a very fast speed.
Connects camcorders and video equipment to the computer.
Data travels at 400 to 800 megabits per second.
5. Ethernet Port:
Connects to a network and high-speed Internet.
Data travels at 10 megabits to 1000 megabits per second depending upon the network
bandwidth.
A clock generator
A clock generator in a microprocessor is a circuit that produces a timing signal to synchronize
the system's operations:
How it works
A clock generator is made up of a resonant circuit and an amplifier. The resonant circuit is
usually a quartz piezo-electric oscillator, but can also be a tank circuit or RC circuit. The
amplifier inverts the oscillator's signal and feeds some of it back to maintain oscillation.
What it does
The clock generator produces periodic clock waveforms that synchronize operations in digital
systems. It generates rising and falling transitions on a signal parameter to produce non-
overlapping pairs of clock signals.
Clock rate
The clock rate of a CPU is usually determined by the frequency of an oscillator crystal. The most
common crystal is a 14.318 MHz crystal, which is used as the foundation frequency for
generating all of the other timing circuits in a PC.
Some clock generators are programmable, allowing the number used in the divider or multiplier
to be changed. This allows for a wide variety of output frequencies to be selected without
modifying the hardware.
Interconnection components can also refer to the physical forms that connect the components of
a computer system. These forms are known as interconnection structures. Some examples of
interconnection structures include:
Multiport memory: Uses separate buses for each memory module and CPU. This structure has
a high transfer rate, but it's expensive because it uses multiple cables and connectors.
The communication between components in a microcomputer takes place via the address and
data bus. The system bus is the bus that connects the major computer components. The system
bus is divided into three types:
Address bus: Sends addresses from the CPU to the memory and I/O port
A bussed architecture for a microcomputer uses a bus to connect the processor, memory, and
peripherals, allowing for communication The 8085
between the components.
microprocessor has a 16-bit address bus, an 8-bit data bus, and
various control signals that are used to manage data transfer and
other operations.
There are three types of buses.
Address bus –
The address bus is a unidirectional bus that is used to carry the memory or I/O device address
to which the data is to be transferred. The address bus in the 8085 microprocessor is 16-bit
wide.
It is a group of conducting wires which carries address only. Address bus is unidirectional
because data flow in one direction, from microprocessor to memory or from microprocessor
to Input/output devices (That is, Out of Microprocessor). Length of Address Bus of 8085
microprocessor is 16 Bit (That is, Four Hexadecimal Digits), ranging from 0000 H to FFFF H,
(H denotes Hexadecimal). The microprocessor 8085 can transfer maximum 16 bit address
which means it can address 65, 536 different memory location. The Length of the address bus
determines the amount of memory a system can address. Such as a system with a 32-bit
address bus can address 2^32 memory locations. If each memory location holds one byte, the
addressable memory space is 4 GB. However, the actual amount of memory that can be
accessed is usually much less than this theoretical limit due to chipset and motherboard
limitations.
Data bus –
The data bus is an 8-bit bidirectional bus that is used to transfer data between the
microprocessor and other components such as memory and I/O devices. It is used to carry
data to or from the memory or input/output devices.
It is a group of conducting wires which carries Data only. Data bus is bidirectional because
data flow in both directions, from microprocessor to memory or Input/Output devices and
from memory or Input/Output devices to microprocessor. Length of Data Bus of 8085
microprocessor is 8 Bit (That is, two Hexadecimal Digits), ranging from 00 H to FF H. (H
denotes Hexadecimal). When it is write operation, the processor will put the data (to be
written) on the data bus, when it is read operation, the memory controller will get the data
from specific memory block and put it into the data bus. The width of the data bus is directly
related to the largest number that the bus can carry, such as an 8 bit bus can represent 2 to the
power of 8 unique values, this equates to the number 0 to 255.A 16 bit bus can carry 0 to
65535.
Control bus –
The control bus is a bidirectional bus that is used to carry control signals between the
microprocessor and other components such as memory and I/O devices. It is used to transmit
commands to the memory or I/O devices for performing specific operations.
It is a group of conducting wires, which is used to generate timing and control signals to
control all the associated peripherals, microprocessor uses control bus to process data, that is
what to do with selected memory location. Some control signals are:
Memory read
Memory write
1. I/O read
2. I/O Write
3. Opcode fetch
Memory addressing
Memory addressing techniques, also known as addressing modes, are methods for specifying the
location of an operand in memory:
Direct addressing: The instruction directly specifies a memory location. This is fast, but the
code depends on the data being present at the same location.
Immediate addressing: The instruction contains both the opcode and the operand.
Register addressing: The instruction specifies a register where the operand is stored.
Indirect addressing: The instruction specifies an address that contains the effective address of
the operand.
Indexed addressing: The instruction adds the contents of the address field and the index register
to determine the operand's address. This is often used to access array values.
Relative addressing: The contents of the address field are added to the constant stored in the
program counter.
PC-relative addressing: The effective address is the offset parameter added to the address of the
next instruction. This is useful for jumps because typical jumps are to nearby instructions.
Memory Mapped I/O is a technique in which an I/O device is mapped as memory itself. In this
approach, memory and I/O devices occupy the same space as far as the system is concerned.
This implies that the CPU can transmits or receive data from I/O devices using the same format
that is used to address normal memory.
Shared Address Space: I/O devices are carved out a particular memory space.
Unified Instructions: They are identical for both memory and I/O operations.
Simplified Addressing This means there is no need for special instructions and port for
I/O operations as in integrated I/O.
Faster Access: Because a memory has faster access times then an I/O operation can have
improved access times as well.
Flexible Addressing: Supports all the addressing modes of the CPU hence making it easier
to write programs.
Simplified Programming Model: Unlike other instruction types, where the Developer
requires a special kind of instruction called I/O instruction, they are free to use what is
called memory instruction.
Limited Address Space: It was also pointed out that sharing the address space between
memory and I/O can reduce the number of available memory addresses.
Potential for Address Conflicts: Possibility of the existence of similar addresses if not
controlled properly.
Separate Address Space: I/O devices are granted their own address space that is
independent of the memory space of the computer.
Dedicated Instructions: Contains specific I/O instructions known as `IN` and `OUT`.
Distinct Port Addresses: I/O devices are connected to the computer and can only be
addressed by specific port addresses.
Expanded Address Space: Preserves memory address space full for the memory
operations use, to avoid any conflict.
Simplified Address Decoding: Hence, it lowers the ontological level seen in previous
models and clears the memory –I/O barrier making the model less complex.
Slower Access: I/O operations may be slower because of the use of special instruction.
Limited Addressing Modes: Limited to the addressing modes of I/O instructions; thus the
flexibility is somewhat hampered.
Difference between Memory-Mapped I/O Interfacing and I/O Mapped I/O Interfacing :
Instruction set Uses the same instructions for Special instructions are used for
accessing both memory and I/O accessing I/O devices
devices
Address range Limited number of memory locations Dedicated address space
available for use by available for I/O devices
the microprocessor
Design complexity Simple to implement and design More complex to implement and
design
I/O device requests service: When the I/O device is ready to exchange data with the processor;
it interrupts the processor to request service.
CPU catches the interrupt: The CPU catches the interrupt and dispatches an interrupt handler.
Interrupt handler handles the I/O operation: The interrupt handler clears the interrupt by
servicing the device.
Interrupt-controlled I/O is a solution to the problem of busy waiting, which occurs when the CPU
spends time waiting for a slow device to become ready. In contrast, polling I/O is efficient when
the device works fast.
I/O devices: These devices can be categorized as storage, networking, user interface, or other.
Examples include keyboards, mice, microphones, speakers, monitors, and printers.
I/O controllers: These devices manage the flow of data between the computer's central
processing unit (CPU) and external devices.
Ports: These allow devices to connect to the computer, such as USB, serial, or parallel ports.
Motherboard slots or onboard chipsets: These allow devices to connect internally to the
computer.
The computer's operating system (OS) manages I/O devices through a dedicated subsystem. The
OS is responsible for handling input and output, controlling peripheral devices, and performing
other basic tasks.
The I/O process is how computers communicate with the outside world and respond to human
interaction. Without I/O, it would be impossible to interact with computing and technological
systems.
Explanation: The CPU initializes the DMA by sending the given information through
the data bus.
The starting address of the memory block where the data is available (to read) or where
data are to be stored (to write).
It also sends word count which is the number of words in the memory block to be read or
written.
Control to define the mode of transfer such as read or write.
A control to begin the DMA transfer
Modes of Data Transfer in DMA
There are 3 modes of data transfer in DMA that are described below.
Burst Mode: In Burst Mode, buses are handed over to the CPU by the DMA if the whole
data is completely transferred, not before that.
Cycle Stealing Mode: In Cycle Stealing Mode, buses are handed over to the CPU by the
DMA after the transfer of each byte. Continuous request for bus control is generated by
this Data Transfer Mode. It works more easily for higher-priority tasks.
Transparent Mode: Transparent Mode in DMA does not require any bus in the transfer
of the data as it works when the CPU is executing the transaction.
8088 Microprocessor
8088 Microprocessor is an advanced version of 8087 Microprocessor, designed by Intel in
1979. It is a 8-bit microprocessor. It has 8 bits of the data bus. As, it is a 8-bit microprocessor,
it requires two complete cycles to process 16 bit data.
Also, it performs the processing of floating point data and instructions as it supports the Intel
8087 numeric co-processor.
Advantages of 8088 Microprocessor
Cost Efficiency: This design is easier and cheaper to implement because an 8-bit data bus
is easier to handle and needs cheaper/B cheaper components and memory.
Compatibility: In its turn, 8088 is compatible with 8-bit peripheral chips, which were
cheaper and more numerous in comparison with the 16-bit counterparts at the time when
the computer was designed.
Smaller Data Bus: That is why an 8-bit data bus is used which reduces product
complexity and costs and therefore can be well implemented in early PCs.
Lower Performance: The 8088 also has a fewer number of data lines than the 8086; it
has 8 data lines used for moving data across the data bus, therefore is slower in moving
data than the 8086.
Limited Data Handling: It can only work with 8 bits of data at a time which means it
consumes more time than 8086 in executing the similar instructions.
It was a 16-bit Central Processing Unit (CPU) introduced in 1982. It was an improvement on
its predecessor, the 8086, and is considered a key milestone in the development of personal
computers. Here are some of its features:
Memory management
The 80286 was the first microprocessor to include a memory management unit, which allowed
it to use memory more efficiently.
Protected mode
The 80286 introduced protected mode, which prevented applications from accessing memory
outside their allocated zones.
Multitasking
The 80286 was designed for multi-user, multitasking environments. It could run several
programs at the same time and protect memory space for another program.
Instruction execution
Software compatibility
The 80286 could correctly execute most software written for the 8086 and 8088 processors.
Pin packages
The 80286 was available in a variety of pin packages, including 68-pin PLCC, Ceramic LCC,
and PGA.
Operating modes
The 80286 had two operating modes: real address mode and protected virtual address mode.
32-bit architecture
Protected mode
Backward compatibility
The 80386's Virtual 8086 Mode (VM86) allowed it to run software written for the Intel 8086
processor.
Debugging support
Speed
The 80486 was about twice as fast as the 80386 per clock cycle. A 50 MHz 80486 could
execute around 40 million instructions per second.
Architecture
The 80486 was the first tightly pipelined x86 design. It had a 32-bit architecture, which
improved multitasking and performance.
Instruction set
The 80486 had an advanced instruction set, including floating-point instructions and
multimedia extensions.
Cache memory
The 80486 had a built-in 80387 numeric coprocessor, which allowed it to execute math
instructions about three times faster than an 80386/387 combination.
Compatibility
The 80486 was compatible with the 80386 in several areas, including real address mode,
protected virtual address mode, and virtual 8086 mode.
The 80486 was discontinued in 2007 and was succeeded by the Pentium/i586 (P5)
Architecture: The Pentium used a superscalar CISC (complex instruction set computer)
architecture.
Data bus: The Pentium had a 64-bit data bus, compared to the 32-bit data bus of the 486 chip.
Speed: The Pentium had a base clock speed of 60 to 200 megahertz (MHz). It was almost
twice as fast as the equivalent 80486.
Transistors: The Pentium had 3.1 million transistors, which was three times as many as the
486.
Caches: The Pentium had two eight-kilobyte data caches, one for code and one for data.
Floating-point unit: The Pentium had a redesigned and faster floating-point unit.
Compatibility: The Pentium was fully compatible with previous 80x86 processors.
The name "Pentium" comes from the Greek word pente, which means "five". This was a
reference to the previous numeric naming convention of Intel's 80x86 processors.
The M6800 has very few registers. It has two Accumulators A and B, and the
Index Register. This Microprocessor only supports the memory mapped IO
because there is no instruction regarding IO operations in its instruction set.
The M6800 has six addressing modes, 72 instructions and at least 197
opcodes in its instruction set. At first, the clock frequency was 1MHz. In the
next builds, the clock frequency is increased to 2MHz.
The Motorola M6800 is 40pin DIP Microprocessor. Here we will see the actual
pin level diagram of M6800 and also the functional pin diagram of it.
The M6800 requires some additional chips to provide the required functions.
These chips are:
CPU Registers
In Computer Architecture, the Registers are very fast computer memory that is used to
execute programs and operations efficiently. This is done by giving access to commonly used
values, i.e., the values that are at the point of operation/execution at that time. So, for this
purpose, there are several different classes of CPU registers that work in coordination with the
computer memory to run operations efficiently.
The sole purpose of having a register is fast retrieval of data for processing by CPU. Though
accessing instructions from RAM is comparatively faster with a hard drive, it still isn’t
enough for the CPU. For even better processing, there are memories in the CPU that can get
data from RAM which are about to be executed beforehand. After registers, we have cache
memory, which is faster but less fast than registers.
CPU registers are essential for the execution of instructions, and understanding the different
types, such as general-purpose, segment, and special-purpose registers, is crucial for studying
computer architecture. To delve deeper into the various classes of CPU registers and their
roles, the GATE CS and IT – 2025 course provides detailed lessons and practical examples,
ensuring a solid understanding of this foundational topic.
Following is the list of some of the most common registers used in a basic computer:
Holds memory
Data register DR 16
operand
Holds instruction
Instruction register IR 16
code
Carries input
Input register INPR 8
character
Carries output
Output register OUTR 8
character
Different Types Of CPU Registers
There are several types of registers available in the CPU for different purposes let’s discuss
each one by one:
Accumulator: This is the most frequently used register used to store data taken from
memory. It is indifferent numbers in different microprocessors.
Memory Address Registers (MAR) : It holds the address of the location to be accessed
from memory. MAR and MDR (Memory Data Register) together facilitate the
communication of the CPU and the main memory.
Memory Data Registers (MDR) : It contains data to be written into or to be read out
from the addressed location.
General Purpose Registers : These are numbered as R0, R1, R2….Rn-1, and used to
store temporary data during any ongoing operation. Its content can be accessed by
assembly programming. Modern CPU architectures tend to use more GPR so that register-
to-register addressing can be used more, which is comparatively faster than
other addressing modes .
Program Counter (PC) : Program Counter (PC) is used to keep the track of the
execution of the program. It contains the memory address of the next instruction to be
fetched. PC points to the address of the next instruction to be fetched from the main
memory when the previous instruction has been successfully completed. Program Counter
(PC) also functions to count the number of instructions. The incrementation of PCs
depends on the type of architecture being used. If we are using a 32-bit architecture, the
PC gets incremented by 4 every time to fetch the next instruction.
Instruction Register (IR): The IR holds the instruction which is just about to be
executed. The instruction from the PC is fetched and stored in IR. As soon as the
instruction is placed in IR, the CPU starts executing the instruction, and the PC points to
the next instruction to be executed.
Stack Pointer (SP): The stack PCs pointer points to the top of the stack, which is a part
of the memory used to store function calls and other operations.
Flag Register: A flag register , also known as a status register or condition code register,
is a special type of register in a computer’s central processing unit (CPU) used to indicate
the status of the CPU or the outcome of various operations such as Zero Flag, Carry flag,
Sign Flag, Overflow Flag, Parity Flag, Auxiliary Carry Flag, and Interrupt Enable Flag.
Condition code register ( CCR ): Condition code registers contain different flags that
indicate the status of any operation. For instance, let’s suppose an operation caused the
creation of a negative result or zero, then these flags are set high accordingly. and the
flags are
1. Carry C: Set to 1 if an add operation produces a carry or a subtract operation produces a
borrow; otherwise cleared to 0.
2. Overflow V: Useful only during operations on signed integers.
3. Zero Z: Set to 1 if the result is 0, otherwise cleared to 0.
4. Negate N: Meaningful only in signed number operations. Set to 1 if a negative result is
produced.
5. Extend X: Functions as a carry for multiple precision arithmetic operations.
Segment registers
There are four 16-bit segment registers:
Code segment register (CS): Points to the code segment of memory, where the executable
program code is stored
Data segment register (DS): Points to the data segment of memory, where data is stored
Stack segment register (SS): Points to the stack segment of memory, where the processor
temporarily stores register values
Extra segment register (ES): Points to wherever the user wants it to point
Data registers
There are four 16-bit data registers: AX, BX, CX, and DX. BX can also be used as an address
register for indirect addressing.
Flags
Status flags are used to indicate the outcome of operations.
The 8088 microprocessor also has a 16-bit internal data bus and an 8-bit external data bus.
Addressing modes in 8086 microprocessor
The way of specifying data to be operated by an instruction is known as addressing modes.
This specifies that the given data is an immediate data or an address. It also specifies whether
the given operand is regi ster or register pair.
Types of addressing modes:
1. Register mode – In this type of addressing mode both the operands are registers.
Example:
MOV AX, BX
XOR AX, DX
ADD AL, BL
2. Immediate mode – In this type of addressing mode the source operand is a 8 bit or 16 bit
data. Destination operand can never be immediate data.
Example:
MOV AX, 2000
MOV CL, 0A
ADD AL, 45
AND AX, 0000
Note that to initialize the value of segment register an register is required.
MOV AX, 2000
MOV CS, AX
3. Displacement or direct mode – In this type of addressing mode the effective address is
directly given in the instruction as displacement.
Example:
MOV AX, [DISP]
MOV AX, [0500]
4. Register indirect mode – In this addressing mode the effective address is in SI, DI or
BX.
Example: Physical Address = Segment Address + Effective Address
MOV AX, [DI]
ADD AL, [BX]
MOV AX, [SI]
5. Based indexed mode – In this the effective address is sum of base register and index
register.
Base register: BX, BP
Index register: SI, DI
The physical memory address is calculated according to the base register.
Example:
MOV AL, [BP+SI]
MOV AX, [BX+DI]
6. Indexed mode – In this type of addressing mode the effective address is sum of index
register and displacement.
Example:
MOV AX, [SI+2000]
MOV AL, [DI+3000]
7. Based mode – In this the effective address is the sum of base register and displacement.
Example:
MOV AL, [BP+ 0100]
8. Based indexed displacement mode – In this type of addressing mode the effective
address is the sum of index register, base register and displacement.
Example:
MOV AL, [SI+BP+2000]
9. String mode – This addressing mode is related to string instructions. In this the value of
SI and DI are auto incremented and decremented depending upon the value of directional
flag.
Example:
MOVS B
MOVS W
10. Input/Output mode – This addressing mode is related with input output operations.
Example:
IN A, 45
OUT A, 50
11. Relative mode –
In this the effective address is calculated with reference to instruction pointer.
Example:
JNZ 8 bit address
IP=IP+8 bit address