Professional Documents
Culture Documents
Microprocessor Lab 313
Microprocessor Lab 313
MICROPROCESSOR LAB
Session: 2023-24
Name :
Roll No. :
Group/Branch :
Indian Institute of Information Technology, Bhopal
Microprocessor Lab (MP&MC-313) Manual (EEE, 5th Sem)
VISIONOFTHEINSTITUTE
Aims to become an Institution of excellence in imparting quality outcome based education that empowers the young
generation with knowledge, skills, research aptitude and ethical values to solve contemporary challenging problems.
MISSIONOFTHEINSTITUTE
Develop a platform for achieving globally acceptable level of intellectual acumen and technological competence.
Create an inspiring ambience that raises the motivation level for conducting quality research.
Provide an environment for acquiring ethical values and positive attitude.
VISIONOFTHEDEPARTMENT
Emerge as a premier department of Electrical and Electronics Engineering, a source of technically outstanding
energetic engineers, entrepreneurs and leaders through its highest quality academics and research
MISSIONOFTHEDEPARTMENT
1. Provide the students with basic and advanced knowledge in the field of Electrical and Electronics
Engineering as well as professional skills necessary to face the challenges of the future.
2. Encourage the students to strive for excellence through innovation and collaborative research
activities.
3. Imbibe students with qualities like team work, managerial skills and ethical & cultural values to work
in a collaborative environment.
2. Hold position in academics and research organizations to pursue a continual path of professional
development and excel through innovation and collaborative research activities.
3. Work effectively as individuals and as team members exhibiting managerial skills and ethical &
cultural values imbibed in them to solve industrial and socially relevant issues
Apply the knowledge in the field of Embedded and Control systems to provide acceptable solutions for
industrial and societal needs
PSO2:
Model, analyze and validate the performance of Smart Energy Systems that are sustainable.
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and
an engineering specialization to the solution of complex engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and design system
components or processes that meet the specified needs with appropriate consideration for the public health
and safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of the information to
provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering
and IT tools including prediction and modeling to complex engineering activities with an understanding of
the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the
engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in diverse
teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and
design documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the engineering and
management principles and apply these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in independent
and life-long learning in the broadest context of technological change.
CO-PO-PSO MAPPING
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2
C324.1 3 2 1 1 1 3 2 1 2
3 3
C324.2 3 2 2 1 2 3 2 1 2
3 3
C324.3 3 2 2 1 2 3 2 1 2
3 3
C324.4 3 3 3 2 3 3 2 1 2
3 3
C324.1 3 2 1 1 1 3 2 1 2
3 3
Experiment List:
Do’s
1. Know the location of the fire extinguisher and the first aid box and how to use them in case of
an emergency.
2. Read and understand how to carry out an activity thoroughly before coming to the laboratory.
3. Report fires or accidents to your lecturer/laboratory technician immediately.
4. Report any broken plugs or exposed electrical wires to your lecturer/laboratory technician
immediately.
Don’ts
1. Do not eat or drink in the laboratory.
2. Avoid stepping on electrical wires or any other computer cables.
3. Do not open the system unit equipment particularly when the power is turned on. Some
internal components hold electric voltages of up to 30000 volts, which can be fatal.
4. Do not insert metal objects such as clips, pins and needles into the respective equipment that
may cause fire.
5. Do not remove anything from the laboratory without permission.
6. Do not touch, connect or disconnect any plug or cable without your lecturer/laboratory
technician’s permission.
7. Do not misbehave in the respective laboratory.
Indian Institute of Information Technology, Bhopal
Microprocessor Lab (MP&MC-313) Manual (EEE, 5th Sem)
LIST OF EXPERIMENTS
To develop and run a program for finding out the largest CO2
5
number from given two 8-bit numbers
To develop and run a program for finding out the smallest number CO2
6 from given two 8-bit numbers
To develop and run a program for arranging in ascending order of a CO2
7 given set of 8-bit numbers
To develop and run a program for arranging in descending CO2
8
order of a given set of 8-bit numbers
9 To find the square root of a given 8 bit number CO5, CO3
10 Interfacing 8255 PPI IC with 8085. CO4
MICROPROCESSOR LAB
8085 Programming
1. Introduction to 8085
2. 8-bit Addition and Subtraction
3. 8-bit Multiplication and Division
Interfacing
1. Interfacing 8255 PPI IC with 8085.
PRESENT PROBLEM:
It is difficult during any Engineering course under the present setup, to arrange
practical and related theory in an integrated manner so as to simultaneously correlate
practical work with the theory teaching. For this, theory lectures have to be followed by
the related practical simultaneously and all the students need to perform the same
experiments at the same time over what just has been covered in the theory. Owing to the
large number of students, it is not possible to arrange for the practical work this way. It
becomes necessary to ask the student to work in groups and perform experiments by
rotation. The student has to, quite often; perform the experiments for which the theory
shall be taught in the classroom at a much later date. Students have to come to the
laboratory completely unprepared as they have neither been taught the related theory nor
been given any instruction about the experiment to be performed.
This Manual has been prepared essentially keeping this difficulty in mind. Brief
theory for each Experiment is given in such a manner that even if the student has not
studied the theory related to the Experiment, one can have sufficient information to
perform the experiment and sufficiently understand it.
This Manual consists of a set of apparatus prepared for different experiments. For
each experiment, required apparatus is given separately.
Observations should be recorded in the tabular form. Students shall draw a neat
respective Circuit/pin diagram with description of the microprocessor, type of instrument
(AC / DC) and type of supply. All the summary, results shall be recorded by the students.
PREFACE
This manual of MicroprocessorLab has been specifically designed for the Third Year B. Tech Course in
Electrical & Electronics Engineering with the objective to provide the students, brief guidelines on the
experiment to be performed in the laboratory. This manual contains some features on the basis of
experience to cover the difficulties and problems associated in general, with the laboratory work. Detailed
instructions for carrying out each experiment along with relevant theory has been presented.
The Department Faculty hopes that the students will find this manual helpful in performing the
experiments in digital electronics lab. Thanks to all the department faculty members and also non-
teaching staff members for their support and help in preparation of this manual.
Prepared by:
Dr. Neeraj Kumar
Assistant Professor
Electronics & Communication Engineering
Indian Institute of Information Technology, Bhopal
FACULTY
DATE OF MARKS
SR. EXPT PAGE SIGNATURE
CONDUC TITLE OF THE EXPERIMENT AWARDED
NO. . NO NO. WITH
TION (10)
REMARK
10
EXPERIMENT NO.1
8085/8086 MICROPROCESSOR
Carry flag
If an arithmetic operation results in a carry, the carry flag is set.
The carry flag also serves as a borrow flag for subtraction.
This unit synchronizes all the microprocessor operation with a clock and
generates the control signals necessary for communication between the
microprocessor and peripherals. The control signals RD (read) and WR (write)
indicate the availability of data on the data bus.
The instruction register and decoder are part of the ALU. When an instruction is
fetched from memory it is loaded in the instruction register. The decoder decodes the
instruction and establishes the sequence of events to follow.
Register array
The 8085 has six general purpose registers to store 8-bit data during program
execution. These registers are identified as B, C, D, E, H and L. they can be combined
as BC, DE and HL to perform 16-bit operation.
Accumulator
Accumulator is an 8-bit register that is part of the ALU. This register is used to
store 8-bit data and to perform arithmetic and logic operation. The result of an
operation is stored in the accumulator.
Program counter
The program counter is a 16-bit register used to point to the memory address of
the next instruction to be executed.
Stack pointer
It is a 16-bit register which points to the memory location in R/W memory, called
the Stack.
Communication lines
8085 microprocessor performs data transfer operations using three communication
lines called buses. They are address bus, data bus and control bus.
PRE-REQUISITE QUESTIONS:
1. What is the pattern of representation of a 8 bit number?
2. What is total memory consumption of 8 bit processor?
3. How many address lines are used for communication in 8 bit microprocessor?
ALGORITHM:
RESULT:
Thus the 8 bit numbers stored at 4500 &4501 are added and the result stored at 4502
& 4503.
OBSERVATION:
INPUT OUTPUT
4500 4502
4501 4503
FLOW CHART:
START
[C] 00H
[HL]4500H
[A] [M]
[HL] [HL]+1
[A] [A]+[M]
NO
Is there a
Carry ?
[C] [C]+1
[HL] [HL]+1
[M] [A]
[HL] [HL]+1
[M] [C]
STOP
AIM:
PRE-REQUISITE QUESTIONS:
1. What is instruction used for subtracting a8 bit number?
2. How the eight bit numbers are subtracted in binary format?
3. What is the instruction for subtraction with barrow?
ALGORITHM:
RESULT:
Thus the 8 bit numbers stored at 4500 &4501 are subtracted and the result stored at 4502
& 4503.
OBSERVATION:
INPUT OUTPUT
4500 4502
4501 4503
FLOW CHART:
START
[C] 00H
[HL] 4500H
[A] [M]
[HL] [HL]+1
[A] [A]-[M]
Is there a NO
Borrow ?
YES
Complement [A]
Add 01H to [A]
[C] [C]+1
[HL] [HL]+1
[M] [A]
[HL] [HL]+1
[M] [C]
STOP
0C INR C Increase C by 1
EXPERIMENT No. 3
PRE-REQUISITE QUESTIONS:
1. What instruction is used for Multiplying two 8 bit numbers?
2. How the multiplication of eight bit numbers are carried out in a 8 bit
microprocessor?
ALGORITHM:
RESULT:
Thus the 8-bit multiplication was done in 8085p using repeated addition method.
FLOW CHART:
START
[HL] 4500
B M
[HL] [HL]+1
A00
C00
Is there NO
any carry
YES
CC+1
BB-1
NO
IS B=0
YES
[HL] [HL]+1
[M] [A]
[HL] [HL]+1
[M] [C]
STOP
OBSERVATION:
INPUT OUTPUT
4500 4502
4501 4503
EXPERIMENT No. 4
8 BIT DIVISION
AIM:
PRE-REQUISITE QUESTIONS:
1. What instruction is used for Division of two 8 bit numbers?
2. How the division of eight bit numbers are carried out in a 8 bit microprocessor?
ALGORITHM:
RESULT:
Thus an ALP was written for 8-bit division using repeated subtraction method
and executed using 8085 p kits
OBSERVATION:
FLOWCHART:
START
B00
[HL] 4500
A M
[HL] [HL]+1
M A-M
[B] [B] +1
NO
IS A<0
YES
AA+M
BB-1
[HL] [HL]+1
[M] [A]
[HL] [HL]+1
[M] [B]
STOP
EXPERIMENT No. 5
AIM:
To develop and run a program for finding out the largest number from given
two 8-bit numbers.
PRE-REQUISITE QUESTIONS:
1. What is an array?
2. How the array will be considered in an 8 bit microprocessor?
3. What is the function of counter?
ALGORITHM:
1. Place all the elements of an array in the consecutive memory locations.
2. Fetch the first element from the memory location and load it in the accumulator.
3. Initialize a counter (register) with the total number of elements in an array.
4. Decrement the counter by 1.
5. Increment the memory pointer to point to the next element.
6. Compare the accumulator content with the memory content
(next element).
7. If the accumulator content is smaller, then move the memory content
(largest element) to the accumulator. Else continue.
8. Decrement the counter by 1.
9. Repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location.
RESULT:
Thus the largest number in the given array is found out.
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8100 8105
8101
8102
8103
8104
FLOW CHART:
START
[HL] [8100H]
[B] 04H
[A] [HL]
[HL [HL] + 1
NO IS
[A] < [HL]?
YES
[A] [HL]
[B] [B]-1
IS NO
[B] = 0?
YES
[8105] [A]
STOP
EXPERIMENT No. 6
AIM:
To develop and run a program for finding out the smallest number from given
two 8-bit numbers.
PRE-REQUISITE QUESTIONS:
1. What is the logic used for finding the smallest number in an array?
2. What is the function of accumulator in the current program?
ALGORITHM:
1. Place all the elements of an array in the consecutive memory locations.
2. Fetch the first element from the memory location and load it in the accumulator.
3. Initialize a counter (register) with the total number of elements in an array.
4. Decrement the counter by 1.
5. Increment the memory pointer to point to the next element.
6. Compare the accumulator content with the memory content
(next element).
7. If the accumulator content is smaller, then move the memory content
(largest element) to the accumulator. Else continue.
8. Decrement the counter by 1.
9. Repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location.
RESULT:
Thus the smallest number in the given array is found out.
OBSERVATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8100 8105
8101
8102
8103
8104
FLOW CHART:
START
[HL] [8100H]
[B] 04H
[A] [HL]
[HL [HL] + 1
YES IS
[A] < [HL]?
NO
[A] [HL]
[B] [B]-1
IS NO
[B] = 0?
YES
[8105] [A]
STOP
EXPERIMENT No. 7
ASCENDING ORDER
AIM:
To develop and run a program for arranging in ascending order of a given set
of 8-bit numbers.
PRE-REQUISITE QUESTIONS:
1. What is the logic used for sorting an array in ascending order?
2. Discuss the register pairs.
ALGORITHM:
RESULT:
Thus the ascending order program is executed and thus the numbers are
arranged in ascending order.
FLOWCHART: START
[B] 04H
[HL] [8100H]
[C] 04H
[A] [HL]
[HL [HL] + 1
YES IS
[A] < [HL]?
NO
[D] [HL]
[HL] [A]
[HL] [HL] - 1
[HL] [D]
[HL] [HL] + 1
[C] [C]–01H
NO
A
IS
[C] = 0?
YES
[B] [B]-1
NO
IS
[B] = 0?
STOP
OBSERVATION:
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
8100 8100
8101 8101
8102 8102
8103 8103
8104 8104
EXPERIMENT No. 8
DESCENDING ORDER
AIM:
To develop and run a program for arranging in descending order of a given set
of 8-bit numbers.
.
PRE-REQUISITE QUESTIONS:
1. What is the logic used for sorting an array in descending order?
ALGORITHM:
RESULT:
Thus the descending order program is executed and thus the numbers are
arranged in descending order.
FLOWCHART: START
13. 04H
[HL] [8100H]
[C] 04H
[A] [HL]
[HL [HL] + 1
NO IS
[A] < [HL]?
YES
[D] [HL]
[HL] [A]
[HL] [HL] - 1
[HL] [D]
[HL] [HL] + 1
[C] [C]–01H
NO
IS
[C] = 0?
[B] [B]-1
NO
IS
[B] = 0?
STOP
OBSERVATION:
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
8100 8100
8101 8101
8102 8102
8103 8103
8104 8104
EXPERIMENT No. 9
AIM:
. To perform computation of square root of a given number.
PRE-REQUISITE QUESTIONS:
1. What is the logic used for obtaining a square root of a 8 bit number?
2. State the functions of CALL, JMP, CMP instructions.
ALGORITHM:
Store the approximation in two registers and get the numbers whose square root be
1. calculated in a register.
Make sub program of division. Assign new variables for approximation and number by
2. considering the starting value as zero.
3. Compare the approximation and the number till the approximation is less than the number by
incrementing L.
5. Add the result 1 of division subroutine and approximation.
6. Call the subroutine with new value.
7. Compare the result 2 of 2nd call for subroutine.
8. If result 2 and approximation value are same store the result else get a new number and
repeat the steps from 2-7.
RESULT:
Thus the ascending order program is executed and thus the square root of a given number is
obtained.
Flow Diagram
8012 CD, 1E, 80 CALL DIV Call div subroutine Here sum in
L and 2in A Xnew= ((N/Xold)+
Xold)/2
801A 32, 00, 81 STA 8100H Store the result at the desired
memory location 8100H
EXPERIMENT No. 10
APPARATUS REQUIRED:
8085 p kit, 8255Interface board, DC regulated power supply, VXT parallel bus
PRE-REQUISITE QUESTIONS:
1. What is meant by interfacing of a peripheral device?
2. Which are the different interfacing devices used with 8085?
3. What are the advantages of interfacing devices?
I/O MODES:
Control Word:
This mode provides simple I/O operations for each of the three ports
and is suitable for synchronous data transfer. In this mode all the ports can be
configured either as input or output port.
Let us initialize port A as input port and port B as output port.
PROGRAM:
MAIN PROGRAM:
program.
Sub program:
Any lines of port c can be set or reset individually without affecting other
lines using this mode. Let us set PC0 and PC3 bits using this mode.
PROGRAM:
RESULT:
Thus 8255 are interfaced and their characteristic in mode0, mode1 and BSR
mode is studied.