Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 77

Chapter 1 - (Paper II)

Introduction to
microprocessor and
organisation of 8085
12th Computer Science
Maharashtra Board
Marks Distribution

2
Evolution of Microprocessors

Name Gates per IC

SSI - Small Scale integration <10

MSI Medium Scale integration 10-100

LSI - Large Scale integration: 100-1000

VLSI - Very Large Scale integration 10,000-100000


First generation

Name Size Year Usage

Intel 4004 4 bit 1971 Calculator

Intel 8008 8 bit 1972


Second generation

Name Size Year Usage

Intel 8085 8 bit 1976 Microcomputer


Third generation

Name Size Year Usage

Intel 8086 16 bit 1978 Named as CPU


Fourth generation

Name Size Year Usage

Intel 80386 32 bit 1981 Named as CPU

PENTIUM 32 bit 1993


What is a Microprocessor ?
A microprocessor is a multipurpose, programmable logic
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.
Microcomputer is one of the
microprocessor- based systems.
1. The microprocessor is a semiconductor device consisting of
electronic logic circuits.

2. It is capable of performing various computing functions and


making decisions to change the sequence of program
execution.
The microprocessor can be broadly divided into
three parts :

1. Arithmetic / Logic unit

2. Registers

3. Control unit
Arithmetic / Logic unit (ALU)

1. This is the area of the microprocessor where various


computing functions are performed on data.

2. The ALU unit performs such arithmetic operations as addition


and subtraction, and logical operations such as AND, OR and
EXCLUSIVE OR. Results are stored either in registers or in
memory.
Registers

1. This area of the microprocessor consists of various registers.

2. These registers are primarily used to store data temporarily


during the execution of a program. Some of the registers are
accessible to the user through instructions.
Control unit
1. The control unit provides the necessary timing and control signals to
all the operations in the microcomputer.

2. It controls the flow of data between the microprocessor and memory


and peripherals.
Memory
1. Memory stores binary information such
as instructions and data, and provides that
information to the microprocessor
whenever necessary.

2. To execute programs, the


microprocessor reads instructions
and data from memory and performs
computing operations in its ALU section.

3. Results are either transferred to the


output section for display or stored in
memory for later use.
Input/Output (I/O)
1. This section communicates with the
outside world.

2. I/O devices are also known


as peripherals.

3. The input devices are keyboard


switches and an analog to digital
converter.

4. These devices are used to transfer


data from the outside world to a
microprocessor.
Input/Output (I/O)

5. The output devices are Light emitting diodes (LEDS), cathode


ray tube (CRT) of video screen, printer, plotter, magnetic tape or digital
to analog converter.

6. These devices transfer data from a microprocessor to the outside


world.

7. The data can be displayed on CRT or video screen and it can be


printed on paper by using a printer.
System Bus
System Bus

1. The system bus is a communication path between a microprocessor


and peripherals.

2. It is a group of wires to carry bits.

3. There are several buses in the system.


Primary function of the CPU of a microcomputer:

1. To fetch, decode, and execute program instructions in the proper


order.

2. Transfer data to and from memory and to and from I/O section.

3. Responds to external interrupts.

4. provide overall timing and control signals for the entire system.

5. R/W of data into memory so bi-directional bus is required.


Block diagram of ALU
Block diagram of ALU
1. ALU is an 8 bit unit.

2. It performs arithmetic, Logic, and


rotate operations.

3. All processing and data flow is


done in the system with mpu chip.

4. It consists of a binary adder to


perform addition and subtraction by
2's complement method.
Block diagram of ALU
1. The result is typically stored in an
accumulator.

2. Accumulator, temporary register flag


register is closely Associated with ALU

3. The Temporary register is used to hold


data during arithmetic / logic operation

4. Flags are set or Reset according to the


result of operations in the Status register.

5. Adder performs arithmetic operations like


addition, subtraction, increment,
decrement etc. with the result being fed
back into the accumulator via an internal
data bus.
Block diagram of ALU
1. Shifters perform logical operations like
rotate Left, rotate right etc. Result
is placed in the accumulator.

2. Status registers are set or Reset


according to ALU operation
Block diagram of generic
microprocessor
Generic microprocessor
1. Arithmetic and Logic unit

2. Several registers: Instruction register, Accumulator, Status register, Temporary


register, Stack pointer, Data address register

3. Program counter

4. Instruction decoder

5. Timing and control section

6. Bus buffers and latches.

7. Internal buses and control lines

8. Several control inputs and outputs.

