










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
its based on jnvu jodhpur syllabus
Typology: Thesis
1 / 18
This page cannot be seen from the preview
Don't miss anything!
Table of Contents
Chapter 4: Microprocessor 8085 architecture
3.1 Introduction 3.2 Block diagram of 8085 3.3 8085 system bus 3.4 8085 Pin description 3.5 Microprocessor operations
3.1 Introduction
Intel 8085 is the most popular 8-bit microprocessor. It is a 40-pin IC fabricated on a single VLSI chip. It requires a single +5V power supply. It has in-built clock generation, system control and interrupt circuitry. The 8085 μP is a programmable digital device which has got a set of instructions designed internally to manipulate the data and communicate with peripherals. The internal logic organization or design is called architecture of the μP. It is important to know the architecture because it is the internal architecture of a μP which determines as to what happens to the data inside the μP and how and what type of operations can be performed with the data.
3.2 Block diagram of 8085
To understand the architecture of 8085 μP it is necessary to discuss the block diagram. Fig. 3.1 below shows the block diagram of 8085 μP. It mainly consists of three sections
(a) Register unit (b) Arithmetic and logic unit (c) Timing and control unit
These important sections will be discussed in detail in the subsequent sections.
Register unit
The micro processor 8085 consists of different types of registers
(a) Accumulator (b) General purpose register (c) Flag register (d) Temporary register (e) Program counter (f) Stack pointer
Accumulator:
It is an 8-bit register which is used for performing all the arithmetic’s and logical operations. Accumulator is also known as ‘register A’. During any mathematical or logical operation one of the operands should be present in the accumulator. The final result is also stored in the accumulator.
General purpose registers:
There are six 8-bit general purpose registers B, C, D, E, H & L. General purpose registers are used for temporary storage of data and intermediate results while the processor is executing the program. Two eight bit registers can be combined for handling 16-bit data. Combination of two 8-bit registers is known as pair. Valid register pairs are B-C, D-E, H-L. The H-L pair is used to address memories.
Flag register:
It is an 8-bit register in which five flip flops are used for checking condition. These flip flops are called flags. Each of these flags can have the value either one or zero to indicate certain condition after arithmetic and and logical operation. The five flags present in 8085 μP are:
(a) Sign flag (b) Zero flag (c) Auxiliary carry flag (d) Parity flag (e) Carry flag
Sign flag (S): After the execution of an arithmetic or logical operation, if bit D 7 of the result is 1, the sign flag is set. This flag is used with signed numbers and has no relevance for unsigned numbers. In a given byte, if D 7 is 1, the number is said to be negative and if it is 0, the number is considered as positive.
Zero Flag (Z): This flag is set if the result after arithmetic or logical operation turns out to be zero and is reset if the result is non-zero.
Auxiliary carry (AC): This flag is set if in an arithmetic operation a carry is generated at bit D 3 and passed onto D 4. This flag is used internally for BCD operations and is not available to the user unlike other flags.
Parity (P): After an arithmetic or logical operation, if the result has an even number of 1s, the flag is set and if there is odd number of 1s the flag is reset.
Carry (CY): If an arithmetic operation results in a carry, the flag is set otherwise it is reset. It also serves as a borrow flag for subtraction.
The bit position reserved for these flags in the flag register are as follows:
S Z AC P CY
Temporary register:-
Register W and Z are known as temporary registers. They are used by the μP for storing the data temporarily during execution of a program. They are 8-bit registers and are not accessible to the user.
Program Counter:
It is a 16-bit register which holds the address of the instructions. Initially it indicates towards the starting address of the program but after the first instruction is fetched the program counter automatically gets incremented by one and points towards the next instruction. This process continues till the end of the program.
Stack pointer:
The stack pointer is a 16-bit register which basically serves two purposes
(a) Points towards the stack memory. Initially it indicates the beginning of the stack memory. Whenever something is added to the stack, the stack pointer is decremented and whenever something is removed from the stack the stack pointer is incremented. Hence the stack pointer always points to the top of the stack. (b) Stack pointer also points towards the memory location where the μP has to go after attending an interrupt or a subroutine; therefore it acts as a bookmark.
Arithmetic and logic unit:
This is the unit where all the arithmetic operations like addition, subtraction, multiplication and division and logical operations like AND, OR, Ex-OR, complement, compare etc. are performed. It includes the accumulator, the temporary register, the arithmetic and logic circuits and five flags. The temporary registers are used to store data temporarily during an arithmetic/logical operation. The result is stored in the accumulator and the flags are set or reset according to the result of the operation.
Timing and control unit:
The timing and control unit generates timing and control signals which are necessary for the execution of instruction. It controls data flow between CPU and peripherals. It provides status, control and timing signals which are required for the operation of memory and I/O devices.
3.3 8085 System Bus
System bus is basically a group of communication lines/wires that are responsible for transferring information between different units of the device or peripherals. A typical microprocessor communicates with memory and other devices using three buses: address bus, data bus and control bus.
Address bus: Address bus is a unidirectional group of 16 lines i.e. bits flow in one direction from the μP to the peripheral devices. The 8085 μP with it’s 16 address lines is capable of addressing 2^16 =65536 (64K) memory locations. Data bus: Data bus carries data in binary form, between microprocessor and peripheral devices as well as memory. It is a group of 8-bits and is bidirectional. Data bus also carries instructions from memory to the microprocessor. Size of the bus therefore limits the number of possible instructions. The 8085 μP has 246 bit patterns amounting to 74 different instructions. These 74 different instructions are therefore called its instruction set. 6
3.4 8085 Pin Description
Figure 3.2 Pin Configuration of 8085
The 8085 μP is an 8-bit microprocessor capable of addressing 64K of memory. It is a 40-pin IC which requires a power supply of +5V and it’s operating frequency is 3MHz. Fig. 3.3 shows the pin configuration of 8085 μP .The pin configuration of 8085 μP can be classified into six groups namely:
High order Address bus Multiplexed Address/Data bus
Control and status signals Power supply and frequency signals Externally initiated signals and Serial I/O ports
(1) High order address bus: The address bus is a group of 16-lines generally identified as A 0 -A 15. The address bus is split into two segments ADO-AD 7 and A 8 -A 15 .The buses from ADO-AD 7 are low order address buses and A 8 -A 15 buses are high order address buses.
(2) Multiplexed Address/Data bus:
The data bus is a group of 8-lines used for transfer of data. These lines are bidirectional i.e. data flows in both the directions from μP to peripherals and vice-versa. They are represented as ADO-AD 7 because they serve dual purpose. They are used as low-order address bus as well as data bus and therefore they are known as multiplexed address/data bus.
(3) Control and status signals:
This group of signals includes two control signals, three status signals and one special signal. These signals are as follows:
Control signal: - and ar the two control signals which indicate that the data is to be read from or written into a selected memory or I/O location. Both are active low signals.
Status signal: - , S 1 and SO are the three status signals. is used to differentiate between I/O and memory operations. When it is high it indicates I/O operation and when it is low it indicates memory operation. S 1 and S (^) O are also status signals but are rarely used in small systems.
Special signal: - ALE (Address Latch Enable) is a special signal used for demultiplexing address and data bus (ADO-AD 7 ). It is a positive going pulse generated every time a machine cycle begins and so long as it remains positive it indicates that the bits on ADO-AD 7 are address bits.
(4) Power supply and clock frequency:
The power supply required for 8085 μP is +5V. As shown in pinout diagram VCC is connected to +5V and VSS is connected to the ground of the power supply. The μP operates on frequency of 3MHz, therefore an oscillator of frequency 6MHz is connected between pin no. 1 and 2 as the frequency is internally divided by two. CLK (OUT) i.e. Pin no. 37 is used as a system clock for other devices.
(5) Externally initiated signals:
There are certain operations which can be initiated by external devices (or signals). For these externally initiated operations there are individual pins assigned on the
The process of data manipulation and communication with peripherals is determined by the logic design of the microprocessor. This logic design is called architecture. All the operations of microprocessor can be classified into following types:
(a) Microprocessor initiated operations (b) Internal operations (c) Peripheral or externally initiated operations
Microprocessor initiated operations
Microprocessor initiated operations are usually one of the following operations :
(a) Memory read: Reads data from memory. (b) Memory write: Writes data into the memory. (c) I/O Read: Accepts data from input devices. (d) I/O Write: Sends data to output devices
All these operations are initiated by microprocessor and executed by peripheral devices as a part of communication process between microprocessor and memory or
peripheral devices. To perform these communication operations, the MPU needs to perform following steps (a) Identify the memory location or the peripheral devices. (b) Provide synchronization signal i.e. timing signals. (c) Transfer the binary information (data and instruction).
All these functions are performed with the help of communication lines called system bus. The details of the three types of buses i.e. Address bus, data bus and control bus have been discussed in section 3.1.
Value addition:
Data flow between memory and MPU:
Figure below explains the flow of data between microprocessing unit and memory. First of all the 16-bit address is placed on the address bus from the program counter. In the figure it can be seen that the address is 2005H where the data is placed. The higher order address i.e. 20H is placed on the address bus A 8 -A 15 while the lower order address is placed on the multiplexed address and data bus ADO-AD 7. The lower order address continues to remain on this address bus so long as ALE (Address Latch Enable) remains positive. Once ALE goes low it carries data. The control unit sends the signal to indicate what type of operation is to be performed. Since the data is to be read from the memory therefore it sends to enable the memory chip. The byte from the memory location is then placed on the data bus i.e. 4F saved in location 2005H is placed on the data bus and sent to the instruction decoder. The instruction is decoded and accordingly the task is performed by the ALU i.e. Arithmetic and logic unit.
Internal data operations
These are the operations which are internally performed by the microprocessor. They are classified into five groups:
To perform these operations microprocessor requires registers, Arithmetic and logic unit, buses and control unit. To store 8-bit data microprocessor has six general purpose registers. During program execution, these registers are used to store 8- or 16-bit data. The details of these registers i.e. B, C, D, E, H and L have already been discussed in register unit. Arithmetic and logical operations are performed in accumulator and the conditions are tested by the flag register. Program counter is used to sequence the execution of instructions and stack memory is used for temporary storage of data during execution and stack pointer is used to address the stack memory.
Peripheral or Externally initiated operations
There are four externally initiated operations, for which individual pins on the microprocessor chip are assigned. These operations are RESET, READY, HOLD and INTERRUPT. The details of all these operations have been discussed in section 3.1.
Value addition:
8085 Programming Model:
A programming model is a conceptual representation of a real object and can be in the form of a text, a drawing or a built structure. Here is a programming model of 8085 which gives information required to write a program. It consists of some segments of ALU and the registers. This model includes six general purpose registers, accumulator, flag register, program counter and stack pointer. This model is not a reflection of physical structure of the microprocessor but gives all the information that is relevant for writing an assembly language program. Figure below shows the programming model specific to the 8085 microprocessor.
This chapter also explains the process of data flow between microprocessor and memory. The programming model which is very important to understand programming of microprocessor has also been discussed.
Microprocessor 8085 architecture
(^) VLSI: Very Large Scale Integration Technology: In this technology a million transistors are created on a single silicon chip. It was developed in 1980s. Accumulator: It is an eight bit register in which all the arithmetic and logical operations are performed. It is also known as register A. The final result is also stored in this register. Program counter: It is a 16- bit register which stores the address of the next instruction to be executed. It helps in sequencing the execution of instruction. Stack Pointer: It is a 16-bit register which stores the address of the stack memory. It also acts as a bookmark incase of in case of interrupt and call of a subroutine. Flag register: It is an 8- bit register in which only five bits are used for testing the various conditions like sign, carry, parity etc. Interrupt: It is an externally initiated signal which alters the sequence of execution by requesting the microprocessor to perform some task other than the program it is executing. Address bus: It is a group of lines used for sending address from the microprocessor to the memory or the peripherals. There are 16 address lines in 8085 microprocessor. This is a unidirectional bus Data bus: It ia group of lines used for transferring data between MPU and memory or peripherals. It is bidirectional. There are 8 address lines in 8085μP Control bus: The control bus is a combination of various single lines that carry control signals or synchronization signals. These control lines are not group of lines like address or data buses but individual lines that provide a signal to indicate μP operation. Assembly language: It is a language in which programs are written using mnemonics (instructions in simple English language).
An instruction is a binary pattern designed inside a microprocessor to perform a specific function. The entire group of instructions that a microprocessor supports is called Instruction Set. 8085 has 246 instructions. Each instruction is represented by an 8-bit binary value. These 8-bits of binary value is called Op-Code or Instruction Byte
Data Transfer Instruction Arithmetic Instructions Logical Instructions Branching Instructions Control Instructions
MOV Copy from source to destination MVI Move immediate 8-bit LDA Load accumulator LDAX Load accumulator indirect LXI Load register pair immediate LHLD Load H and L registers direct STA Store accumulator direct STAX Store accumulator indirect SHLD Store H and L registers direct XCHG Exchange H and L with D and E SPHL Copy H and L registers to the stack pointer XTHL Exchange H and L with top of stack PUSH Push register pair onto stack POP Pop of stack to register pair OUT Output data from accumulator to a port with 8 - bit address IN Input data to accumulator from a port with 8-bit address
ADD Add register or memory to accumulator ADC Add register to accumulator with carry ADI Add immediate to accumulator ACI Add immediate to accumulator with carry DAD Add register pair to H and L registers SUB Subtract register or memory from accumulator SBB Subtract source and borrow from accumulator SUI Subtract immediate from accumulator SBI Subtract immediate from accumulator with borrow INR Increment register or memory by 1 INX Increment register pair by 1 DCR Decrement register or memory by 1 DCX Decrement register pair by 1 DAA Decimal adjust accumulator
OPCODE : It is a number interpreted by your machine(virtual or silicon) that represents the operation to perform
BYTECODE : Same as machine code, except, its mostly used by a software based interpreter(like Java or CLR)
MNEMONIC : English word MNEMONIC means "A device such as a pattern of letters, ideas, or associations that assists in remembering something.". So, its usually used by assembly language programmers to remember the "OPERATIONS" a machine can do, like "ADD" and "MUL" and "MOV" etc. This is assembler specific.
MACHINE CODE : It is the sequence of numbers that flip the switches in the computer on and off to perform a certain job of work - such as addition of numbers, branching, multiplication, etc etc. This is purely machine specific and well documented by the implementers of the processor.
ASSEMBLY : There are two "assemblies" - one assembly program is a sequence of mnemonics and operands that are fed to an "assembler" which "assembles" the mnemonics and operands into executable machine code. Optionally a "linker" links the assemblies and produces an executable file.
ASSEMBLY LANGUAGE : -- a computer understands machine code -- people (and compilers) write assembly language
assembly ----------------- machine source --> | assembler | --> code code -----------------
an assembler is a program -- a very deterministic program it translates each instruction to its machine code. in the past, there was a one-to-one correspondence between assembly language instructions and machine language instructions. this is no longer the case. Assemblers are now-a-days made more powerful, and can "rework" code. The Pentium (being based on the 8086) has a one-to-one correspondence between assembly language instructions and machine language instructions. the assembler's job is to
assembler starts at the top of the source code program, and SCANS. It looks for -- directives (.data .code .stack .486, etc. ) -- instructions
Addition of two 8 bit numbers. MVI B, 06 //Load Register B with the Hex value 06 MOV A, B //Move the value in B to the Accumulator or register A MVI C, 07 //Load the Register C with the second number 07 ADD C //Add the content of the Accumulator to the Register C STA 8200 //Store the output at a memory location e.g. 8200 HLT //Stop the program execution