0% found this document useful (0 votes)
16 views

MP Module 1

The document discusses the architecture and operations of microprocessors, covering topics such as the 8085 microprocessor architecture and its internal components like registers and ALU. It also describes the different functions performed by a microprocessor like memory and I/O operations using address, data and control buses. The document further explains the internal data operations of a microprocessor and the different registers used for temporary data storage.

Uploaded by

Hari Murali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

MP Module 1

The document discusses the architecture and operations of microprocessors, covering topics such as the 8085 microprocessor architecture and its internal components like registers and ALU. It also describes the different functions performed by a microprocessor like memory and I/O operations using address, data and control buses. The document further explains the internal data operations of a microprocessor and the different registers used for temporary data storage.

Uploaded by

Hari Murali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

B.Sc.

COMPUTER SCIENCE
SEMESTER IV
Microprocessors
and
Assembly Language Programming (CS4CRT11)
Introduction &
MODULE 1-Microprocessor Architecture

Part-1
Presented By: Bindumol P T
C A S Puthuppally
Unit I

Microprocessor architecture and its operations – microprocessor initiated


operations and 8085 bus organization, internal data operations, 8085 registers,
externally initiated operations. Memory – memory map, memory and instructions,
peripheral mapped I/O.8085 Microprocessor and its architecture.
Unit II
8086 Internal architecture. Basic 8086 microcomputer system – system overview,
8086 bus, Read machine cycle, Write machine cycle. Assembly language
programming – program development steps,8086 instructions – data transfer
instructions, arithmetic instructions, bit manipulation instructions, string instructions,
program execution, Constructing the machine codes for 8086 instructions.
Implementing standard program in 8086 - unconditional jump instructions, condition
flags, conditional jump instructions, If-then, If-then else, and multiple if-then-else,
while-do , repeat-until , loop instructions, instruction timing and delay loops.
Unit III

Strings, Procedures and Macros – 8086 string instructions, writing and using
procedures, CALL and RET instructions, stack, using PUSH and POP to save register
contents, passing parameters, re-entrant and recursive procedures, writing and using
macros.

Unit IV
8086 interrupts – program examples, interrupt Types, 8254 software – programmable
TIMER/ COUNTER – basic 8253 and 8254 operations, 8255A, 8259A Priority interrupt
controller. Direct Memory Access data transfer – circuit connections and operations of the
Intel 8257 DMA controller, DMA transfer timing diagram.

Unit V
Intel 80286 microprocessor – architecture, signals and system connections, Real address
mode operation, protected mode operation. Intel 80386 32-bit microprocessor –
architecture, pins and signals. Introduction to 80486 microprocessor. Introduction to RISC
machines.
Book of study:
1. A.Nagoor Kani - Microprocessor 8086 programming & interfacing, Second
edition, Tata McGraw Hill Education.
2. Microprocessors and Interfacing , Programming and Hardware, Douglas
V- Hall. Tata McGraw-Hill,1990.
References:
1. Barry B.Brey - Architecture,
Programming and Interfacing ,
Eighth Edition, Prentice – Hall India.
2. The Intel Microprocessors 8086
/ 8088 , 80186 / 80188 , 80286 ,
80386 , 80486 , Pentium,
and Pentium Pro processor
MODULE- 1
❖ Microprocessor architecture and its operations
❖ Microprocessor initiated operations and 8085 bus
organization
❖ Internal data operations, 8085 registers,
❖ Externally initiated operations.
❖ Memory – memory map, memory and instructions,
peripheral mapped I/O.
❖ 8085 Microprocessor and its architecture.
MODULE- 1
INTRODUCTION
What is a Microcomputer ?

A digital computer with

microprocessor as its CPU

is called a microcomputer.
Parts of a microcomputer
Input : User can enter instructions and data into the memory through devices
like keyboard,simple switches etc called input devices.
Memory: It is used to store programs, data and results. A computer uses
different types of memory devices like:
• Semiconductor memory-RAM ,ROM etc
• Magnetic memory- Hard disk,Floppy disk etc
• Optical memory - CD,DVD etc
Central Processing Unit (CPU): It executes the users program and controls
memory, input and output devices.
Output : The output devices transfer data from the CPU to the outside world.
Eg: Monitor,Printer,Plotter ,LED etc
MICROPROCESSOR
Microprocessor is the CPU of a micro-computer.
It is a multipurpose , programmable,
clock driven, register based VLSI chip,
that fetches instructions from memory
and accepts data as input, then decodes it
and executes those instructions and
provides the result as output.

