Part 2 Chapter 1
Part 2 Chapter 1
Microprocessors and
Microcomputers
Chapter 1 Part 2
1.4.3 Peripheral or Externally Initiated Operations
● External devices can initiate the following operations, for which individual pins on the microprocessor chip
is assigned. These operations are:
1. Reset: When reset pin is activated, all internal operations are stopped and the program counter is reset to
0000. Program execution again begins from zero memory address.
2. Interrupt (Next Slide)
3. Ready: The 8085 has a pin called READY. This pin is used to synchronize the speed of the microprocessor
with the slower peripherals. When this READY signal is low, the microprocessor will remain in wait state.
4. Hold: Hold is a process in which microprocessor is asked by the peripheral device to suspend its current
operation and release the bus system so that the requesting device can use the microprocessor buses. To
initiate this Hold operation, the 8085 has a pin called HOLD.
1.4.3 Externally Initiated Operations: Interrupt
● Interrupt is a process in which microprocessor is asked to suspend its current operation
and execute some emergency task or operation.
● Microprocessor 8085 has five different pins which are used to interrupt the processor.
● Whenever microprocessor receives a signal on any of these pins, the microprocessor
suspends its current operation and executes the emergency task.
● The emergency program which is executed by the process in response to an interrupt
signal is known as an Interrupt Service Routine (ISR).
● When the ISR is completed, the microprocessor returns to its previous operations and
resumes its suspended operation.
1.5 8085 FUNCTIONAL DESCRIPTION
The 8085A is an 8-bit processor because its accumulator size is of 8-bit (It is the size of the
accumulator which decides the word length of a processor).
The data bus of 8085A is multiplexed with lower-order address bus. So the address bus is
divided, as the higher-order bus which carry the higher 8-bit address and the lower order
multiplexed address/data bus which carries the lower 8-bit address.
The address is sent out on the multiplexed lines during the first T state of the machine cycle.
For the remaining T states of the machine cycle, the multiplexed address/data bus is used to
carry the data for memory or l/O.
1.5 8085 FUNCTIONAL DESCRIPTION
The 8085A generates three control signals RD ,WR , and IO/M for bus control. These three
signals are used to generate the four control signals IOR , IOW , MEMR and MEMW.
The 8085A also provides pins the serial input data (SID), and the serial output data (SOD)
for serial communication.
The 8085 has six interrupt related signals which can cause five different hardware
interrupts. These interrupts are INTR, RST 5.5, RST 6.5, RST 7.5, and TRAP. TRAP is a
non-maskable interrupts which have the highest priority. The RST 5.5, RST 6.5, and RST
7.5 are maskable interrupt.
1.6 INTERNAL ARCHITECTURE OF 8085
1. Register unit
2. Arithmetic and logical unit
3. Control Unit
4. Interrupt unit
5. Serial IO unit.
Figure 1.3
1.8 MICROPROCESSOR SYSTEM (Just for
Clarification - we have not reached it yet)
1.6.1 Register Unit: General purpose data
register
The 8085/8080A has six general purpose data registers to store 8-bit data. These registers
are named B, C, D, E, H, and L. The user can use these registers to store or copy a data
temporarily during the execution of a program by using data transfer instructions.
whenever the microprocessor has to handle 16-bit data these registers can be combined as
register pairs: BC, DE, and HL.
1.6.1 Register Unit: Program counter (PC)
The program counter (PC) is 16-bit register which is used to sequence the execution of
instructions.
This register is actually a memory pointer which always points to a memory location from
where the microprocessor has to fetch the next byte.
Memory locations have 16-bit addresses, and that is why this register is of 16-bits. When a
byte (machine code) is being fetched by the microprocessor, the program counter is
automatically incremented by one to point to the next memory location.
1.6.1 Register Unit: Stack pointer (SP)
The stack pointer is a 16-bit address register which is used as a memory pointer in the stack
memory area.
1.6.1 Register Unit: Increment/decrement
counter
his counter register is used to increment or decrement the contents of the various registers
available in the register unit. For example, every time microprocessor accesses a memory,
its PC register is incremented.
1.6.1 Register Unit: Mux/demux unit
This unit is used to select a register out of all the available registers.
- This unit behaves as a Mux when data is going from the register to the internal data bus.
- It behaves as a Demux when data is coming to a register from the internal data bus of
the microprocessor.
The register select will behave as the function selection lines of the Mux/Demux.
1.6.1 Register Unit:
Address buffer register and data/address buffer register
These registers hold the address/data, received from PC (Program Counter)/internal data
bus and then load the external address and data buses.
These registers actually behave as the buffer stage between the microprocessor and external
system buses.
1.6.2 Control Unit
control unit is responsible for the generation of the control signals within the
microprocessor to execute an instruction.
The control unit itself consists of three parts, first the instruction register; second the
instruction decoder and machine cycle encoder and third the control and timing unit.
Instruction register (IR): This register holds the machine code of the instruction. When
microprocessor executes a program, it reads the opcode from the memory, this opcode is
stored in the instruction register.
1.6.2 Control Unit
Instruction decoder and machine cycle encoder: The IR sends the machine code to this
unit. This unit, as its name suggests, decodes the opcode and finds out what is to be done in
response of the coming opcode and how many machine cycles are required to execute this
instruction.
Control and timing unit: The control unit generates signals within microprocessor to carry
out the instruction, which has been decoded. In reality it causes certain connections between
blocks of the microprocessor to be opened or closed, so that data goes where it is required,
and therefore ALU operations occur.
1.6.3 Arithmetic Logic Unit
Performs the arithmetic operations such as Addition, Subtraction, Increment and Decrement
and logic operations such as AND, OR, EXOR, etc.
ALU uses data from memory/register and accumulator to perform arithmetic and always
stores result of operation in accumulator.
1.6.3 Arithmetic Logic Unit
The accumulator is an 8-bit data register and is a part of arithmetic and logic unit (ALU).
The accumulator is also identified as register A.
a. It participates in all the arithmetic and logical operations, i.e. out of the two operands
one must be stored in accumulator.
b. After the operation, the result is stored in the accumulator.
c. The microprocessor always communicate with the IOFs through accumulator only.
1.6.3 Arithmetic Logic Unit
The microprocessor 8085 consists of an 8-bit register called the flag register.
Five of them (called flag) are used to represent five different data conditions, which are:
- Zero (Z)
- Carry (CY)
- Sign (S)
- Parity (P)
- Auxiliary Carry (AC).
1.6.3 Arithmetic Logic Unit
The conditions (set or reset) of the flags are tested by the software instructions.
1. Z (Zero) flag: This flag indicates that the result of a mathematical or logical operation is
zero or not.
2. CY (Carry) flag: This flag indicates that whether during an addition or subtraction
operation, carry or borrow generated or not, if generated then this flag bit will set. (This
flag may also be set before a mathematical operation as an extra operand to certain
instructions.)
1.6.3 Arithmetic Logic Unit
Typical system uses a number of buses which are nothing but collection of wires, which
transmit binary numbers, one bit per wire. There Are typically three buses used for
communication:
1. Address bus
2. Data bus
3. Control bus
1.6.4 System Bus of 8085 : Address Bus
Address bus is a unidirectional group of lines, i.e. numbers only sent from microprocessor
to memory, not other way.
Microprocessor 8085 has 16 address lines, one wire for each bit.
- Data bus is used to carry the data (in binary form) from microprocessor to the peripheral
and vice versa (bidirectional).
- It carries data and instructions.
- If the microprocessor has to carry 8-bit data, then the whole data is transferred in a
single cycle but if the data is of 16-bits, then the lower 8-bits are transferred in the first
cycle and the upper 8-bits in the next cycle.
1.6.4 System Bus of 8085 : Control bus
- The control bus consists of individual lines which are used to carry the control information
between the microprocessor and the peripherals, e.g. Read line, Write line and the interrupt
lines.
- The Read control line indicates that microprocessor wants to read from either the memory or
from the IO.
- Similarly, the write control signal indicates that microprocessor wants to write something in the
memory or in the IO.
- The control bus may also include clock line(s) for timing/synchronizing, ‘interrupts’, ‘reset’,
etc.
- The control bus carries control signals partly unidirectional, partly bidirectional.