Вы находитесь на странице: 1из 29

MICROPROCESSOR 8085

Subject Code: BCA1024E07

Reference Book:Ramesh S. Goankar,


“Microprocessor Architecture, Programming and
Applications with 8085”, 5thEdition, Prentice Hall
Unit-1
⚫ Contents
⚫ Introduction of Microcomputer System: CPU, I/O devices,
clock, memory, bussed architecture, tristate logic, address
bus, data bus and control bus;
⚫ Architecture of 8-bit Microprocessor: Intel 8085A
microprocessor, Pin description and internal architecture;
⚫ Operation and Control of Microprocessor: Timing and
control unit, op-code fetch machine cycle, memory read/
write machine cycles, I/O read/write machine cycles,
interrupt acknowledge machine cycle, state transition
diagram.
Basic Concepts of Microprocessors
⚫ Microprocessor is the brain of computer, which
does all the work. It is a computer processor that
incorporates all the functions of CPU (Central
Processing Unit) on a single IC (Integrated Circuit) or
at the most a few ICs. Microprocessors were first
introduced in early 1970s. 4004 was the first general
purpose microprocessor used by Intel in building
personal computers. Arrival of low cost general
purpose microprocessors has been instrumental in
development of modern society the way it has.
What is a Microprocessor?
▪ 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.
▪ It is a general term that describes all
manipulation. Again in this content, it means to
perform certain operations on the numbers that
depend on the microprocessor’s design.
What about micro?
▪ Micro is a new addition. In the late 1960’s, processors
were built using discrete elements. These devices
performed the required operation, but were too large
and too slow.
▪ In the early 1970’s the microchip was invented. All of
the components that made up the processor were now
placed on a single piece of silicon. The size became
several thousand times smaller and the speed became
several hundred times faster. The “Micro" Processor
was born.
Definition of the Microprocessor
⚫ A microprocessor is an integrated circuit (IC) which incorporates core
functions of a computer’s central processing unit (CPU). It is a
programmable multipurpose silicon chip, clock driven, register based,
accepts binary data as input and provides output after processing it as
per the instructions stored in the memory

Block Diagram of Computer


How does a Microprocessor work ?
⚫ The microprocessor follows a sequence: Fetch,
Decode, and then Execute.
⚫ Initially, the instructions are stored in the memory in
sequential order. The microprocessor fetches those
instructions from the memory, then decodes it and
executes those instructions till STOP instruction is
reached. Later, it sends the result in binary to the
output port. Between these processes, the register
stores the temporary data andALU performs the
computing functions.
List of Terms Used in a Microprocessor
⚫ Instruction Set − It is the set of instructions that the microprocessor can understand.
So instruction set is an interface between hardware and software (program). An
instruction commands the processor to switch relevant transistors for doing some
processing in data. For eg. ADD A, B; is used to add two numbers stored in the register
A and B.

⚫ Bandwidth − It is the number of bits processed in a single instruction.

⚫ Clock speed − It determines the number of operations per second the processor can
perform. It is expressed in megahertz (MHz) or gigahertz (GHz). It is also known as
Clock Rate.

⚫ Word Length − It depends upon the width of the internal data bus, registers, ALU, etc.
An 8-bit microprocessor can process 8-bit data at a time. The word length ranges from
4 bits to 64 bits depending upon the type of the microcomputer.

⚫ Data Types − The microprocessor has multiple data type formats like binary, BCD,
ASCII, signed and unsigned numbers.
⚫ Bus:-This is a collection of wires (often 4, 8, 16, 32, 64 or 128). These
wires are used to interconnect all the devices within a computer. This
approach greatly reduces the complexity and amount of wiring
needed. Many devices share the same bus instead of each device
having its own wiring. To make this work, tristate logic is needed

⚫ A bus is a set of conductors intended to transmit data, address or


control information to different elements in a microprocessor.
Usually a microprocessor will have 3 types of buses : Data Bus,
Control Bus and Address Bus. An 8-bit processor will be using 8-bit
wide bus.

⚫ A binary digit is called a bit.

⚫ The microprocessor recognizes and processes a group of bits together.