Eg. Intel 8085,8086,80186,80286,80386, 80486 etc.


BASIC FUNCTIONAL BLOCKS OF A MICROPROCESSOR

It consists of
●ALU-Arithmetic and Logic Unit

●Register Array

●Flag register
Program Counter (PC) / Instruction Pointer (IP)

●Instruction Decoding Unit


●Timing and Control Unit
➔ALU (Arithmetic/Logic Unit)-
The ALU performs arithmetic operations such as addition, subtraction
and Logic operations like AND, OR, XOR etc.
➔Register Array- It is used for temporary storage of data

during the execution of a program and are accessible to the user


through instructions.
➔Flag register - The various conditions of the result are stored

as status bits called flags in the flag register.


Eg. Carry flag, sign flag , zero flag etc.
➔ Program Counter (PC) / Instruction Pointer (IP) -
PC/IP hold or generates the address of the next instruction to be
fetched from the memory and send it through the address bus
to the memory. The memory will send the instruction codes and data
through the data bus.
➔ Instruction Decoding Unit -
The instruction codes are decoded by the decoding unit and
it sends information to the timing and control unit.
➔ Timing and Control Unit
It provides the necessary timing and control signals for all
the operations in the microprocessor. It controls the flow of data
between microprocessor, memory and peripherals.
Review questions
1. What is a Microprocessor ?
2. Draw and explain the architecture of a microprocessor.
FUNCTIONS OF MICROPROCESSOR
Module 1
Part 2

Presented By :- Bindumol P T
CAS Puthuppally
1.Functions performed by a Microprocessor

All the various functions performed by a


Microprocessor can be classified into three categories:
1.Microprocessor initiated operations

2.Internal data operations


3.Peripheral or Externally initiated operations
1.11 Microprocessor initiated operations
The Microprocessor also called the MPU(Microprocessing Unit)
basically performs four operations:-
1. Memory Read : Reads data or instructions from the memory.

2. Memory Write :Write data or instructions into the memory.

3. I/O Read : Accepts data from input devices

4. I/O Write : Sends data to output devices.


Steps to communicate with a peripheral or memory location

To communicate with a peripheral or a memory location


the MPU needs to perform the following steps:
1.Identify the peripheral or memory location(with its address)
2.Transfer binary information(data and instructions)
3.Provide the timing or synchronisation signals.
The 8085 MPU performs these functions by using three sets
of communication lines called system buses:
1.Address Bus
2.Data Bus
3.Control Bus
ADDRESS BUS:
• It is a group of 16 lines identified as A0 to A15
• It is unidirectional-bits flow in one direction (from
MPU to peripheral).
• The MPU uses the address bus to identify a
peripheral or memory location.
• As the address bus carries 16 bit address you can
identify 216=65536 memory locations (rounded to 64K)
DATA BUS :
❖ Group of 8 lines used for data flow.
❖ Data bus is bidirectional-data flows in both the
directions between MPU and memory and
peripheral devices.
❖ The MPU uses the data bus for transferring binary
information.
❖ A data bus has 8 data lines you can process the
data ranging from 0 (00H) to 255 (FFH=1111 1111)
ie 28 = 256 numbers
Why the address bus is unidirectional ?

The address is an identification number used by the microprocessor


to identify or access a memory location or IO device. It is an output
signal from the processor. Hence the address bus is unidirectional.
Why the data bus is bidirectional ?
The microprocessor has to fetch (read) the data from the memory or
input device for processing and after processing it has to store
(write) the data in the memory or output device. Hence the data bus
is bidirectional.
CONTROL BUS :

➢ The group of conducting lines that carries control


signal is called control bus.
➢ Has single lines that carry synchronisation signals.
➢ The MPU uses the control bus to provide timing or
synchronisation signals.
➢ The MPU generates specific control signals for every
operation it performs (such as Memory Read,
Memory Write,IO read or IO write)
8085 BUS STRUCTURE
Conclusion
Microprocessor initiated operations
1.Memory Read
2. Memory Write
3. I/O Read
4. I/O Write

To communicate with a peripheral or a memory location the MPU