9. Interrupt control.
Address Bus
• The address bus is group of 16 lines generally
identified as A0 to A15.

• The address bus is unidirectional i.e. bits flow in one


direction - from microprocessing unit (MPU) to
peripheral devices.

• The MPU uses the address bus to identify a peripheral


or memory location.

• In a Computer system, each peripheral or memory


location is identified by a number called an address.

• The address bus is used to carry 16 bit address.

• With 16 address lines, 216=65536 (i.e. 64 k) locations


can be addressed.
Data Bus
• The data bus is a group of 8 lines used for data flow.

• These lines are bidirectional data flow in both the


directions between MPU and memory and peripheral
devices.

• MPU uses the data bus for transferring data.

• The eight lines can carry 8 bit data ranging from 00 to


FF (11111111).

• 28 = 256 numbers.

• The microprocessors having 8 bit data bus are called


8 bit microprocessors.
Data address Register
• The data address register is a two 8 bit
registers that can be used separately or as
a combined pair.

• They are labeled as H and L (i.e. high order


byte and low order byte).

• They are general purpose registers.

• Data can be stored in these registers.

• When they are used in pair, 16 bit address


can also be stored in theses registers.
Instruction Register
• This is a 8 bit register.

• The first byte (i.e. 8 bits) of an


instruction is stored in this register.

• Eg. MOV A, M
Instruction Decoder
• This unit interprets the contents of
instruction register.

• It determines the exact steps to be


followed in executing the entire
instruction and directs the control
section accordingly.
Arithmetic and Logic unit
• This unit performs arithmetic and logic
operations.

• This unit also performs rotate operation.

• The operations in this unit affects the


status register.

• The results from ALU are placed in


accumulator.

Accumulator
• Accumulator is 8 bit register.

• Many time it is treated as a part of ALU.

• This register is used to store 8-bit data and


in arithmetic and logic operations, the
result is stored in accumulator.
Status Register
• Status register consist of flip flops that are set
or reset according to data conditions in
accumulator.

• Status register is also called as flags.

• The generic MPU has two flags Zero and


carry flags.

• After an arithmetic operation such as


addition, if the sum in the accumulator is
larger than 8 bits, than Carry flag is set to
one.

• The zero flag is set, when operation results in


zero.
Program Counter
• Program counter is 16 bit register.

• It contains the address of the next


instruction to be executed.

• It can be incremented or reset by the control


section.

• The contents of program counter can be


modified by transfer instructions.

C000 H Instruction 1
C001 H
C001 H Instruction 2
Program Counter
C002 H Instruction 3
Stack Pointer
• Stack pointer is also a 16 bit
register.

• It consist of top address of memory


location called stack.

• Stack is a set of memory locations


in R/W memory specified by
Push Pop programmer, used for temporary
storage.

C001 H C000 H
Stack Pointer
C001 H

C002 H
Stack
Timing and control unit
• This section receives signals from the
instruction decoder to determine the nature
of instruction to be executed.

• Information from status register is also


available for conditional branching.

• Timing and control signals are sent to all


parts of microprocessor to coordinate
execution of instructions.

• External control signals are also generated.


Control Inputs and Outputs
• Reset and interrupt request (INTR) are control inputs
for generic microprocessors.

• When reset is activated, all internal operations are


suspended and the program
counter is cleared (i.e. it holds 0000H) Now the
program execution can again begin at zero memory
address.

• By activating INTR, the microprocessor can be


interrupted from the normal execution of instructions
and asked to execute some other instructions.

• The microprocessor resumes its operations after


completion of other instructions, called service
routine.

• The control outputs are write, read and clock lines.


Control Inputs and Outputs
• An external crystal is connected between x1 and x2.
• The clock circuit generates clock signal for internal
use.

• This signal is also made available at output on clock


line.
• This is used to synchronize actions in the entire
system.

• The control signal Read (RD) indicates that the


selected I/O or memory device is to be read and data
is available on the data bus.

• The control signal Write (WR) indicates that the data


on the data bus is to be written into selected memory
or I / O locations.

• RD and WR are active low control signals.


Bus Buffers and Latches
• A latch is a flip flop.

• It is used to store one bit of information.

• To avoid unintentional change in the input and


control the availability of output, we can use tri
state buffers along with latches.

• We can write into latch by enabling a buffer.


8085 Microprocessor

• After having become familiar with the generic microprocessor, we


are ready to study the 8085 microprocessor.

• The intel 8085 is an 8-bit general purpose microprocessor.

• This microprocessor is capable of addressing 64k of memory This


