Imp Coa
Imp Coa
A computer consists of five main components: Input unit, Central Processing Unit, Memory unit
Arithmetic & logical unit, Control unit and an Output unit.
ALU Control unit Input Unit Output Unit Memory Unit CPU (eg:-Mouse, Keyboard) (eg:-Monitor,
Printer)
Input unit
○ Input units are used by the computer to read the data.
○ The most commonly used input devices are keyboards, mouse, joysticks, trackballs, microphones,
etc.
Central processing unit
○ Central processing unit commonly known as CPU can be referred to as an electronic circuitry
within a computer that carries out the instructions given by a computer program by performing the
basic arithmetic, logical, control and input/output (I/O) operations specified by the instructions.
Memory unit
○ The Memory unit can be referred to as the storage area in which programs are kept which are
running, and that contains data needed by the running programs.
○ The Memory unit can be categorized in two ways namely, primary memory and secondary
memory.
○ It enables a processor to access running execution applications and services that are temporarily
stored in a specific memory location.
Arithmetic & logical unit
○ Most of all the arithmetic and logical operations of a computer are executed in the ALU
(Arithmetic and Logical Unit) of the processor.
o It performs arithmetic operations like addition, subtraction, multiplication, division and also the
logical operations like AND, OR, NOT operations.
REGISTER ARRAY:
Apart from Accumulator (A-register), there are six general-purpose programmable registers B,
C, D, E, Hand L.
They can be used as 8-bit registers or paired to store l6-bit data.
The allowed pairs are B-C, D-Eand H-L.
The temporary registers W and Z are intended for internal use of the processor and it cannot be
used by the programmer.
PROGRAMCOUNTER (PC):
The program counter (PC) keeps track of program execution.
To execute a program the starting address of the program is loaded in program counter. The PC sends
out an address to fetch a byte of instruction from memory and increment its content automatically.
Hence, when a byte of instruction is fetched, the PC holds the address of the next byte of the instruction
or next instruction.
INTERRUPT CONTROL:-
interrupt control provide control for following interrupt INT, INTA, RST5.5,RST6.5, RST7.5, TRAP
4) Draw the PIN DIAGRAM of 8085 & explain the detail of each pin OR Draw &
Explain 8085 Pin out signals.
X1 & X2
RESET IN:
It is used to reset the microprocessor. It is active low signal. When the signal on this pin is low
(for atleast 3 clocking cycles), it forces the microprocessor to reset itself.
Resetting the microprocessor means:Clearing the PC and IR.
Disabling all interrupts (except TRAP).
Disabling the SOD pin.
All the buses (data, address, control) are tristated.
Gives HIGH output to RESET OUT pin.
RESET OUT:
It is used to reset the peripheral devices and other ICs on the circuit.
It is an output signal.
It is an active high signal.
The output on this pin goes high whenever RESET IN is given low signal.
The output remains high as long as RESET IN is kept low
Interrupt Pin:
TRAP:-
It is a non-maskable interrupt.
It has the highest priority.
It cannot be disabled.
It is both edge and level triggered.
It means TRAP signal must go from low to high and must remain high for a
certain period of time.
TRAP is usually used for power failure and emergency shutoff.
RST 7.5:-
It is a maskable interrupt.
It has the second highest priority.
It is positive edge triggered only.
The internalflip-flop is triggered by the rising edge.
The flip-flop remains high until it is cleared by RESET IN.
RST 6.5:-
It is a maskable interrupt.
It has the third highest priority.
It is level triggered only.
The pin has to be held high for a specific period of time.RST 6.5 can be enabled by EI instruction.
It can be disabled by DI instruction.
RST 5.5:-
It is a maskable interrupt.
It has the fourth highest priority.
It is also level triggered.
The pin has to be heldhigh for a specific period of time. This interrupt is very similar to RST 6.5.
INTR:-
It is a maskable interrupt.
It has the lowest priority.
It is also level triggered.
It is a general purpose interrupt.
By general purpose we mean that it can be used to vector microprocessor to any specific subroutine
having any address.
INTA:
It stands for interrupt acknowledge.
It is an outgoing signal.
It is an active low signal.
Low output on this pin indicates that microprocessor has acknowledged the INTR request.
A8 – A15:-(Unidirectional)
These pins carry the higher order of address bus. The address is sent from microprocessor to memory.
ALE:- (Output)
It is used to enable Address Latch. It indicates whether bus functions as address bus or data bus.
If ALE = 1 then Bus functions as address bus.
If ALE = 0 then Bus functions as data bus.
S0 and S1 :-( output)
S0 and S1 are called Status Pins. They tell the current operation which is in progress in 8085.
S0 S1 Operation
0 0 Halt
0 1 Write
1 0 Read
1 1 Opecode
IO/M:-
This pin tells whether I/O or memory operation is being performed.
If IO/M = 1 then I/O operation is being performed.
If IO/M = 0 then Memory operation is being performed.
RD:-
RD stands for Read. It is an active low signal.
It is a control signal used for Read operation either from memory or from Input device.
A low signal indicates that data on the data bus must be placed either from selected memory location or
from input device.
WR:-
WR stands for Write. It is also active low signal.
It is a control signal used for Write operation either into memory or into output device.
A low signal indicates that data on the data bus must be written into selected memory location or into
output device.
READY:-
This pin is used to synchronize slower peripheral devices with fast microprocessor
HOLD:-
HOLD pin is used to request the microprocessor for DMA transfer.
A high signal on this pin is a request to microprocessor to come off from the hold on buses.
This request is sent by DMA controller.
HLDA:-
HLDA stands for Hold Acknowledge.
The microprocessor uses this pin to acknowledge the receipt of HOLD signal. When HLDA signal goes
high, address bus, data bus, RD’,WR’,
IO/M’ pins are tri-stated. This means they are cut-off from external environment.
The control of these buses goes to DMAController.
VSS and VCC:-
+5V power supply is connected to VCC. Ground signal is connected to VSS.
The 8-bit 8085 CPU (or MPU – Micro Processing Unit) communicates with the other units using a 16-bit
address bus, an 8-bit data bus and a control bus.
Address Bus
It consists of 16 address lines: A0 – A15
It operates in unidirectional mode: The address bits are always sent from the MPU to peripheral
devices in one direction, not reverse.
MPU uses the address bus to perform first function : identifying a peripheral or a memory
location.16 address lines are capable of addressing a Total of 2 16=65,536 (64k) memory locations.
Address locations: 0000 (hex) to FFFF (hex)
When the 8085 wants to access a peripheral or a memory location, it places the 16-bit address on
the address bus and then sends the appropriate control signals.
Data Bus
It consists of 8 data lines: D0 – D7
It operates in bidirectional mode: The data bits are sent from the MPU to peripheral devices, as
well as from the peripheral devices to the MPU.
The MPU uses the data bus to perform second function : Transfer binary information ( data and
instructions )
Data range: 00 (hex) – FF (hex)
Control Bus
It comprised of various single lines that carry synchronization signals.
The MPU uses such lines to perform third function: Provide timing or synchronization signals
(control signals)
Registers
Six general purpose 8-bit registers: B, C, D, E, H, L
They can also be combined as register pairs to perform 16-bit operations: BC, DE, and HL
Registers are programmable (data load, move, etc.)
Accumulator
Single 8-bit register that is part of the ALU
Used for arithmetic / logic operations – the result is always stored in the accumulator.
Flag Bits
Indicate the result of condition tests.
Carry, Zero, Sign, Parity, etc.
Conditional operations (IF / THEN) are executed based on the condition of these flag bits.
The Program Counter (PC)
This is a register that is used to control the sequencing of the execution of instructions.
This register always holds the address of the next instruction.
Since it holds an address, it must be 16 bits wide.
The Stack pointer
The stack pointer is also a 16-bit register that is used to point into memory.
The memory this register points to be a special area called the stack.
The stack is an area of memory used to hold data that will be retrieved soon.
The stack is usually accessed in a Last in First out (LIFO) fashion.
Instruction:
Instruction is the command given by the programmer to the Microprocessor to Perform the
Specific task.
For example, transfer a data, to do addition etc.
Machine Cycle:
Machine cycle is the time required to transfer data to or from memory or I/O devices.
Each read or writes operation constitutes a machine cycle.
VPMP Polytechnic Page 9
Subject Name: COA Subject Code:4350701
The instructions of 8085 require 1–5 machine cycles containing 3–6 clocks.
The 1st machine cycle of any instruction is always an Op code fetching cycle in which the processor
decides the nature of instruction.
It is of at least 4-clocks. It may go up to 6-Clocks.
Instruction Cycle:
An instruction cycle is defined as the time required for fetching and executing an instruction.
For executing any program, basically 3-steps are followed sequentially that is Fetch, Decode and
Execute.
Op code:
Operation Perform by the microprocessor is called Op code.
Operand:
The Data on which Microprocessor perform operation is called Operand.
The 8085 instruction set can be classified into the following seven functional group.
1) Data Transfer Instructions
2) Arithmetic Instructions
3) Logical Instructions
4) Branching Instructions
5) Stack related instructions
6) Input/output instructions
7) Machine Control Instructions
These instructions move data between registers, or between memory and registers.
These instructions copy data from source to destination.
MOV Rd,Sd
MOV R,M
MOV M,R
Move Instruction
MVI R,data-8
MVI M, data-8
LXI Rp, data-16
LDA addr-16
STA addr-16
Load and Store LDAX Rp
Instruction STAX Rp
LHLD addr-16
SHLD addr-16
Exchange Instruction XCHG
ADD R/M
ADI DATA-8
ADC R/M
Addition Instruction
ACI data-8
DAD Rp
DAA
SUB R/M
Subtraction SUI data-8
Instruction SBB R/M
SBI data-8
INR R/M
Increment and INX Rp
Decrement DCR R/M
DCX Rp
These instructions perform logical operations on data stored in registers, memory and status flags.
Logical AND ANA R/M
Instruction ANI data-8
Logical OR ORA R/M
Instruction ORI data-8
Logical Ex-OR XRA R/M
Instruction XRA data-8
Compare Instruction CMP R/M
CPI data-8
RLC
Rotate Instruction RAL
RRC
RAR
CMA
Complement
CMC
Instruction
STC
The stack is a collection of memory locations containing a register that stores the top-of-element address
in digital computers.
Stack's operations are:
The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand.
Before the transfer, the address of the next instruction after CALL(the contents of the
program counter) is pushed onto the stack.
Example: CALL 2034H or CALL XYZ
Call conditionally:
The program sequence is transferred to the memory location specified by the 16-bit
address given in the operand based on the specified flag of the PSW as described below.
Before the transfer, the address of the next instruction after the call (the contents of the
program counter) is pushed onto the stack.
Example: CZ 2034H or CZ XYZ
The program sequence is transferred from the subroutine to the calling program.
The two bytes from the top of the stack are copied into the program counter, and
program execution begins at the new address.
Example: RET
Immediate Addressing
In immediate addressing mode, the data is specified in the instruction itself. The data will be a part
of the program instruction. All instructions that have ‘ I ’ in their mnemonics are of immediate
addressing type. For Example, MVI B, 3EH - Move the data 3EH given in the instruction to B
register.
Register Addressing
In register addressing mode, the instruction specifies the name of the register in which the data is
available. This type of addressing can be identified by register names (such as ‘A’, ‘B’ etc.) in the
instruction. For Example, MOV A, B -Move the content of B register to A register.
Direct Addressing
In direct addressing mode, the data will be in memory. The address of the data is specified in the
instruction directly.
For Example, LDA 1050H - Load the data available in memory location 1050H in accumulator.
Indirect Addressing
In indirect addressing mode, the data will be in memory. The address of the data is specified in the
instruction indirectly i.e. address is store in Registers. This type of addressing can be identified by
letter ‘M’ present in the instruction.
For Example: MOV A, M - The memory data addressed by HL pair is moved to A register.
Implied Addressing
In implied addressing mode, there is no operand. i.e. This type of instruction does not have any
address, register name, immediate data specified along with it.
For Example, CMA - Complement the content of accumulator.
RAM
ROM
ROM does not loss its contents when the power is turned OFF. So, ROM is called Non volatile
memory.
The microprocessor can only read from this memory.
It is programmable once.
Types of ROM are:
o PROM
o EPROM
o EEPROM
o Masked ROM
The two chip select inputs must be CS1=1 and CS2=0 for the unit to operate.
Otherwise the data bus is in High Impedance State.
When the chip is enabled by the two select inputs, the byte selected by the address lines appears on the
data bus.
PROM :
o Programmable Read only memory
o PROM Programmer program in a blank chip.
o Once you program it, You can never change.
o It maintains large storage media but can not offer the erase feature.
Read Operation: When CPU finds a word in a Cache Memory, Main Memory is not involved.
Write Operation: When CPU finds a word in a Cache Memory, Main Memory is involved.
The transformation of data from main memory to cache memory is referred to as a mapping process.
Types of Mapping:
1) Associative Mapping
2) Direct Mapping
3) Set-associative Mapping
The size of virtual memory is equivalent to the size of secondary memory. Each virtual address or
logical address referenced by the CPU is mapped to a physical address in main memory.
A hardware device called Memory Management Unit (MMU) performs this mapping during run time.
To perform this activity MMU actually takes help of a memory map table, which is maintained by the
operating system.
1. Programmed I/O
When a byte of data is available, the device places it in the I/O bus and enables its data valid line.
The interface accepts the byte into its data register and enables the data accepted line.
The interface sets a bit in the status register that we will refer to as an F or "flag" bit.
The device can now disables the data valid line.
Then reading the status register into a CPU register and check the value of the flag bit .
If the flag is equal to 1, the CPU reads the data from the data register.
The flag bit is then cleared to 0 by CPU or Interface(depends o IC)
Then Interface disable the data accepted line and the device can transfer the next data byte
In programmed initiated, CPU stays in a program loop until the I/O unit indicates that it is ready for data
transfer.
It keeps the processor busy without need.
It can be avoided by using an interrupt facility .
When the data are available from devices, interface issues an interrupt request signal.
In the meantime CPU can proceed to execute another program.
The interface meanwhile keeps monitoring the device.
When the interface determines that the device is ready for data transfer, it generates an interrupt request
to the computer.
Upon detecting the external interrupt signal, CPU stops the task, branches to the service program to
process I/O and then return to the task it was originally performing.
The transfer of data between a fast storage device such as magnetic disk and memory is often limited by
the speed of the CPU.
Removing the CPU from the path and peripheral device manage the buses directly will improve the
speed of transfer.
This transfer technique is called DMA.
A DMA controller takes over the buses to manage the transfer directly between the I/O devices and
memory.
BR is used by DMA Controller to request CPU to relieve control of buses.
BR is active, then CPU place address bus, data bus, read and write line into high impedance state.
The CPU activate the BG to inform DMA that buses are in high impedance state.
DMA takes the control of buses and conduct memory transfer.
When the DMA terminates the transfer, it disable the bus request line(BR).
CPU disable the BG.
The register in the DMA are selected by the DS (DMA select) and RS (register select) inputs.
The RD (read) and WR (write) inputs are bidirectional.
When the BG is 0, the CPU can communicate with the DMA registers through the data bus to read from
or write to the DMA registers.
When BG= 1, the CPU relieve the buses and the DMA can communicate directly with the memory
The word count register holds the number of words to be transferred.