needs to perform the following steps:
1.Identify the peripheral or memory location(with its address bus)
2.Transfer binary information( through data bus)
3.Provide the timing or synchronisation signals.(control bus)
1.12 INTERNAL DATA OPERATIONS
The internal data operations are :
1. Store 8 bit data.
2.Perform arithmetic (ADD,SUB etc) and logical(AND,OR,
XOR etc) operations.
3.Test for conditions.
4.Sequence the execution of instructions.
5.Store data temporarily in defined R/W locations called
the stack.
The Microprocessor needs Registers, ALU, Control logic and
System buses to perform all the above operations .
The Programmable registers in 8085
The different types of programmable registers are:
1.Accumulator A : It is an 8 bit register. During the execution of any arithematic
or logical operation one of the operand is always stored in the accumulator.
2.Flag register: Reflect the data conditions in the accumulator.
3. General purpose registers :B,C,D,E,H,L are the general purpose registers
in 8085 microprocessor. Individually they are 8 bit registers. They are used for
temporary storage of data during the execution of a program. They can also be
used in pairs to save 16 bit data. The permissible pairs are: B-C,D-E and H-L
4.Stack pointer(SP): Used to point to the address of the memory location
used as stack ( part of RAM).
5.Program Counter (PC):It is used to point to the address of the next
instruction to be fetched from memory.
Conclusion
INTERNAL DATA OPERATIONS

1. Store 8 bit data. (Accumulator & General purpose Registers)

2.Perform arithmetic and logical operations. (ALU)

3.Test for conditions. (Flag register)

4.Sequence the execution of instructions. (Program Counter)

5.Store data temporarily in defined R/W locations called the stack


(Stack pointer)
1.13 PERIPHERAL OR EXTERNALLY INITIATED OPERATIONS
External devices or signals can initiate the following operations
for which different pins on the Microprocessor are assigned.
The pins are :RESET,INTERRUPT,READY,HOLD
1. Reset : When RESET pin is activated by external key
(called a reset key) all internal operations are suspended and
the PC is cleared to hold address 0000H.
2. Interrupt : The Microprocessor can be interrupted from the
normal execution of the program and asked to execute some
other instructions called service routine. Microprocessor resumes
its operation afterexecuting the service routine. The 8085
Microprocessor has some pins for interrupt like INTR,TRAP,
RST7.5, RST 6.5 and RST5.5.
3.Ready : This signal is used to synchronise slower
peripherals with the Microprocessor. When READY pin
is low the Microprocessor enters a wait state.

4.Hold: When HOLD pin is activated the microprocessor


relinquishes the control of its buses and allows the
external peripherals to use them. For example :it is used
in DMA (Direct Memory Access) data transfer.
CONCLUSION
Functions performed by a Microprocessor

1.Microprocessor 2.Internal data operations 3.Peripheral or


initiated operations Externally initiated
1.Memory Read 1. Store 8 bit data. operations
2. Memory Write 2.Perform arithmetic and logical operations. 1.RESET
3. I/O Read 2. INTERRUPT
4. I/O Write 3.Test for conditions. 3. READY
4.Sequence the execution of instructions.
4. HOLD

5.Store data temporarily in defined R/W


locations called the stack.
Review questions

1. List the functions performed by a Microprocessor.


2. List the four operations performed by a Microprocessor.
3. What are the different buses available in 8085 microprocessor? Explain their
functions.
4. Why the address bus is unidirectional ?
5. Why the data bus is bidirectional ?
6. Explain the functions of various registers in the 8085 Programming model.
7. What are the various operations that can be initiated by a peripheral or external
device ?
8. What are the internal data operations in a microprocessor ?
Module1
Part 3

MEMORY

◼ memory map
◼ memory and instructions
◼ Peripheral mapped I/O.
◼ Memory mapped I/O.
Memory
➢ Memory stores binary instructions and data for the microprocessor.
➢ Memory is a group of registers , arranged in a sequence, to store bits.
➢ The number of bits stored in a register is called memory word.
➢ The MPU can read from or write into the memory chip.

➢ Memory can be classified primarily into two.


1. RAM (Random Access Memory) or R/W (Read / Write memory)
2. ROM (Read only Memory).
⚫RAM :-
⚫It can be used to store information temporarily.
⚫RAM is volatile and can be used to read and write information.
ROM :
⚫ It can be used to store information permanently.

⚫ It is non-volatile and MPU can only read the information from the ROM.
Memory Mapping
•Memory mapping is the process of interfacing memories to microprocessor
and assigning addresses to each memory locations in memory chip.
•8085 MPU requires an 8 bit wide memory word and uses the 16 bit address
to select a register called a memory location.
•The assignment of memory address is done through the chip select logic.
•8085 has 16 address lines (A15 - A0) because it can address 65,536 (216)
memory locations.
•The entire memory map can range from 0000 H – FFFF H
A15 A14 A13 A12 A11 A10 A9 A8 A7A6 A5 A4 A3 A2 A1 A0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = 0000 H

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 = FFFF H
Last location FFFF H (65535 )
10 Program in Assembly
Language:
MVI A,03H 3E,03
MVI B,05H 06,05
ADD B 80
HLT 76