device has 40 pins, requires +5V single power supply and can
operate with a 3 - MHZ single phase clock.

• The 8085 is an enhanced version of the 8080. It is upward compatible


with 8080. Programs written for 8080 can be executed by 8085.
The 8085 Pin Diagram and Functions
The 8085 is housed in a 40 Pin dual-in-line package (DIP).
All the pins of 8085 can be classified into six groups.

1. Address Bus

2. Multiplexed Address / Data bus.

3. Control and status signals.

4. Power supply and frequency signals.

5. Externally initiated signals.

6. Serial I/O ports.


All the pins of 8085 can be classified into six groups.
Address Bus

The 8085 has eight signal lines, A15 - A8,


Which are unidirectional and used as the
higher order address bus.
Multiplexed Address / Data
Bus
1. The signal lines AD7- ADO are bidirectional.

2. They are used as lower order address bus as well


as the data bus i.e. they are used for dual
purposes.

3. In executing an instruction, during the earlier part


of the cycle these lines are used as the low -
order address bus.

4. During the later part of the cycle, these lines are


used as a data bus.
Multiplexed Address / Data Bus

5. This is known as multiplexing the bus.

6. The 8085 has a special signal called ALE (Address Latch Enable) for
informing the peripheral when the address / data bus is sending an
address and when it is functioning as a data bus.
Control and Status signals
This group of signals includes two control signals RD
and WR, three status signals IO/M, S1 and S0 and one
special signal ALE.

1. ALE:

• This is address Latch Enable.


• This is a positive pulse generated every time the 8085
begins an operation (machine cycle).
• This indicates that the bits on AD0-AD7 are address
bits
• This signal is used to separate the address bits.
Control and Status signals
2. RD:

• This is the Read control signal.


• This is an active low signal.
• This signal indicates that the selected I/O or memory
device is to be read and data is available on the data
bus.
Control and Status signals
3. WR:

• This is the write control signal.


• This also active low.
• This signal indicates that the data on the data bus is to
be written into selected memory or I / O locations.

4. IO/M:

• This is a status signal used to differentiate between I/O


and memory operation.
• When it is high, it indicates an I / O operation.
• When it is low, it indicates a memory operation.
Control and Status signals
5. S0 and S1:

● These are status signals.


● They can identify various operations.
Control and Status signals
The machine cycle types along with status signals are listed in figure
Power supply and clock frequency

6. Vcc: +5V power supply.

7. Vss: Ground Reference.

8. X₁ and X₂:
• A crystal having frequency 6 MHz is connected at
these two pins.
• The frequency is internally divided by two.
• The system operates at 3 MHz
Power supply and clock frequency

4. CLK (OUT):
• This is clock output.
• This signal can be used as the system clock for
other devices.
Externally Initiated signals

The 8085 has five interrupt signals-


INTR, RST 7.5, RST 6.5, RST 5.5 and TRAP

These signals can be used to interrupt


a program execution

1. INTR:
• This is the interrupt request signal.
• This is a general purpose interrupt.
Externally Initiated signals

2. RST 7.5, RST 6.5, RST 5.5:

• These are restart interrupts.


• These are vectored interrupts and transfer the program
control to specific memory locations. They have higher
priorities than INTR.
• Among these three, the priority order is 7.5,6.5 and 5.5.

3. TRAP:
• This is a nonmaskable interrupt and has the highest
priority.
Externally Initiated signals

4. INTA:
• This is an interrupt acknowledgement.
• The microprocessor acknowledges an interrupt request
by the INTA signal.
• In addition to the interrupts, three pins - RESET, HOLD
and READY accept the externally initiated signals as
inputs.

5. Ready:
• If the signal at this READY pin is low, the microprocessor
enters into a wait state.
• This signal is used primarily to synchronize slower
peripherals with the microprocessor.
Externally Initiated signals

6. HOLD:
• When a HOLD pin is activated by an external signal.
• The microprocessor relinquishes (Releases) control
of buses and allows the external peripherals to use
them.
• For example HOLD signal is used in Direct memory
Access (DMA) data transfer.

7. HLDA:
• This is an acknowledgement.
• Microprocessor acknowledges the hold request by
HLDA.
Externally Initiated signals

8. RESET IN:
• When the signal on this pin goes low,
the program counter is set to zero, the buses are
tri-stated and the MPU is reset.

