Course Name-Microprocessor
Course Code-COM-503
Lecture No-1
Topic – Basics of Microprocessor 8085
Model Institute of
Engineering & Technology
Course Outcomes
Course Description Mapping with Program
Outcomes Outcomes and Program
Specific Outcomes
CO1 Characterise and predict the effects of the properties PO[1,2,6,10,12]
PSO[1]
of the bus on the overall performance of a system.
CO2 Analyse, design, specify and test various assembly PO[1,2,3, 4,5,6,9,12]
PSO[1,2]
language programs of moderate complexity.
CO3 Understand and articulate the interfacing of memory PO[3,,4,5,6,8,9,10,]
PSO[1,2]
and various I/O devices with 8085 microprocessor.
CO4 Classify the instruction set of 8085 microprocessor PO[1,3,5,7,10]
PSO[1,2]
and distinguish the use of different instructions and
apply them in assembly level programming.
CO5 To learn the design aspects of 8086 microprocessor PO[1,2,,7,10]
PSO[1,2]
and its programming structure
Course Outcome 1-Delivery Plan
Course Topics Blooms Taxonomy
Outcomes
Basics of a Microprocessor Remembering
8085 Architecture Understanding
8085 Bus structure Remembering
CO1
8085 Internal structure Understanding
8085 Functional Block diagram Understanding
Outcomes of Today’s Lecture
• To study the basic concepts of a microprocessor.
• To study the internal structure of 8085 and its architecture in detail.
• To study the functional block diagram of 8085.
Difference between Microcomputer, Microprocessor and
Microcontroller
• Microcomputer: a computer with a microprocessor
as its CPU. Includes memory, I/O etc.
• Microprocessor: silicon chip which includes ALU,
register circuits & control circuits
• Microcontroller: silicon chip which includes
microprocessor, memory & I/O in a single
package.
Microprocessors
• 8085 is pronounced as "eighty-eighty-five" microprocessor.
• It is an 8-bit microprocessor designed by Intel in 1977 using
NMOS technology.
• It is a 40 pin I.C. package fabricated on a single LSI chip.
• The Intel 8085 uses a single +5V d.c. supply for its
operation
• Its clock speed is about 3.2 MHz
• The clock cycle is of 320 ns.
• It has 80 basic instructions and 256 opcodes
Microprocessors
• The word comes from the combination micro and processor.
• Processor means a device that processes whatever.
• In this context processor means a device that processes numbers,
specifically binary numbers, 0’s and 1’s.
• To process means to manipulate.
• The microprocessor is a programmable device that takes in
numbers, performs on them arithmetic or logical operations
according to the program stored in memory and then produces
other numbers as a result.
Microprocessors
• Programmable device: The microprocessor can
perform different sets of operations on the data it
receives depending on the sequence of instructions
supplied in the given program. By changing the
program, the microprocessor manipulates the data
in different ways.
• Instructions: Each microprocessor is designed to
execute a specific group of operations. This group
of operations is called an instruction set. This
instruction set defines what the microprocessor
can and cannot do.
A Microprocessor-based system
• The following block diagram represents a
microprocessor-based system:
Organization of a microprocessor-based system
Topic 1-Processor System Architecture
The typical processor system consists of:
▪ CPU (central processing unit)
▪ ALU (arithmetic-logic unit)
▪ Control Logic
▪ Registers, etc…
▪ Memory
▪ Input / Output interfaces
Interconnections between these units:
▪ Address Bus
▪ Data Bus
▪ Control Bus
Organization of a microprocessor-based system
• Memory stores information such as instructions and data in
binary format (0 and 1). It provides this information to the
microprocessor whenever it is needed.
• Usually, there is a memory “sub-system” in a
microprocessor-based system. This sub-system includes:
• The registers inside the microprocessor
• Read Only Memory (ROM) used to store information
that does not change.
• Random Access Memory (RAM) (also known as
Read/Write Memory) used to store information
supplied by the user. Such as programs and data.
Bus and CPU
Bus: A shared group of wires used for communicating signals among
devices
• address bus: the device and the location within the device that is
being accessed
• data bus: the data value being communicated
• control bus: describes the action on the address and data buses
CPU: Core of the processor, where instructions are executed
• High-level language: a = b + c
• Assembly language: add r1 r2 r3
• Machine language: 0001001010111010101
Memory and I/O
Memory: Where instructions (programs) and data are stored.
• Organized in arrays of locations (addresses), each storing one byte (8
bits) in general
• A read operation to a particular location always returns the last
value stored in that location
I/O devices: Enable system to interact with the world
• Device interface (a.k.a. controller or adapter) hardware connects
actual device to bus
• The CPU views the I/O device registers just like memory that can
be accessed over the bus. However, I/O registers are connected to
external wires, device control logic, etc.
• Reads may not return last value written
• Writes may have side effects
The 8085 Bus Structure
Address Bus
▪ Consists of 16 address lines: A0 – A15
▪ Operates in unidirectional mode: The address bits are always sent
from the MPU to peripheral devices, not reverse.
▪ 16 address lines are capable of addressing a
total of 216 = 65,536 (64k) memory locations.
▪ Address locations: 0000 (hex) – FFFF (hex)
The 8085 Bus Structure
Data Bus
▪ Consists of 8 data lines: D0 – D7
▪ Operates in bidirectional mode: The data bits are sent from the
MPU to peripheral devices, as well as from the peripheral devices to
the MPU.
▪ Data range: 00 (hex) – FF (hex)
Control Bus
▪ Consists of various lines carrying the control signals such as read /
write enable, flag bits.
The 8085: CPU Internal Structure
The internal architecture of the 8085 CPU is capable of performing the
following operations:
▪ Store 8-bit data (Registers, Accumulator)
▪ Perform arithmetic and logic operations (ALU)
▪ Test for conditions (IF / THEN)
▪ Sequence the execution of instructions
▪ Store temporary data in RAM during execution
8085 Architecture
Microprocessor - 8085
Architecture
1.Accumulator
2. Arithmetic and Logic Unit
3. General-purpose register
4. Program counter
5. Stack pointer
6. Temporary register
7. Flag register
8. Instruction register and decoder
9. Timing and control unit
10. Serial Input/output control
11. Interrupt Control
12. Address buffer and address-data buffer
13. Address bus and data bus
The 8085: Registers
The 8085: CPU Internal Structure
Registers
▪ Six general purpose 8-bit registers: B, C, D, E, H, L
▪ They can also be combined as register pairs to
perform 16-bit operations: BC, DE, HL
▪ Registers are programmable (data load, move, etc.)
Accumulator
▪ Single 8-bit register that is part of the ALU !
▪ Used for arithmetic / logic operations – the result is always
stored in the accumulator
The 8085: CPU Internal Structure
Flag Bits
▪ Indicate the result of condition tests.
▪ Carry, Zero, Sign, Parity, etc.
▪ Conditional operations (IF / THEN) are executed based on the
condition of these flag bits.
Program Counter (PC)
▪ Contains the memory address (16 bits) of the instruction that will
be executed in the next step
8085
• Arithmetic and logic unit: As the name suggests, it performs
arithmetic and logical operations on 8-bit data.
i. Addition
ii. Subtraction
iii. Logical AND
iv. Logical OR
v. Logical EXCLUSIVE OR
vi. Complement (logical NOT)
vii. Increment (add 1)
viii. Decrement (Subtract 1)
ix. Left shift, Rotate left, Rotate Right, etc.
8085
Set of Registers: The fig. shows the various registers of Intel 8085 which are
used by the microprocessor for temporary storage and manipulation of data
and instructions.
• Intel 8085 microprocessor has the following registers:
i. One 8-bit Accumulator (ACC) i.e register A
ii. Six 8-bit general purpose registers. These are B, C, D, E, H & L
iii. One 16-bit stack pointer, SP
iv. One 16-bit program Counter, PC
v. Instruction register
vi. Temporary register
In addition to the above mentioned register the 8085 microprocessor contains
a set of five flip-flops which serve as flag (or status flags). A flag is a flip-flop
which indicates some condition which arises after execution of an arithmetic
or logical instruction.
8085
8085 consists of the following functional units:
• Accumulator: The accumulator (register A) is an 8-bit
register associated with ALU.
• It is used to hold one of the operands of an arithmetic or
logical operation.
• It serves as one input to the ALU.
• The other operand for an arithmetic or logical operation
may be stored either in the memory or in one of the general
purpose registers.
• Final result of an arithmetic or logical operation is placed in
the accumulator.
8085
• General purpose register: The 8085 microprocessor contains
six 8-bit general purpose registers. They are B, C, D, E, H and
L.
• To hold 16-bit data a combination of two 8-bit registers can
be employed which known as register pairs.
• The valid register pairs in 8051 are B-C, D-E and H-L. the
programmer cannot form the register pair by selecting any
two registers of his choice.
• The H-L pair is used to act as memory pointer and for this
purpose it holds the 16- bit address of a memory location.
• The general purpose registers and the accumulator are
accessible to programmer. He can store data in these
registers during writing his program.
8085
Program counter: It is a 16-bit special purpose register used to hold
the memory address of the next instruction which is to be executed.
• It keeps the track of memory addresses of the instructions in the
program while they are being executed.
• The microprocessor increments the content of the program
counter during the execution of an instruction so that it points to
the address of the next instruction in the program at the end of
the execution of an instruction.
8085
Stack pointer: It is a 16-bit special purpose register.
• “Stack is a sequence of memory location set aside by the programmer to
store/retrieve the content of accumulator, flags, program counter and general
purpose registers during the execution of a program.
• Any portion of the memory can be used as stack. Since the stack works on
LIFO (last in first out) principle, its operation is faster compared normal store/
retrieve of memory locations.
• “The SP holds the address of the top element of data stored in the stack.
• “The stack is defined and stack pointer is initialized by the programmer at the
beginning of a program which needs stack operation. Stack is also used by the
microprocessor. For example, it stores the contents of program counter when it
jumps to a subroutine using CALL instruction.
• Temporary register: It is an 8-bit register, which holds the temporary data of
arithmetic and logical operations.
• Flag register: It is an 8-bit register having five 1-bit flip-flops, which holds
either 0 or 1 depending upon the result stored in the accumulator.
8085
Instruction Register: It is an 8-bit register. When an instruction is
fetched from memory then it is stored in the Instruction register.
Instruction decoder decodes the information present in the Instruction
register.
Temporary Register: It is an 8-bit register associated with ALU. It holds
data during an arithmetic/logical operation.
• It is used by microprocessor.
• It is not accessible to programmer.
Flag register: It is an 8-bit register having five 1-bit flip-flops, which
holds either 0 or 1 depending upon the result stored in the accumulator.
8085
• These are the set of 5 flip-flops −
• Sign (S)
• Zero (Z)
• Auxiliary Carry (AC)
• Parity (P)
• Carry (C)
Its bit position is shown in the following table −
8085
Carry Flag (CS):
• After execution of an arithmetic instruction if carry is
produced, the carry flag CS is set to 1. Otherwise it is 0.
• The carry flag is set or reset in case of addition as well as
subtraction.
• After the addition of two 8-bit numbers, if the sum is
larger than 8-bits, a carry is produce; and the carry flag is
set to 1.
• In case of subtraction, if borrow occurs, the carry flag is set
to 1.
• The carry flag holds carry out of the most significant bit
resulting from the execution of an arithmetic operation.
8085
Parity Flag (P): The parity flag P is set to 1, if the result of an
arithmetic or logical operation contains even number of 1s.
• It is reset i.e it is 0, if the result contains odd number of 1s.
Auxiliary Carry Flag (AC): The auxiliary carry flag AC hold carry
out of the bit number 3 to the bit number 4 resulting from the
execution of an arithmetic operation.
• The counting of bits starts from 0, and hence Bit No.3 is actually
the fourth bit from the least significant bit.
8085
Zero Flag (Z): The zero status flag Z is set to 1, if the result of an
arithmetic or logical operation is Zero otherwise it is set to 0.
Sign Flag (S): The sign flag S is set to 1, if the result of an arithmetic or
logical operation is negative. If the result is positive, the sign flag is set to
0.
• The sign flag has significance only when signed arithmetic operation
is performed. To represent a signed numbed the most significant bit is
reserved by the programmer to represent the sign of a number.
• In other words, the MSB is used as a sign bit.
• If the number is negative, the sign bit is 1. For positive, sign bit is 0.
• In case of 8-bit sign operation, the remaining 7 bits are used to
represent the magnitude of a number.
8085
Timing and control unit: It generates timing & control signals which are
necessary for the execution of instructions.
• It controls data flow between CPU and peripherals including memory.
• It provides status, control and timing signals which are required for the
operation of memory and I/O devices.
• It controls entire operations of the microprocessor and peripherals
connected to it.
• Thus it is seen that the control unit of the CPU acts as the brain of the
computer system.
• Following are the timing and control signals, which control external and
internal circuits −
• Control Signals: READY, RD’, WR’, ALE
• Status Signals: S0, S1, IO/M’
• DMA Signals: HOLD, HLDA
• RESET Signals: RESET IN, RESET OUT
8085
• Interrupt control: As the name suggests it
controls the interrupts during a process. When a
microprocessor is executing a main program and
whenever an interrupt occurs, the microprocessor
shifts the control from the main program to
process the incoming request. After the request is
completed, the control goes back to the main
program.
• There are 5 interrupt signals in 8085
microprocessor: INTR, RST 7.5, RST 6.5, RST 5.5,
TRAP.
8085
• Serial Input/output control: It controls the serial data
communication by using these two instructions: SID (Serial
input data) and SOD (Serial output data). :
• Address buffer and address-data buffer: The content stored in
the stack pointer and program counter is loaded into the address
buffer and address-data buffer to communicate with the CPU.
The memory and I/O chips are connected to these buses; the
CPU can exchange the desired data with the memory and I/O
chips.
• Address bus and data bus: Data bus carries the data to be
stored. It is bidirectional, whereas address bus carries the
location to where it should be stored and it is unidirectional. It is
used to transfer the data & Address I/O devices.
8085 Microprocessor Architecture
The 8085 Bus Structure
The 8-bit 8085 CPU (or MPU – Micro Processing Unit) communicates
with the other units using a 16-bit address bus, an 8-bit data bus and a
control bus.
The 8085: CPU Internal Structure
SUMMARY
• To summarize, we have studied
• The basic building blocks of a microprocessor.
• The internal architecture of 8085 and its functional diagram.
• The bus structure of 8085 and its register organization.
University Questions.
• Draw and explain the functional block diagram of 8085 with each unit.
• Explain the register organization of 8085. Also draw and explain the flag
register in detail.
Home Assignment
• Explain the bus structure of 8085 with reference to the three buses of
8085.
Thank You