PROGRAM HEX CODE


0002 H
AFTER THE EXECUTION OF THE
0001 H PROGRAM THE CONTENT OF
THE ACCUMULATOR IS 08H
First location 0000 H (010 ) (03H+05H)
Memory and Instruction fetch
To fetch instruction located in
memory location 2005H,
the following steps are
performed
1. PC places the 16 bit address
2005H of the memory location
on the addres bus.
2. The control unit send the
memory read control signal
(MEMR*) to enable the
memory chip.

3. The instruction code (4FH) stored In the memory location is placed on the data bus and
transferred to the microprocessor.
8085 MPU fetches the instruction using address bus, the data bus and
control buses.
Steps to read data
from memory:
1.Place 16 bit address on
address bus.
2.Send the Memory read
control signal(MEMR) to
the memory chip.
3.Contents of the
Addressed memory
location are placed on
the data bus and brought
inside the
microprocessor.
Methods of interfacing I/O devices to microprocessors are of two types:
1.Memory mapped I/O 2. Peripheral mapped or I/O mapped I/O
Review questions?
1. What is memory mapping ?
2. Explain memory read operation in a microprocessor.
3. Compare memory mapped I/O and I/O mapped I/O
Module1
Part 4

8085 Microprocessor and its Architecture

◼ 8085 Features
◼ Architecture
8085 Microprocessor :
It is an 8-bit microprocessor.
Features:
• 8-bit data bus
•16-bit address bus, which can address upto 64KB
•A 16-bit program counter
•A 16-bit stack pointer
•Six 8-bit registers arranged in pairs: BC, DE, HL
•Requires +5V supply to operate at 3.2 MHZ single phase clock
•It is used in washing machines, microwave ovens, mobile phones, etc.
Figure 1.1 shows the functional block diagram or the internal architecture of 8085
Microprocessor.It includes ALU,Register array,Timing and Control unit, Instruction register and
Decoder, ,Interrupt control and Serial I/O control.
1. ALU : The arithematic/logic unit performs the computing functions.It includes the
accumulator,the temporary register,the arithematic and logic circuits and Flag register.
Accumulator (A register) : It is an 8 bit register.During an arithematic/logic operation one of the
operand is stored in the accumulator and the result of operation is also stored in the accumulator.
Temporary register: The temporary register is used to hold data during an arithematic/logic
operation.
Flag register: The flag register
reflects the status of the ALU after the
execution of an instruction.
It is an 8 bit register.But only 5 bits are
used as shown in the figure 1.2
2.REGISTER ARRAY : The 8085 Microprocessor contains six 8 bit general purpose registers.
They are : B,C,D,E,H and L register. To hold 16 bit data combination of two 8 bit registers called
register pair can be used.the valid register pairs are : B-C,D-E and H-L pair.
Program Counter PC: It is a 16 bit register that is used to point to the address of the next
instruction to be fetched from memory.
Stack Pointer SP : It is a 16 bit register that is used to point to the address of the memory
location used as stack.

3.TIMING AND CONTROL UNIT : This unit synchronises all the microprocessor operations with
the clock and generates the contol signals necessary for communication between the
microprocessor and peripherals.

4.INSTRUCTION REGISTER AND DECODER : When an instruction is fetched from memory it is


loaded in the instruction register.The instruction decoder decodes the instruction and the
sequence of events follows.The instruction register is not programmable.
5.INTERRUPT CONTROL : This unit controls the interrupt process. The 8085 Microprocessor
has five interrupt signals - INTR,RST 7.5,RST 6.5,RST 5.5 and TRAP.

6.SERIAL INPUT OUTPUT CONTROL : This unit controls the serial communication by using the
lines SID (Serial Input Data ) and SOD (Serial Output Data ).

7.ADDRESS BUFFER AND DATA/ADDRESS BUFFER :


The content stored in the Stack Pointer and Program Counter is loaded into the address buffer
and address-data buffer.

8. ADDRESS BUS AND DATA BUS : The address bus is 16 bit (AD0 to AD7 and A8 to A15).
The data bus is 8 bit wide(AD0 TO AD7

You might also like