9.RESET OUT:
• This signal indicates that the MPU is being reset.
• The signal can be used to reset other devices.
Serial I/O Ports
● The 8085 has two pins to implement serial
transmission, SID (Serial input data) and SOD
(serial output data).
● A single bit can be serially inputted through
SID.
● The output pin SOD is set or reset as per
8085 SIM instruction.
Functional Block diagram of 8085
Functional Block diagram of 8085
The block diagram includes :

1. ALU (Arithmetic/logic unit),


2. timing and control unit,
3. Instruction register
4. Decoder
5. Register array
6. interrupt control
7. Serial I/O control.
Arithmetic and logic unit (ALU)
● The arithmetic and logic unit performs arithmetic, logic and rotate
operations The result is typically stored in an accumulator.

● Accumulator, temporary register and flag register are closely


associated with ALU.

● The temporary register is used to hold data during an arithmetic /


logic operation.

● The flags (flip flops) are set or reset according to the result of
operations.
Arithmetic and logic unit (ALU)
● In most of the arithmetic and logic operations, the result is stored
in accumulator.

● Therefore, the flags generally reflect data conditions in


the accumulator.
Flags 8085 has five flags

• Sign flag
• Zero flag
• Auxiliary carry flag
• Parity flag
• Carry a flag
1. S-sign flag:

● After the execution of arithmetic or logic operation, if bit D7 of result


is 1, the sign flag is set to 1.

● This flag is used with signed numbers.

● In a given byte, if D7 is 1, the number will be viewed as a negative


number, if it is 0, the number will be considered positive.

● In arithmetic operations with signed numbers, bit D7, is reserved for


indication of the sign, and the remaining seven bits are used to
represent the magnitude of a number.
2. Z-Zero flag:

● The zero flag is set to 1 if the ALU operation results in 0, and the flag is reset if
the result is not 0.

● This flag is modified by the results in the accumulator as well as in other


registers.

3. AC - Auxiliary Carry flag:

● In an arithmetic operation, when carry is generated by digit D3 and passed on


to digit D4 the AC flag is set.

● The flag is used only internally for BCD (Binary Coded Decimal)
operations and is not available for the programmer to change the sequence of a
program with a jump instruction.
4. P Parity flag:

● This flag tests for number of 1 bits in accumulator.

● If the - accumulator holds an even number of 1s, it is said that even parity
exists and the parity flag is set to 1.

● If the accumulator holds an odd number of is (called odd parity), the parity flag
is reset to 0.

● For example, 0000 0011 has even parity.

5. CY- Carry flag:

If an arithmetic operation results in carry, the carry flag is set, otherwise it is


reset. The carry flag also serves as a borrow flag for subtraction.
Register Array

• The 8085 microprocessor uses both 8-bit


and 16-bit registers.
• The 8085 has eight addressable 8- bit
registers.
• Six of these can be used as 8 - bit
registers or 16 - bit register pairs.
• In addition, the 8085 contains two more
16-bit registers.
Register Array
1. The registers BC, DE and HL are general purpose
registers. They can be used as six 8-bit registers or three
16-bit registers. BC and DE are normally used as data
registers while HL register pairs can be used for address
pointing.

2. W and Z are temporary registers. These are used to


hold 8-bit data during the execution of some instructions.
These registers are used internally and they are not available
to the programmer.
Register Array
3. The program counter (PC) contains the 16 bit address of
the next instruction to be executed. It always points to the
memory location of the next instruction to be executed.

4. The stack pointer (SP) is also a 16 bit register. It consists


of an address at the top of the memory called a stack. The
stack pointer maintains the address of the last byte entered
in the stack. The SP is decremented each time data is
pushed onto the stack and is incremented each time data is
popped off the stack
Instruction Register and Decoder

● During an instruction fetch, the first byte of an instruction, the opcode, is


transferred to the 8-bit instruction register.

● The contents of the instruction register are, in turn, available to the


instruction decoder.

● The output of the decoder, gated by timing signals, controls the register,
ALU and data and address buffers.

● The output of the decoder and internal clock generator produce the state
and machine cycle timing signals.
Interrupts
Interrupts

● The highest priority interrupt is TRAP.


● This will cause program execution control to transfer to memory
location 0024 H.
● This input can not be disabled and therefore it is called a nonmaskable
interrupt.
● The next three interrupts are also called restarts.
● Their priority and address branched to is shown in figure 1-8.
● All last four interrupts can be enabled or disabled by software.
● Hence they are maskable interrupts.
Serial input and output
● The 8085 RIM instruction transfer data from SID to bit 7 of accumulator.
Serial input and output

● A single serial bit may be output via SOD pin of 8085.


● For this we use SIM instruction.

You might also like