Download presentation
1
MICROPROCESSORS & ORGANIZATION OF 8085
2
Microprocessor is roughly divided into 3 parts
It is a semiconductor, multipurpose, programmable logic device that reads binary instruction from storage device called memory, accepts binary data as input & processes the data according to the instructions & provides result as output It can be viewed as an integrated circuit, that contains processing capabilities of large computers. The electronic logic circuits in microprocessor capable of performing various computing functions. Microprocessor is roughly divided into 3 parts ALU Registers Control unit
3
Functions To fetch, decode & execute the instructions in proper order.
To transfer data from one block to another block or from one block to I/O lines To give proper response to different external interrupts according to their priority. To provide control & timing signals to the overall system according to the instructions
4
Evolution of microprocessors
First Generation: Intel’s first microprocessor available in the market. It was a 4-bit µp introduced in 1971 & used in calculators. Intel’s first general purpose 8-bit µp introduced in 1972 Second Generation: Intel’s 8080, Zilog’s Z-80, Motorola’s M6800- Introduced in All were 8-bit µps. During second generation the development of µp has been in a direction to complete microprocessor system called Microcontroller, which has CPU, ROM, RAM, clock, I/O ports all in single package. Intel’s bit µp introduced in 1976 Intersil’s IM6100 & Toshiba’s T bit µp developed in 1977
5
Third Generation: Intel’s first 16-bit µp introduced in 1978 Zilog’s Z-8000 in 1979 & Motorola’s in 1980. In 3rd generation memory space was 64 KB. The other features were Full arithmetic execution & efficient higher level language addressing. Fourth Generation: Intel’s first 32-bit µp introduced in It can address physical memory of 4 GB. Hewlett Packard’s HP bit µp announced in 1982. Motorola’s M bit µp introduced in 1987. Fifth Generation: Intel made improvement in µp design to provide the greater speed. These systems can run on new OS like UNIX, LINUX etc. This generations are called Pentium. 64-bit µp. Intel’s 80586, Intel’s Pentium IV
7
A microcomputer mainly contains following blocks:
Input device (Keyboard) Microprocessor unit (MPU) Program memory (ROM) Data memory (RAM) Output device (7-segment display) It addition to that it has I/O interfaces, decoder, clock & power supply . All these are connected through different lines/buses.
8
Input device (Keyboard): The instructions & data are entered through input device like keyboard.
Keyboard interface: It is necessary to connect keyboard to keyboard interface. The speed of input device & MPU may not be equal. It is not possible to feed instruction directly to MPU through keyboard because MPU may be busy in performing previous instruction or other task. So it is stored in a special chip called keyboard interface. Microprocessor unit (MPU): All processing & data flow is done in the system with MPU chip. MPU generates signals to control the system & processes system data. ROM (Read Only Memory): It contains permanently stored program called as monitor program. It has address bus, chip select & read signal line. It allows only to read stored information. RAM (Random Access Memory): It is temporary storage device used to store data Reads & writes of data into memory so bi-directional data bus is required.
9
Output device (7 segment display): stored data in display interface are displayed on 7-segment display. Display interface: It is necessary to store the data & drive the display. Address decoder: Decodes the address & select the proper device (chip). Clock: Whole circuitry is synchronized with clock. The speed of system depends on clock frequency. Power supply: Power supply is necessary to operate the circuit. Lines/Buses Interrupt line: used to give interrupt to MPU. Address bus: 16-bit unidirectional address bus used to flow bits of required memory from the MPU to devices. Data bus: 8-bit bi-directional data bus used to transfer data among MPU & devices. Control bus: It carries control signals generated by MPU. Power line: It is necessary to operate the circuit.
11
Arithmetic and Logic Unit:
Performs arithmetic & logic operations. Performs rotate operation. Operation in this unit affects the status register. The result from ALU are placed in accumulator. Several Registers: Accumulator 8-bit register used to store 8-bit data. In arithmetic & logic operation, the result is stored in accumulator. Instruction Register 8-bit register. The first byte of an instruction is stored in this register. Status Register Also called as Flags. Consists of flip-flops that are set or reset according to data condition in accumulator. The generic µp has two flags: Zero & Carry flag.
12
Program Counter 16-bit register contains the address of next executable instruction. It can be incremented or reset by control section. Stack Pointer 16-bit register consists of address of memory location called stack. Stack is R/W memory used for temporary storage. Data/Address Register It is a two 8-bit registers that can be used separately or as a combined pair. They are labelled as H & L. Data is stored in these registers. When used in pair, 16-bit address can also be stored. Instruction Decoder: Interprets the content of instruction register & determines exact steps to be followed in executing the entire instruction. It directs the control section accordingly.
13
Timing & Control Unit: Receives the signal from the instruction decoder to determine the nature of instruction to be execute. Timing & control signals are sent to all parts of µp. Address Bus: It is a group of 16 lines identified as A0 to A15. It is a unidirectional bus. Bits flow in one direction, from µp to peripheral devices. Data Bus: It is a group of 8-bits used for data flow. It is a bi-directional bus. Data flow in both directions between µp & memory & peripheral devices. Bus buffer & Latches: Latch is a flip-flop used to store 1 bit of information. Information is stored into latch by enabling buffer.
14
Functional Pin Diagram of 8085
15
A8 - A15 (Output tri-state)
Address Bus; The most significant 8 bits of the memory address or the 8 bits of the I/0 address, tri-stated during HOLD and HALT modes. AD0 - AD7 (Input/output tri-state) Multiplexed Address/Data Bus. Lower 8 bits of the memory address (or I/0 address) appear on the bus during the first clock cycle of a machine state. It then becomes the data bus during the second and third clock cycles. Tri-stated during HOLD and HALT modes. ALE (Output) Address Latch Enable, special output signal generated by microprocessor to indicate beginning of the operation. It is positive going pulse generated during first clock cycle of machine state indicating that the bits on AD7-AD0 are address bits. This signal enables the lower 8-bit of the address from the multiplexed bus to latch into external flip-flop or peripheral device. After AD7-AD0 changes over to data bus. ALE is never tri-stated.
16
This is active low, read control signal.
______ RD (Output tri-state) This is active low, read control signal. This signal indicates that selected I/O or memory device is to be read & data is available on data bus. It is tri-stated during HOLD & HALT. ___ WR (Output tri-state) This is active low write control signal. This signal indicates that the data on data bus is to be written into selected memory or I/O device. HOLD (Input) It indicates that a peripheral such as DMA controller is requesting the use of address & data buses. After receiving a HOLD request the µp releases the buses as soon as the current machine cycle is completed. Internal processing may continue. The µp regains the buses after removal of the HOLD signal.
17
Signal for HOLD ACKNOWLEDGEMENT.
HLDA (Output) Signal for HOLD ACKNOWLEDGEMENT. When high, this signal indicates to a peripheral that a HOLD request has been received & that the µp will release control of buses in the next clock cycle. After removal of HOLD request HLDA goes low. ______________________ RESET IN (Input) This is active low signal. When this signal goes low, the program counter is set to 000H The buses are tri-stated & µp unit is held in reset condition as long as RESET is applied. It also resets interrupt enable & HLDA flip-flop. RESET OUT (Output) It indicates that the µp is being reset. It is connected to peripherals to reset them when µp is reset.
18
READY (Input) It is input signal used by µp to sense whether a peripheral is ready to transfer data or not. This signal is used to delay the µp until a slow responding is ready to send or accept the data. If READY is high, the peripheral is ready. If it is low, the µp waits for an integral number of clock cycles until it goes high. RESTART INTERRUPTS (Input): These are used to interrupt the µp. These three inputs have the same timing as INTR except they cause an internal RESTART to be automatically inserted. All these have higher priority than INTR & can be masked with SIM instruction. RST 7.5- highest priority & edge triggered. RST 6.5- medium priority & level triggered. RST 5.5- lowest priority & level triggered.
19
TRAP (Input) This signal is used to interrupt the µp. It has the highest priority among all interrupts. When an interrupt is recognized the next instruction is executed from a fixed location in the memory. INTR (Input) This is a level triggered maskable Interrupt Request input signal. This is a general purpose interrupt with the lowest priority. When interrupt signal is given on this line, the µp executes interrupt acknowledge cycle to read information from interrupting device. During this program counter does not increment its contents. The INTR is enabled or disabled by software. ____ INTA (Output) It is Interrupt Acknowledgement. A low on this pin indicates that the processor has acknowledged an INTR interrupt.
20
S0, S1 (Output) These are status signals sent by µp to distinguish the various operations & type of memory or I/O cycle in process. Status code for Intel’s 8085 __ IO/ M (Output) It is a status signal indicating whether the address bus is for I/O device for memory. When it goes high, the address on the address bus referring I/O device & when it goes low, the address on the address bus referring memory. It is tri-stated during HOLD & HALT
21
SID (Input) Serial Input Data. It is a data line for serial input. The data on this line is loaded into 7th bit of accumulator when a RIM instruction is executed. SOD (Output) Serial Output Data. It is a data line for serial output. The 7th bit of accumulator is outputted on SOD line when SIM instruction is executed. The SOD line eliminates the need for an output port in the software-controlled serial I/O. X1, X2 (Input) Crystal or R/C network connections to set the internal clock generator. X1 can also be an external clock input instead of a crystal. The input frequency is divided by 2 to give the internal operating frequency.
22
CLK (Output) Used as a system clock when a crystal or R/ C network is used as an input to the CPU. The period of CLK is twice the X1, X2 input period. VCC +5 volt supply. VSS Ground reference.
24
Multiplexed address/data bus in microprocessor 8085.
µp 8085 has 8-bit data bus & 16 bit address bus. The least significant 8 bits of address bus are carried on the same 8 lines as that of data bus. In other words, data & lower order address share the same bus lines i.e., AD7 – AD0. These shared lines are bidirectional. They are used for dual purpose, for lower order address & 8-bit data. This is called multiplexing & such a bus is called multiplexed bus. In executing an instruction, during earlier part of cycle these lines are used as the lower order address bus. During later part of the cycle, these lines are used as data bus. The 8085 has a special signal called ALE (Address Latch Enable) for informing the peripheral when address /data bus is sending address & when it is working as data bus. If signal ALE is high (logic 1), then bits on are address bits & if ALE is low (logic 0), they are data bits.
26
MAIN PROGRAM ISR Statement 1 Statement 2 Statement 3 Interrupt
27
Interrupts An interrupt is a subroutine called & initiated by external device (hardware interrupt) or microprocessor itself (software interrupt). It is a signal, which suspends the normal sequence of microprocessor & then µp gives service to that device which has given this signal. After completing the service the µp again returns to the main program. µp is connected to different peripheral devices & to communicate with them µp 8085 uses interrupt method. An interrupt is an input signal which transfers control to specific routine called Interrupt Service Routine (ISR). After executing ISR the control is again transferred to the main program. µp 8085 has two types of interrupts: (i) Software interrupt (ii) Hardware interrupt The software interrupt has more priority than any hardware interrupt. Software interrupts are not requested by external peripheral devices. All software interrupts are non-maskable. Some hardware interrupts are maskable.
28
Interrupts Software interrupts Hardware interrupts Reset Interrupts
RST H RST H RST H RST H RST H RST H RST H RST H Hardware interrupts (Nonmaskable) TRAP H Reset Interrupts RST C H RST H RST C H INTR
29
Hardware Interrupts Software Interrupts
Used to handle asynchronous events Cannot be used to handle asynchronous events Requested by external device Requested by microprocessor itself through program. After execution of these interrupts program counter is not incremented After execution of these interrupts program counter is incremented Some hardware interrupts are maskable All software interrupts are nonmaskable Lower priority than software interrupts Higher priority than hardware interrupts Improves throughput of the system Does not improve throughput of the system Affect interrupt control logic Does not affect interrupt control logic Microprocessor executes interrupt acknowledge cycle to acknowledge this interrupt Microprocessor does not execute any interrupt acknowledge cycle, & only normal machine cycle is executed Eg. TRAP, RST 7.5, RST 6.5, RST 5.5, INTR, Eg. RST1, RST2, RST3, RST4, RST5, RST6, RST7,
30
Nonmaskable Interrupts
Can be masked or made pending Cannot be masked or made pending They cannot disable any nonmaskable interrupt They can disable maskable interrupts. Lower priority than nonmaskable interrupts Higher priority than maskable interrupts May be vectored or non vectored All are vectored Response time is high Response time is low Used to interface with peripheral devices Used for emergency purpose. For eg. Power failure, smoke detector etc. Eg. RST 7.5, RST 6.5, RST 5.5, INTR Eg. RST1, RST2, RST3, RST4, RST5, RST6, RST7, TRAP
31
ALU Status Register Temporary Register Binary Adder Internal CPU bus Shifter Accumulator ALU is an 8-bit unit Performs arithmetic, logic & rotate operations (addition, subtraction, increment) It has binary adder to perform addition & subtraction using 2’s complement method Accumulator, temporary register & flag register are closely associated with ALU Result is stored in accumulator Temporary register is used to hold data during arithmetic logic operation Status or flag register has flip flops which are set or reset according to result of operation
33
Shifter performs rotate left, rotate right operation .
Adder performs arithmetic operations like addition, subtraction, increment, decrement etc.
34
Secondary accumulators or data counters
Primary Accumulator Program status word PSW (8) A (8) B (8) C (8) D (8) E (8) H (8) L (8) SP (16) PC (16) Secondary accumulators or data counters Stack pointer Program counter The MPU 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 contain two more 16-bit registers
35
Accumulator : 8-bit register, used to perform arithmetic logical operations where one of the operand is always stored in accumulator It can be used as both source as well as destination register. Data transfer between CPU & I/O devices are performed through accumulator General purpose registers (Data counters) : B, C, D, E. H, L can be used as 8-bit registers or BC, DE, HL can be used as 16-bit register pairs HL register pair can be used for address pointing A few instructions use BC, DE as address pointers but they normally are used as general purpose data registers When used as 16-bit register pairs most significant 8 bits are stored in B or D or H & corresponding least significant 8 bits are stored in C or E or L respectively Temporary register : It is used to store data during execution of arithmetic & logical operation This register is not available to user
36
Flag Register : 8-bit register, consisting of 8 flags (each flag being a single bit register). Only 5 flags are used remaining 3 are unused. Flags are set or reset according to result generated by ALU. Flags are important as they are conditions for conditional branching (Jump) instructions. D D D D D D D D0 S – Sign flag, Z – Zero flag, AC – Auxiliary Carry flag, P – Parity flag, CY – Carry flag Bit Numbers S Z - AC P CY Status Flags
37
Sign flag (S): After performing any arithmetic logic operation if MSB of the result is 1, S=1 (Set), if MSB of the result is 0, S=0 (Reset). This flag is used with signed numbers. If S=0 the number is unsigned (positive), if S=1 the number is signed (negative) Zero flag (Z): After performing any arithmetic logic operation if the result is zero, Z=1 (Set)& if the result is nonzero, Z=0 (Reset). Auxiliary Carry flag (AC): In any arithmetic operation if carry is generated from bit D3 to D4, AC=1 (Set) otherwise AC=0 (Reset). This flag is not available to programmer. Parity flag (P): If result stored in accumulator contains even number of 1’s, P=1(Set) & if it contains odd number of 1’s, P=0 (Reset). Even parity P=1, Odd parity P=0. Carry flag (CY): In any arithmetic operation if carry is generated from MSB (bit D7) then CY=1 otherwise CY=0. In subtraction carry flag serves as borrow flag
38
Stack Pointer: 16-bit register, it contains memory address of last byte entered in stack It is decremented each time data is pushed on stack & incremented each time data is popped off the stack. Program Counter : 16-bit register, it acts as a pointer to next executable instruction. It contains address of memory location of next executable instruction. This register helps to sequence the execution of instruction. When a particular instruction is fetched, the program counter is incremented automatically by microprocessor. Incrementer/Decrementer : 16-bit special purpose register. This register is used to add or subtract 1 from the content of program counter or stack pointer.
39
Instruction register :
8-bit register. During an instruction fetch, the first byte of instruction ( opcode) is transferred to instruction register Its contents are in turn available to instruction decoder. Instruction decoder : Decodes the contents of instruction register. Its output is given to timing & control unit, which in turn controls the registers, ALU & address/data buffers. Output of decoder & internal clock generator produce T-state, instruction cycle & hence machine cycle signals. Interrupt control : Sends & controls hardware interrupt signals. Gives interrupt acknowledgement signal after receiving a hardware interrupt.
40
Serial I/O control : Most I/O devices work with serial data transmission. This has two pins for serial transmission, SID (serial input data) & SOD (serial output data). RIM instruction transfer data from SID to 7th bit of accumulator. SIM instruction transfer data from 7th bit of accumulator to SOD. Multiplexed Address/Data bus buffer : 8-bit, bidirectional buffer. Used to drive multiplexed address/data bus (lower order address bus + data bus) The address buffers can drive external address while data buffers can drive external data. Also used to tri-state the multiplexed bus under conditions like halt, hold, reset etc., when bus is not in use.
41
Interrupt acknowledge
Status Signals Machine Cycle Status IO/M S1 S2 1 Memory write Memory read I/O write I/O read Opcode fetch Interrupt acknowledge floating Halt - Hold Reset
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.