Unit - VI DE
Unit - VI DE
3.Increment 7.Complement
4.Decrement 8.EX-OR
Timing and Control Unit
X1
Timing and Control Unit
X2
Crystal oscillator
Registers
Registers are used by the microprocessor for temporary storage and
manipulation of data and instructions.
Data remains in the registers till they are sent to the memory or I/O devices.
Intel 8085 has following set of registers
a) Accumulator, i.e. register A
b) General purpose register, i.e. B, C, D, E, H, L
c) Stack Pointer
d) Program Counter
e) Instruction register
f) Temporary register
g) Status Flags (Flag Register)
Accumulator
a) Program counter –
• It is a 16 bit register which contains or hold the address of
next instruction to be executed.
• It takes care of the program flow or control.
b) Instruction register –
• It is a 8 bit register
• It holds the opcode of the instruction which is being decoded
and executed.
c) Temporary register
d) Stack pointer
• It is a 16 bit register which contains the address of the data
present at top of the stack.
• It points to top of stack.
Stack Pointer(Contd.)
S Z X AC X P X CY
– Sign Flag
• Used for indicating the sign of the data in the accumulator
• The sign flag is set if negative (1 – negative)
• The sign flag is reset if positive (0 –positive)
• Zero Flag
– Is set if result obtained after an operation is 0
– Is set following an increment or decrement operation of that register
10110011
+ 01001101
1 00000000
• Carry Flag
– Is set if there is a carry or borrow from arithmetic
operation
• Parity Flag
– Is set if parity is even
– Is cleared if parity is odd
A8-A15 = These are address bus and are used for the most significant bits of the
memory address or I/O address.
AD0-AD7 = These are time multiplexed address/data bus, i.e.
S1 S0 Operation
0 0 HALT
0 1 WRITE
1 0 READ
1 1 FETCH
Memory
Microprocessor
DMA Controller
I/O device
RESET IN = It reset the program counter, interrupt enable, HLDA flip-flops and
instruction register.
RESET OUT = It indicates that the CPU is being reset.
Interrupt
•Interrupt is an internal or external signal which may disturb or alter the sequence
of execution of processor.
•It is a method by which an I/O device informs the processor that it requires
services of the processor.
Interrupt can be classified as:
a. Maskable – Interrupt which can be avoided.
Non-Maskable - Interrupt which cannot be ignored or
avoided.
b. Vectored – Interrupt which has specific address location in the
memory.
Non-vectored – Interrupt which do not have specific address
location in the memory.
Crystal and serial I/O lines
Vcc = +5 V supply
Vss = ground reference
Clock = It is a output for user, which can be used for other
digital ICs.
INSTRUCTION & DATA FORMATS
• Each instruction has two parts.
– The first part is the task or operation to be
performed.
• Opcode (Operation code)- It specifies the task to be
performed. “opcode” (operation code).
LXI H, 2500 2500 is 16 bit data and is loaded into H-L pair
b) Register addressing mode
•Operand is one of the GPR or the accumulator.
•Opcode specifies the operation to be performed and address of the registers.
•Operation takes place between registers.
•Example-
MOV A,M Move the content of the memory location whose address is in H-L pair to the
accumulator
HLT Halt
• Indirect Addressing Mode
• Using data in memory directly (without loading
first into a Microprocessor’s register) is called
Indirect Addressing.
16 bit address
•POP instruction is used to transfer the contents from the stack to respective registers.
•The stack pointer register tracks the storage and retrieval of the information.
•The contents of the program counter can be stored when a subroutine is called.
•Instructions
PUSH Rp Copy the content of the specified register pair on the stack.
Rp can be B, D, H which represents the register pair BC, DE, HL.
PUSH PSW Copy the contents of accumulator and flags on the stack
POP Rp Copy the content of the memory locations of the stack into the specified register pair.
POP PSW Copy the content of memory location into the registers
The stack space grows upward in the numerically decreasing order of memory addresses.
The storage and retrieval of data bytes on the stacks should follow the LIFO sequence.
Information in stack locations is not destroyed until new information is stored in those
locations.
Timing diagram
It is a graphical representation of necessary steps which are carried out in a machine cycle.
Pictorial representation of execution of an instruction with the help of various control/timing and status
signals.
Based on different sets of operations carried out in 8085 microprocessor, there are different timing diagram:
a. Opcode fetch -4T
b. Memory read-3T
c. Memory write -3T
d. I/O read-3T
e. I/O write -3T
Timing diagram for Opcode Fetch Cycle
Sequence of steps for opcode fetch operation
•First clock cycle (T1)- Microprocessor sends the address of the memory where the opcode is available.
•Second clock cycle (T2) – The control unit sends the control signal to the memory chip to enable the
read operation. The byte is placed from the memory location on the data bus.
•Third clock cycle (T3) – The opcode is placed in the IR.
•Fourth clock cycle (T4)- The opcode is decoded.
Sequence of steps for memory READ operation
• First clock cycle (T1)- Microprocessor sends the address
of the memory where the data is available.
• Second clock cycle (T2) – The control unit sends the
control signal to the memory chip to enable the read
operation. The byte is placed from the memory location
on the data bus.
• Third clock cycle (T3) – The data enters the CPU.
Timing diagram for memory WRITE Operation
The program counter places the address on the higher order and the lower order
address bus The op code at this memory location is read into the microprocessor
The PC is then incremented by 1 to point to the next byte This machine cycles
requires 4 T states
The program counter places the address on the higher order and the lower order
address bus
The op code at this memory location is read into the microprocessor
2 Memory Read
The data is read from the addressed memory location into the specific register
The PC is again incremented by one to point to next instruction after MVI
Microprocessor Communication and Bus timings
•A program constitutes a set of Instructions. The processor fetches one instruction from
the memory at a time and executes it.
•The necessary steps that a processor carries out to fetch an instruction and data from
memory and I/O devices, constitutes an instruction cycle.
Execute cycle Processor gets data from memory or I/O devices and
perform specific operation
The microprocessor places the 16 bit memory address from the program
counter to the memory address register (MAR). The contents of MAR is
transferred to the memory through the address bus.
The control unit sends the control signal , to the memory.
The opcode from the memory location is placed on data bus.
The opcode first come in the memory data register (MDR) and from there it
goes to Instruction register.
The instruction is decoded in the instruction decoder.
Execute Operation
There are different control signals which are required for the
operation of microprocessor.
Operation Control
Signals
0 0 1 Fetch
0 0 1 M/M Read
0 1 0 M/M
Write
1 0 1 I/O Read
1 1 0 I/O Write
Microprocessor Communication and Bus timings
•A program constitutes a set of Instructions. The processor fetches one instruction from
the memory at a time and executes it.
•The necessary steps that a processor carries out to fetch an instruction and data from
memory and I/O devices, constitutes an instruction cycle.
Execute cycle Processor gets data from memory or I/O devices and
perform specific operation