This group of bits is called a “word”.
Data bus and address bus
• A data bus is a system within a computer or
device, consisting of a connector or set of wires,
that provides transportation for data. A data
bus is also called a processor bus, front
side bus, front side bus or backside bus—is a
group of electrical wires used to send
information (data) between two or more
components.
• An address bus is a computer bus architecture.
It is used to transfer data between devices. The
devices are identified by the
hardware address of the physical memory (the
physical address). The address is stored in the
form of binary numbers to enable the
data bus to access memory storage.
⚫ A control bus is a computer bus that is used by the
CPU to communicate with devices that are contained
within the computer. This occurs through physical
connections such as cables or printed circuits.
Tristate Logic(3 state/three state)
⚫ allows two or more devices to share/write to the same bus line.
⚫ has three output states: Zero, One and pin Disconnected (high
impedance).
⚫ has a control line usually called enable or chip enable. This
makes the output active.
⚫ responds to one unique address provided on the address bus.
This could be a memory location or an I/O location.
⚫ There is a control bus line that selects memory mapping or I/O
mapping allowing the same addresses to be used for either.
This still guarantees that one and only one device is ever active.
⚫ Table Of Tristate 0 0 HI-
Z
0 1 Hi-
Z
1 0 1
1 1 0
Words, Bytes?
⚫ The earliest microprocessor (the Intel 8088 and
Motorola’s 6800) recognized 8-bit words. They
processed information 8-bits at a time. That’s why they are
called “8-bit processors”. They can handle large numbers,
but in order to process these numbers, they broke them
into 8-bit pieces and processed each group of 8-bits
separately.
⚫ Later microprocessors (8086 and 68000) were designed
with 16-bit words. A group of 8-bits were referred to as a “half-word”
or “byte”.
⚫ A group of 4 bits is called a “nibble”.
⚫ Also, 32 bit groups were given the name “long word”.
⚫ Today, all processors manipulate at least 32 bits at a
time and there exists microprocessors that can
process 64, 80, 128 bits
what is memory
⚫ Memory is the location where information is kept while not
in current use.
⚫ Memory is a collection of storage devices. Usually, each
storage device holds one bit. Also, in most kinds of memory,
these storage devices are grouped into groups of 8. These 8
storage locations can only be accessed together. So, one can
only read or write in terms of bytes to and form memory.
⚫ Memory is usually measured by the number of bytes it can
hold. It is measured in Kilos, Megas and lately Gigas. A Kilo
in computer language is 2 =1024. So, a KB (KiloByte) is 1024
10

bytes. Mega is 1024 Kilos and Giga is 1024 Mega


Machine Language
⚫ machine language is a collection of binary digits or bits that
the computer reads and interprets. Machine language is the
only language a computer is capable of understanding.
⚫ The number of bits that form the “word” of a
microprocessor is fixed for that particular processor.
These bits define a maximum number of combinations. For example
an 8-bit microprocessor can have at most 2 8 = 256 different combinations.
⚫ However, in most microprocessors, not all of these
combinations are used. Certain patterns are chosen and
assigned specific meanings.
⚫ Each of these patterns forms an instruction for the
microprocessor.
⚫ The complete set of patterns makes up the
The 8085 Machine Language
⚫ The 8085 (from Intel) is an 8-bit
microprocessor. The 8085 uses a total of 246
bit patterns to form its instruction set.
⚫ These 246 patterns represent only 74
instructions. The reason for the difference is that
some (actually most) instructions have multiple
different formats.

⚫ Because it is very difficult to enter the bit


patterns correctly, they are usually entered in
hexadecimal instead of binary. For example, the
combination 0011 1100 which translates into
“increment the number in the register called the
accumulator”, is usually entered as 3C.
Assembly Language
⚫ often abbreviated asm, is any low-level programming
language in which there is a very strong correspondence
between the instructions in the language and
the architecture's machine code instructions.
⚫ A microprocessor executes instructions given by the user
⚫ Instructions should be in a language known to the
microprocessor
⚫ Microprocessor understands the language of 0’s and 1’s
only This language is called Machine Language
⚫ For e.g. 01001111
⚫ Is a valid machine language instruction of 8085
⚫ It copies the contents of one of the internal registers of
8085 to another instruction on Assembly language.
Overview: 8085 Programming
model
1. general-purpose Registers and special Register
2. Accumulator Register
3. Flag Register
4. Program Counter Register
5. Stack Pointer Register
1. Six general-purpose registers
⚫ B, C, D, E, H, L(it work on 8 bit microprocessor)
⚫ –Can be combined as register pairs to perform 16-bit
operations (BC, DE, HL).H & L can be used as a data
pointer (holds memory address)

2. Special Purpose Registers


Accumulator – identified by name A
⚫ 8-bit data storage
⚫ Performs arithmetic and logical operations
⚫ Result of an operation is stored in accumulator.
⚫ Store 8 bit data during I/O transfer
3. Flag Register
⚫ 8 bit register –shows the status of the microprocessor before/after an
operation
[1]S (sign flag) :- The sign flag is set if negative (1 –negative) or (0
–positive).

