Microprocessor
Microprocessor
Microprocessor
A diagram that shows the flow of data between these units is as follows −
The input data travels from input unit to ALU. Similarly, the computed data travels from ALU to
output unit. The data constantly moves from storage unit to ALU and back again. This is because
stored data is computed on before being stored again. The control unit controls all the other units as
well as their data.
Input Unit
The input unit provides data to the computer system from the outside. So, basically it links the
external environment with the computer. It takes data from the input devices, converts it into
machine language and then loads it into the computer system. Keyboard, mouse etc. are the
most commonly used input devices.
Output Unit
The output unit provides the results of computer process to the users i.e it links the computer
with the external environment. Most of the output data is the form of audio or video. The
different output devices are monitors, printers, speakers, headphones etc.
Storage Unit
Storage unit contains many computer components that are used to store data. It is traditionally
divided into primary storage and secondary storage.Primary storage is also known as the main
1
memory and is the memory directly accessible by the CPU. Secondary or external storage is
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
not directly accessible by the CPU. The data from secondary storage needs to be brought into
the primary storage before the CPU can use it. Secondary storage contains a large amount of
data permanently.
Control Unit
This unit controls all the other units of the computer system and so is known as its central
nervous system. It transfers data throughout the computer as required including from storage
unit to central processing unit and vice versa. The control unit also dictates how the memory,
input output devices, arithmetic logic unit etc. should behave.
What is a Microprocessor?
Computer's Central Processing Unit (CPU) built on a single Integrated Circuit (IC) is called
a microprocessor. A digital computer with one microprocessor which acts as a CPU is called
microcomputer. It is a programmable, multipurpose, clock -driven, register-based electronic device
that reads binary instructions from a storage device called memory, accepts binary data as input and
processes data according to those instructions and provides results as output.
A Microprocessor is an important part of a computer architecture without which you will not be able to
perform anything on your computer. It is a programmable device that takes in input perform some
arithmetic and logical operations over it and produce desired output. In simple words, a Microprocessor
is a digital device on a chip which can fetch instruction from memory, decode and execute them and
give results.
A microprocessor consists of an ALU, control unit and register array. Where ALU performs arithmetic
and logical operations on the data received from an input device or memory. Control unit controls
the instructions and flow of data within the computer. And, register array consists of registers
identified by letters like B, C, D, E, H, L, and accumulator.
Evolution of Microprocessors
We can categorize the microprocessor according to the generations or according to the size of the
microprocessor:
The first generation microprocessors were introduced in the year 1971-1972 by Intel Corporation. It
was named Intel 4004 since it was a 4-bit processor. It was a processor on a single chip. It could
perform simple arithmetic and logical operations such as addition, subtraction, Boolean OR and
Boolean AND. I had a control unit capable of performing control functions like fetching an instruction
from storage memory, decoding it, and then generating control pulses to execute it.
The second generation microprocessors were introduced in 1973 again by Intel. It was a first 8 - bit
microprocessor which could perform arithmetic and logic operations on 8-bit words. It was Intel 8008,
and another improved version was Intel 8088.
The third generation microprocessors, introduced in 1978 were represented by Intel's 8086, Zilog
Z800 and 80286, which were 16 - bit processors with a performance like minicomputers.
Several different companies introduced the 32-bit microprocessors, but the most popular one is
the Intel 80386.
From 1995 to now we are in the fifth generation. After 80856, Intel came out with a new processor
namely Pentium processor followed by Pentium Pro CPU, which allows multiple CPUs in a single
system to achieve multiprocessing. Other improved 64-bit processors are Celeron, Dual, Quad, Octa
Core processors.
Instruction Set - The group of commands that the microprocessor can understand is called Instruction
set. It is an interface between hardware and software.
Bus - Set of conductors intended to transmit data, address or control information to different elements
in a microprocessor. A microprocessor will have three types of buses, i.e., data bus, address bus, and
control bus.
IPC (Instructions Per Cycle) - It is a measure of how many instructions a CPU is capable of
executing in a single clock.
Clock Speed - It is the number of operations per second the processor can perform. It can be expressed
in megahertz (MHz) or gigahertz (GHz). It is also called the Clock Rate.
Word Length - The number of bits the processor can process at a time is called the word length of
the processor. 8-bit Microprocessor may process 8 -bit data at a time. The range of word length is from
4 bits to 64 bits depending upon the type of the microcomputer.
Data Types - The microprocessor supports multiple data type formats like binary, ASCII, signed and
unsigned numbers.
Features of Microprocessor
o Low Cost - Due to integrated circuit technology microprocessors are available at very low
cost. It will reduce the cost of a computer system.
o High Speed - Due to the technology involved in it, the microprocessor can work at very high
speed. It can execute millions of instructions per second.
o Small Size - A microprocessor is fabricated in a very less footprint due to very large scale and
ultra large scale integration technology. Because of this, the size of the computer system is
reduced.
o Versatile - The same chip can be used for several applications, therefore, microprocessors are
versatile.
o Low Power Consumption - Microprocessors are using metal oxide semiconductor
technology, which consumes less power.
o Less Heat Generation - Microprocessors uses semiconductor technology which will not emit
much heat as compared to vacuum tube devices.
o Reliable - Since microprocessors use semiconductor technology, therefore, the failure rate is
very less. Hence it is very reliable.
o Portable - Due to the small size and low power consumption microprocessors are portable.
4
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
MICROPROCESSOR - 8085
8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by
Intel in 1977 using NMOS technology.
It has the following configuration −
8085 ARCHITECTURE
We have tried to depict the architecture of 8085 with this following image −
5
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
Sign (S)
Zero (Z)
Auxiliary Carry (AC)
Parity (P)
Carry (C)
Its bit position is shown in the following table −
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
6
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
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
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
8
00 H to FF H. (H denotes Hexadecimal).
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
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 –
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:
ALE (Address Latch Enabled)- High State(ALE=1) Enables address bus and Low State
(ALE=0)enables data bus
RD- Read signal
WR- Write Signal
I/O/M- I/O/M=0 indicates Low signal and it s a memory operation and I/O/M=1 indicates
High signal and it’s a i/o operation
Status Signals S1 and S0(output)- This signal separates memory and I/O devices. These are
output status signals used to give information of operation performed by microprocessor.
The S0 and S1 lines specify 4 different conditions of 8085 machine cycles.
These are the instructions used to transfer the data from one register to another register, from the
memory to the register, and from the register to the memory without any alteration in the content.
Addressing modes in 8085 is classified into 5 groups −
Immediate addressing mode
In this mode, the 8/16-bit data is specified in the instruction itself as one of its operand. For
example: MVI A, 20F: means 20F is copied into register A.
9
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
Interrupts In 8085
Interrupts are the signals generated by the external devices to request the microprocessor to perform
a task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR.
Interrupt are classified into following groups based on their parameter −
Vector interrupt − In this type of interrupt, the interrupt address is known to the
processor. For example: RST7.5, RST6.5, RST5.5, TRAP.
Non-Vector interrupt − In this type of interrupt, the interrupt address is not known to the
processor so, the interrupt address needs to be sent externally by the device to perform
interrupts. For example: INTR.
Maskable interrupt − In this type of interrupt, we can disable the interrupt by writing some
instructions into the program. For example: RST7.5, RST6.5, RST5.5.
Non-Maskable interrupt − In this type of interrupt, we cannot disable the interrupt by writing
some instructions into the program. For example: TRAP.
Software interrupt − In this type of interrupt, the programmer has to add the instructions into
the program to execute the interrupt. There are 8 software interrupts in 8085, i.e. RST0, RST1,
RST2, RST3, RST4, RST5, RST6, and RST7.
Hardware interrupt − There are 5 interrupt pins in 8085 used as hardware interrupts, i.e.
TRAP, RST7.5, RST6.5, RST5.5, INTA.
Note − NTA is not an interrupt, it is used by the microprocessor for sending acknowledgement. TRAP
has the highest priority, then RST7.5 and so on.
10
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
It is possible to use these registers as pairs to store 16-bit information. Only BC, DE, and HLcan form
register pairs. When they are used as register pairs in an instruction, the left register is understood to
have the MS byte and the right register the LS byte. For example, in DE register pair, the content of
the D register is treated as the MS byte, and the content of E register is treated as the LS byte.
Temporary Registers
(a)Temporary Data Register - The ALU has two inputs. One input is supplied by the accumulator
and other from the temporary data register. The programmer cannot access this temporary data register.
However, it is internally used for execution of most of the arithmetic and logical instructions.
(b) W and Z registers - Wand Z registers are temporary registers. These registers are used to hold 8-
bit data during the execution of some instructions. These registers are not available for the programmer
since 8085Microprocessor Architecture uses them internally.
(b)Flag Register - It is a 8-bit register, in which five of the bits carry significant information in the
form of flags: S (Sign flag), Z (Zero flag), AC(Auxiliary carry flag), P (Parity flag), and CY (carry
flag); as shown in Fig. 1.2.
12
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
S-Sign flag - After the execution of arithmetic or logical operations, if bit D7 of the result is
1, the sign flag is set. In a given byte if D7 is1, the number will be viewed as a negative number.
If D7 is U, the number will be considered as a positive number.
Z-Zero flag -The zero flag sets if the result of the operation in ALU is zero and flag resets if
the result is non zero. The zero flags are also set if a certain register content becomes zero
following an increment or decrement operation of that register.
AC-auxiliary Carry flag - This flag is set if there is an overflow out of bit 3 i.e. carry from
lower nibble to higher nibble (D3 bit to D4 bit). This flag is used for BCD operations and it is
not available for the programmer.
P-Parity flag - Parity is defined by the number of ones present in the accumulator. After
arithmetic or logical operation, if the result has an even number of ones, i.e.even parity, the
flag is set. If the parity is odd, the flag is reset.
CY-Carry flag - This flag is set if there is an overflow out of bit 7. The carry flag also serves
as a borrow flag for subtraction. In both the examples shown below, the carry flag is set.
c) Instruction Register - In a typical processor operation, the processor first fetches the opcodeof
instruction from memory (i.e. it places an address on the address bus and memory responds by
placing the data stored at the specifiedaddress on the data bus). The CPU storesthis opcode in a
register called the instruction register. Thisopcode is further sent to the instruction decoder to select
one ofthe 256 alternatives.
In case of JUMP and CALL instructions, address followed by JUMP and CALL instructions is
placed in the program counter. The processor then fetches the next instruction from the new
address specified by JUMP or CALL instruction. In conditional JUMP and conditional CALL
instructions, if the condition is not satisfied, the processor increments program counter by three so
that it points the instruction followed by conditional JUMP or CALL instruction; otherwise
processor fetches the next instruction from the new address specified by JUMP or CALL
instruction.
b) Stack Pointer (SP) - The stack is a reserved area of the memory in the RAM where temporary
information may be stored. A 16-bit stack pointer is used to hold the address of the most recent
stack entry.
13
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
Address bus
Data bus
AD7-AD0, it carries the least significant 8-bit address and data bus.
14
These signals are used to identify the nature of operation. There are 3 control signal and 3 status
signals.
Three control signals are RD, WR & ALE.
RD − This signal indicates that the selected IO or memory device is to be read and is ready
for accepting data available on the data bus.
WR − This signal indicates that the data on the data bus is to be written into a selected memory
or IO location.
ALE − It is a positive going pulse generated when a new operation is started by the
microprocessor. When the pulse goes high, it indicates address. When the pulse goes down it
indicates data.
Three status signals are IO/M, S0 & S1.
IO/M
This signal is used to differentiate between IO and Memory operations, i.e. when it is high indicates
IO operation and when it is low then it indicates memory operation.
S1 & S0
Power supply
There are 2 power supply signals − VCC & VSS. VCC indicates +5v power supply and VSS indicates
ground signal.
Clock signals
Interrupts are the signals generated by external devices to request the microprocessor to perform a
task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR. We will discuss
interrupts in detail in interrupts section.
INTA − It is an interrupt acknowledgment signal.
RESET IN − This signal is used to reset the microprocessor by setting the program counter
to zero.
RESET OUT − This signal is used to reset all the connected devices when the microprocessor
is reset.
15
Page
BCA-MICRO
YUVAKSHETRA INSTITUTE OF MANAGEMENT STUDIES BCA 2019 ONWARS BATCH
PROCESSOR
READY − This signal indicates that the device is ready to send or receive data. If READY is
low, then the CPU has to wait for READY to go high.
HOLD − This signal indicates that another master is requesting the use of the address and data
buses.
HLDA (HOLD Acknowledge) − It indicates that the CPU has received the HOLD request
and it will relinquish the bus in the next clock cycle. HLDA is set to low after the HOLD
signal is removed.
There are 2 serial signals, i.e. SID and SOD and these signals are used for serial communication.
SOD (Serial output data line) − The output SOD is set/reset as specified by the SIM
instruction.
SID (Serial input data line) − The data on this line is loaded into accumulator whenever a RIM
instruction is executed.
16
Page