microprocessor Notes
microprocessor Notes
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.
The microprocessor contains millions of tiny components like transistors, registers, and diodes
that work together.
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.
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.
Working of Microprocessor
The microprocessor follows a sequence to execute the instruction: Fetch, Decode, and then
Execute.
Initially, the instructions are stored in the storage memory of the computer in sequential order.
The microprocessor fetches those instructions from the stored area (memory), then decodes it
and executes those instructions till STOP instruction is met. Then, it sends the result in binary
form to the output port. Between these processes, the register stores the temporary data and ALU
(Arithmetic and Logic Unit) performs the computing functions.
Address bus
Data bus
AD7-AD0, it carries the least significant 8-bit address and data bus.
These signals are used to identify the nature of operation. There are
3 control signal and 3 status signals.
IO/M
S1 & S0
Power supply
There are 2 power supply signals − VCC & VSS. VCC indicates +5v
power supply and VSS indicates ground signal.
Clock signals
There are 2 serial signals, i.e. SID and SOD and these signals are
used for serial communication.
Registers in 8085:
(a) General Purpose Registers – The 8085 has six general-purpose
registers to store 8-bit data; these are identified as- B, C, D, E, H,
and L. These can be combined as register pairs – BC, DE, and HL,
to perform some 16-bit operation. These registers are used to
store or copy temporary data, by using instructions, during the
execution of the program.
Flag registers:
Due to different ways of specifying data for instructions, the machine codes of
all instructions are not of the same length. It may 1-byte, 2-byte or 3-byte
instruction.
Arithmetic Group
The instructions of this group perform arithmetic operations such as addition,
subtraction, increment or decrement of the content of a register or a memory.
The instruction
stores 16-bit data
Load the into the register pair
LXI Reg. pair, 16bit data register pair designated in the
immediate operand.
Example − LXI K,
3025M
Data-transfer Instructions
Opcode Operand Meaning Explanation
This instruction
copies the
contents of the
Copy from the
Rd, Sc source register
source (Sc) to
MOV M, Sc into the
the
Dt, M destination
destination(Dt)
register without
any alteration.
Example − MOV K,
L
The contents of a
memory location,
specified by a 16-
bit address in the
Load the
LDA 16-bit address operand, are
accumulator
copied to the
accumulator.
Example − LDA
2034K
The contents of
the designated
register pair point
to a memory
Load the location. This
LDAX B/D Reg. pair accumulator instruction copies
indirect the contents of
that memory
location into the
accumulator.
Example − LDAX K
The instruction
loads 16-bit data
Load the in the register pair
LXI Reg. pair, 16-bit data register pair designated in the
immediate register or the
memory.
Example − LXI K,
3225L
The instruction
copies the
contents of the
memory location
pointed out by the
address into
Load H and L register L and
LHLD 16-bit address
registers direct copies the
contents of the
next memory
location into
register H.
Example − LHLD
3225K
The contents of
the accumulator
are copied into
the memory
location specified
by the operand.
This is a 3-byte
instruction, the
STA 16-bit address 16-bit address
second byte
specifies the low-
order address and
the third byte
specifies the high-
order address.
Example − STA
325K
The contents of
Store the the accumulator
STAX 16-bit address accumulator are copied into
indirect the memory
location specified
by the contents of
the operand.
Example − STAX K
The program
Jump sequence is
16-bit
JMP unconditio transferred to the
address
nally memory address
given in the operand.
Flag
Opcode Description
Status
Jump on no
JNC CY=0
Carry
Jump on parity
JPE P=1
even
Jump on parity
JPO P=0
odd
Call on parity
CPE P=1
even
Call on parity
CPO P=0
odd
Flag
Opcode Description
Status
Return on no
RNZ Z=0
zero
Return on parity
RPE P=1
even
Return on parity
RPO P=0
odd
Ports of 8255A
These three ports are further divided into two groups, i.e. Group A
includes PORT A and upper PORT C. Group B includes PORT B and
lower PORT C. These two groups can be programmed in three
different modes, i.e. the first mode is named as mode 0, the second
mode is named as Mode 1 and the third mode is named as Mode 2.
Operating Modes
8255 Architecture
CS’ A1 A0 Selection
0 0 0 PORT A
0 0 1 PORT B
CS’ A1 A0 Selection
0 1 0 PORT C
0 1 1 Control Register
1 X X No Seletion
Given instruction copy the contents of the source register into the
destination register and the contents of the source register are not
altered.
Example:
MOV B, C
Opcode: MOV
Operand: B and C
Bis is the destination register and C is the source register whose contents
need to be transferred to the destination register. Algorithm – The
instruction MOV B, C is of 1 byte; therefore the complete instruction will
be stored in a single memory address. For example:
Only opcode fetching is required for this instruction and thus we need 4 T
states for the timing diagram. For the opcode fetch the IO/M (low active)
= 0, S1 = 1 and S0 = 1. The timing diagram of MOV instruction is shown
below:
In Opcode fetch ( t1-t4 T states):
8255 with A/D and D/A converter and their interfacing to the
microprocessor:
However, the Intel 8255 itself does not have built-in analog-to-
digital (A/D) or digital-to-analog (D/A) converter functionality. If we
need analog-to-digital or digital-to-analog conversion, we would
typically need additional components.
Here's a general overview of how you might use an ADC and a DAC
in conjunction with an 8255 for analog interfacing:
Interfacing
Even a small stepper motor require a current of 400 mA for its
operation. But the ports of the microcontroller cannot source this
much amount of current. If such a motor is directly connected to
the microprocessor/microcontroller ports, the motor may draw large
current from the ports and damage it. So a suitable driver circuit is
used with the microprocessor/microcontroller to operate the motor.