[2]Z (zero flag) :- It is set if result obtained after an operation is 0. IT is


set following an increment or decrement operation of that register
10110011
+ 01001101
---------------
1 00000000
[3] Auxiliary Carry flag (AC)
⚫ These flags are five flip-flops in flag register Execution of an
arithmetic/logic operation can set or reset these flags
⚫ Condition of flags (set or reset) can be tested through software
instructions 8085 uses these flags in decision-making process.
[4]Carry Flag :- It Is set if there is a carry or borrow from arithmetic
operation.
[5]Parity Flag :-
⚫ Is set if parity is even
⚫ Is cleared if parity is odd
4. Program Counter (PC)
⚫ This is a register that is used to control the sequencing of
the execution of instructions.
⚫ This register always holds the address of the next
instruction.
⚫ Since it holds an address, it must be 16 bits wide.

5. Stack Pointer Register


– a 16-bit memory pointer register
– Points to a location in Stack memory
– Beginning of the stack is defined by loading 16-bit address
in stack pointer register
⚫ It uses English like words to convey the action/meaning
called as MNEMONICS.
⚫ For e.g.
Its mnemonic is: “INR A”.
INR stands for “increment register” and A is short for accumulator.
⚫ Another example is: 1000 0000,Which translates to 80 in hexadecimal.

⚫ Its mnemonic is “ADD B”.


“Add register B to the accumulator and keep the result in the
accumulator”.
Instruction Set of 8085
⚫ Consists of
– 74 operation codes, e.g. MOV,ADD,SUB,DIV
– 246 Instructions, e.g. MOV A,B
• 8085 instructions can be classified as
1. Data Transfer (Copy)
2. Arithmetic
3. Logical and Bit manipulation
4. Branch
5. Machine Control
1. Data Transfer (Copy) Operations
⚫ Load a 8-bit number in a Register
⚫ Copy from Register to Register
⚫ Copy between Register and Memory
⚫ Copy between Input/output Port and Accumulator
⚫ Load a 16-bit number in a Register pair
⚫ Copy between Register pair and Stack memory
2. Arithmetic Operations
⚫ Addition of two 8-bit numbers
⚫ Subtraction of two 8-bit numbers
⚫ Increment/ Decrement a 8-bit number
3. Logical & Bit Manipulation Operations
1. AND two 8-bit numbers
2. OR two 8-bit numbers
3. Exclusive-OR two 8-bit numbers
4. Compare two 8-bit numbers
5. Complement
6. Rotate Left/Right Accumulator bits
4. Branching Operations
⚫ These operations are used to control the flow of program execution
1.Jumps
• Conditional jumps
• Unconditional jumps
2.Call & Return
• Conditional Call & Return
• Unconditional Call & Return
5. Machine Control Instructions
⚫ These instructions affect the operation of the processor. For e.g.
⚫ HLT Stop program execution
⚫ NOP Do not perform any operation
Includes Opcode and Operand in
the same byte
⚫ Mnemonic:
⚫ Operand
⚫ Opecode
⚫ Register
⚫ MVI
⚫ MOV
⚫ LDA
Basic Instruction of 8085 MP
[1]MOV: - This instruction is used to copy the data from one place to another.
Eg: - MOV Rd, Rs (This instruction copies the content of Rs to Rd)
MOV M,Rs (This instruction copies the content of register Rs to memory location pointed by HL
Register)
MOV Rd, M (This instruction copies the content of memory location pointed by the HL register
to the register Rd.)
[2]MVI : move immediate date to a register or memory location
⚫ MVI Rd, #30H (30h is stored in register Rd)
⚫ MVI M, #30H (30h is stored in memory location pointed by HL Reg).
[3] LDA: - Load accumulator. (this instruction copies the data from a given 16 bit address to the
accumulator)
[4]STA :store the data into Register
[5] In assembly language mnemonic form an opcode is a command such as MOV or ADD or JMP.
⚫ For example
⚫ MOV AL, 34h
⚫ The opcode is the MOV instruction. The other parts are called the 'operands'.
⚫ Operands are manipulated by the opcode. In this example, the operands are the register
named AL and the value 34 hex.
❖ Examples Of Microprocessor
⚫ Intel 4004 – The First Microprocessor
⚫ Intel 8085
⚫ Intel 8086
⚫ Intel Pentium 4
⚫ Intel Core i7
⚫ AMD Athlon

Вам также может понравиться