Beruflich Dokumente
Kultur Dokumente
LABORATORY MANUAL
SEMESTER V
DEAPRTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING
SRM UNIVERISTY
(Under SECTION 3 of the UGC Act, 1956)
S.R.M. NAGAR, KATTANKULATHUR - 603203.
Department of Electronics and Communication Engineering
Department of Electronics and Communication Engineering
EC0321
Processor Lab
Laboratory Manual
1une 2014
Mrs. A Ruhan Bevi. and course committee
2
L T P C
EC0321 PROCESSOR LAB 0 0 3 2
Prerequisite : nil
PURPOSE :
To make the students understand the basic programming of Microprocessor, Micro
controller and Nuvoton processor. Also, to introduce them to Microcontrollers and few
interfacing circuits.
INSTRUCTIONAL OB1ECTIVES
To understand and gain knowledge about
. Microprocessor !"#"$%
2. Microcontroller !"#&%
'. (nterfacing circuits
). Nuvoton *rocessor
LIST OF EXPERIMENTS
Part No Experiment No. Experiment Name
I
"#"$ *rogramming
# $ bit Addition , +ubtraction,
Multiplication and ,ivision
#2 -argest and +mallest number
#' Ascending and ,escending numbers
#) +um of +eries
II
"#"$ (nterfacing
#& *rogrammable peripheral (nterface
#$ +tepper Motor (nterface
#. *rogrammable Timer (nterface
#" A/, and ,/A 0onverters
III
"#& *rogramming
1 Addition , +ubtraction, Multiplication
and ,ivision
# 2ne3s and two3s complement
4ord ,isassembl5
2 ,ecimal to 6e7a decimal 0onversion
IV
"#& interfacing
' "2.1 interface
) "2&' timer interface
& +tepper motor interface
$ ,A0 interface
V
Nuvoton programming
. +even segment displa5 from 8####9 to
811119
" +even segment displa5 from A,0 input
i
EC0321 - Processor Lab
0ourse designed b5 ,epartment of :lectronics ; 0ommunication :ngineering
*rogram
outcome
a b c d e f g h i < k
7 7 7 7 7
2 0ategor5
=eneral
!=%
Basic
+ciences
!B%
:ngineering
+ciences and
Technical
Arts!:%
*rofessional
+ub>ects!*%
?
'
Broad area !for
@*3categor5%
0ommunication
+ignal
*rocessing
:lectronics A-+( :mbedded
?
)
+taff responsible for
preparing the
s5llabus
Mr. A.A.M Manikandan
Mr. +elvakumar
& ,ate of preparation Ma5 2#)
ii
S.R.M University
Faculty of Engineering and Technology
Department of Electronics and Communication Engineering
Sub Code: EC0321 Semester : V
Sub Title: Processor Lab Course Time: 1ul-Dec`14
Pre-requisite : NIL
Co-requisite : EC0309 Microprocessors & Microcontrollers
Program Outcome
b. Graduates will demonstrate the ability to identify, formulate and solve engineering
problems
Experiment 1 to Experiment no. 18 (Please refer Expt. list)
c. Graduate will demonstrate the ability to design and conduct experiments, analyze
and interpret data
Experiment 1 to Experiment no. 18 (Please refer Expt. list)
d. Graduate will demonstrate the ability to design a system, component or process as
per needs and specification
Experiment 5: To interface "2&& *rogrammable *eripheral (nterface with "#"$
microprocessor and to test mode # operation
Experiment 6: To interface a stepper motor with a "#"$ kit and to make it run a% clockwise b% anti
clockwise
Experiment 7: To interface a programmable timer with "#"$
Experiment 8: To interface a A/, 0onverter with "#"$ and to measure the analog voltage and
displa5 digital eBuivalent of it
To interface a ,/A 0onverters with "#"$ and to generate sBuare and triangular waveforms
Experiment 13: To interface Ce5board /,ispla5 to "#& micro controller and to read ke5 and displa5
data in leds.
Experiment 14: To interface "2&' programmable timer with "#& controller and to test the mode #
operation.
Experiment 15: To interface a stepper motor with a "#& kit and to make it run a% clockwise b% anti
clockwise
Experiment 16: To interface a ,/A 0onverters with "#& and to generate sBuare and
triangular waveforms
f. Graduate will demonstrate the skills to use modern engineering tools, software`s and
equipment to analyze problems
Experiment 1: Dsing "#"$ emulator add, subtract, multipl5 and divide two $ bit numbers stored in
the memor5 and save the results of the operation in the memor5.
iii
Experiment 2: To find the largest and the smallest of the given arra5 of numbers stored in memor5
using "#"$.
Experiment 3: To sort the given arra5 of numbers stored in memor5 location into ascending and
descending order using "#"$.
Experiment 4: To find the sum of a series of numbers using "#"$.
Experiment 17: *erform seven segment displa5 from 8####9 to 811113 in Ceil (,:
Experiment 18: *erform seven segment displa5 fetching data from the potentiometer using
Ceil (,:
k. Graduate will show the ability to participate and try to succeed in competitive
examinations
Experiment 1 to Experiment no. 18 (Please refer Experiment list)
iv
S.R.M University
Faculty of Engineering and Technology
Department of Electronics and Communication Engineering
Sub Code : EC0321 Semester : V
Sub Title : Processor Lab Course Time : 1ul-Dec`14
Pre_requisite : NIL
Co_requisite : EC0309 Microprocessors & Microcontrollers
Program Educational Objectives Vs Program Outcome
Program
Outcomes
Program Instructional Objectives
. To
prepare
students
to
compete
for a
successful
career in
their
chosen
profession
through
global
education
standards.
2. To enable
the students
to aptl5 to
appl5 their
acBuired
knowledge
in basic
sciences and
mathematics
in solving
engineering
problems.
'. To produce skill full
graduates to anal5Ee,
design and develop a
s5stem/component/proces
s for the reBuired needs
under the realistic
constraints.
).To train the
students to
approach
ethicall5 an5
multidisciplinar5
engineering
challenges with
economic,
environmental
and social
conte7ts
&. To create
an
awareness
among
students
about the
need for life
long
learning to
succeed in
their
professional
career.
b. =raduates
will
demonstrate
the abilit5 to
identif5
,formulate
and solve
engineering
problems
data
x x x
c. =raduate
will
demonstrate
the abilit5 to
design and
conduct
e7periments,
anal5Ee and
interpret data
x x x
d. =raduate
will
demonstrate
the abilit5 to
x x x x
v
design a
s5stem,
component
or process as
per needs and
specifications
f. =raduates
will
demonstrate
the skills to
use modern
engineering
tools,
software,
eBuipment to
anal5se
problems
x x x
k. =raduate
will show the
abilit5 to
participate
and tr5 to
succeed in
competitive
e7amination
x x x
vi
S.R.M University
Faculty of Engineering and Technology
Department of Electronics and Communication Engineering
Sub Code : EC0321 Semester : V
Sub Title : Processor Lab Course Time : 1ul-Dec`11
Pre_requisite : NIL
Co_requisite : EC0309 Microprocessors & Microcontrollers
Instructional Objective and Program Outcome
S.No
Instructional
Objective
Program Outcome Experiment Details
1
To understand and
gain knowledge
about
Microprocessor
!"#"$%
b. =raduates will demonstrate
the abilit5 to identif5
,formulate and solve
engineering problems data
Ex.No.1F Dsing "#"$ trainer kit, add,
subtract, multipl5 and divide two $
bit numbers stored in the memor5 and
save the results of the operation in the
memor5. c. =raduate will demonstrate
the abilit5 to design and
conduct e7periments, anal5Ee
and interpret data
d. =raduate will demonstrate
the abilit5 to design a s5stem,
component or process as per
needs and specification
Ex.No. 2 F To find the largest and the
smallest of the given arra5 of numbers
stored in memor5 using "#"$.
f. =raduate will demonstrate
the skills to use modern
engineering tools, software3s
and eBuipment to anal5Ee
problems
Ex.No.3 F To sort the given arra5 of
numbers stored in memor5 location
into ascending and descending order
using "#"$
k. =raduate will show the
abilit5 to participate and tr5
to succeed in competitive
e7aminations
Ex.No.4F To find the sum of a series
of numbers using "#"$.
2 To understand and
gain knowledge
about
Microcontroller
!"#&%
b.=raduates will demonstrate
the abilit5 to identif5
,formulate and solve
engineering problems data
Ex.No.9F To perform Addition ,
+ubtraction, Multiplication and
,ivision of two " bit,$ bit numbers
using "#& trainer kit
c. =raduate will demonstrate
the abilit5 to design and
conduct e7periments, anal5Ee
and interpret data
Ex.No.10F To perform one3s and
two3s complement of a given number
using "#&
d. =raduate will demonstrate
the abilit5 to design a s5stem,
component or process as per
needs and specification
Ex.No.11F To perform word
disassembl5 using "#&
k. =raduate will show the
abilit5 to participate and tr5
to succeed in competitive
e7aminations
Ex.No.12F 0onvert the given decimal
number to 6e7adecimal using "#&
3 To understand and
gain knowledge
about interfacing
circuits
b.=raduates will demonstrate
the abilit5 to identif5
,formulate and solve
engineering problems data
Ex.No.6& 15:To interface a stepper
motor with a "#"$/"#& kit and to
make it run a% clockwise b% anti
clockwise
vii
c. =raduate will demonstrate
the abilit5 to design and
conduct e7periments, anal5Ee
and interpret data
Ex.No.7 &14 :To interface a
programmable timer with "#"$/"#&
d. =raduate will demonstrate
the abilit5 to design a s5stem,
component or process as per
needs and specification
Ex.No.8 & 16:To interface a A/,
0onverter with "#"$ /"#&and to
measure the analog voltage and
displa5 digital eBuivalent of it. To
interface a ,/A 0onverters with "#"$
and to generate sBuare and triangular
waveforms
k. =raduate will show the
abilit5 to participate and tr5
to succeed in competitive
e7aminations
ExNo. 5 : (nterfacing **( with "#"$
Ex.No.13: (nterfacing "2.1 with "#&
4
To understand and
gain knowledge
about Nuvoton
*rocessor
c. =raduate will demonstrate
the abilit5 to design and
conduct e7periments, anal5Ee
and interpret data
Ex.No. 17: *erform seven segment
displa5 from 8####9 to 811113 in
Ceil (,:
d. =raduate will demonstrate
the abilit5 to design a s5stem,
component or process as per
needs and specification
f. =raduate will demonstrate
the skills to use modern
engineering tools, software3s
and eBuipment to anal5Ee
problems
Ex.No. 18: *erform seven segment
displa5 fetching data from the
potentiometer using Ceil (,:
viii
S.R.M University
Faculty of Engineering and Technology
Department of Electronics and Communication Engineering
Sub Code : EC0321 Semester : V
Sub Title: Processor Lab Course Time : 1ul-Dec`14
Pre_requisite : NIL
Co_requisite : EC0309 Microprocessors & Microcontrollers
EXPERIMENTS DETAILS
S.No. Experiments Detail Equipments
Required
Components
Required
I. Programming in 8086
Dsing "#"$ trainer kit, add, subtract, multipl5 and divide
two $ bit numbers stored in the memor5 and save the
results of the operation in the memor5.
"#"$
Trainer Cit
*ower 0ables
2 To find the largest and the smallest of the given arra5 of
numbers stored in memor5 using "#"$.
"#"$ Trainer Cit *ower 0ables
' To sort the given arra5 of numbers stored in memor5
location into ascending and descending order using "#"$
"#"$ Trainer Cit *ower 0ables
) To find the sum of a series of numbers using "#"$. "#"$ Trainer Cit *ower 0ables
II. 8086 Interfacing
& To interface "2&& *rogrammable *eripheral (nterface
with "#"$ microprocessor and to test mode # operation
"#"$ Trainer Cit *ower 0ables
$ To interface a stepper motor with a "#"$ kit and to make
it run a% clockwise b% anti clockwise
"#"$ Trainer Cit
stepper motor
interface G add on
card
*ower 0ables
Add on card
connector bus.
. To interface a programmable timer with "#"$. "#"$ Trainer Cit
programmable timerH
add on card
*ower 0ables
Add on card
connector bus.
" To interface a A/, 0onverter with "#"$ and to measure
the analog voltage and displa5 digital eBuivalent of it.
To interface a ,/A 0onverters with "#"$ and to generate
sBuare and triangular waveforms.
"#"$ Trainer Cit
A/,, ,/A interface
boards, 0R2
*ower 0ables
Add on card
connector bus.
III.Programming in 8051
1 To perform Addition, +ubtraction, Multiplication and
,ivision of two " bit, $ bit numbers using "#& trainer
kit.
"#& Trainer kit *ower 0ables
# To perform one3s and two3s complement of a given
number using "#&.
"#& Trainer kit *ower 0ables
To perform word disassembl5 using "#& "#& Trainer kit *ower 0ables
2 0onvert the given decimal number to 6e7a decimal
using"#&.
"#& Trainer kit *ower 0ables
IV.8051 Interfacing
i7
' To interface "2.1 with "#& "2.1 module,
"#& kit
*ower 0ables
) To interface a "2&' programmable timer with "#& "2&' module,
"#& kit
*ower 0ables
& To interface a stepper motor with "#& +tepper motor ,
"#& kit
*ower 0ables
$ To interface an A,0 with "#& A,0 module,
"#& kit
*ower 0ables
V. Programming in Nuvoton Board
. +even segment displa5 using Nuvoton board Nuvoton kit *ower 0ables
" +even segment displa5 for A,0 input using Nuvoton
board
Nuvoton kit,
*otentiometer
*ower 0ables
7
EC0321- Laboratory Policies and Report Format
Reports are due at the beginning of the lab period. The reports are intended to be a complete
documentation of the work done in preparation for and during the lab. The report should be
complete so that someone else familiar with microprocessor and controllers could use it to
verif5 5our work. The prelab and postlab report format is as followsF
. A neat thorough prelab must be presented to 5our +taff (ncharge at the beginning of
5our scheduled lab period. Lab reports should be submitted on A4 paper. Iour
report is a professional presentation of 5our work in the lab. Neatness, organiEation,
and completeness will be rewarded. *oints will be deducted for an5 part that is not
clear.
2. (n this laborator5 students will work in teams of three. 6owever, the lab reports will
be written individuall5. *lease use the following format for 5our lab reports.
a. Cover Page: (nclude 5our name, +ub>ect 0ode, +ection No., :7periment No.
and ,ate.
b. Objectives: :numerate ' or ) of the topics that 5ou think the lab will teach
5ou. ,2 N2T R:*:AT the wording in the lab manual procedures. There
should be one or two sentences per ob>ective. Remember, 5ou should write
about what 5ou will learn, not what 5ou will do.
c. *rogram: This part contains all the steps reBuired to produce the reBuired
operation. The program written should be verified with the staff member to
correct the flow of the code written.. This section should also include a
description of the experiment by writing suitable codes.
e. Questions: +pecific Buestions !*relab and *ostlab% asked in the lab should be
answered here. Retype the questions presented in the lab and then
formally answer them.
'. Iour work must be original and prepared independentl5. 6owever, if 5ou need an5
guidance or have an5 Buestions or problems, please do not hesitate to approach 5our
staff incharge during office hours. 0op5ing an5 prelab/postlab will result in a low
grade. The incident will be formall5 reported to the Dniversit5 and the students should
follow the dress code in the -ab session.
). :ach laborator5 e7ercise must be completed and demonstrated to 5our +taff (ncharge
in order to receive working program credit. This is the procedure to followF
a. *rogram worksF (f the program works during the lab period !' hours%, call
5our staff incharge and he/she will sign and date it. This is the end of this lab,
and 5ou will get a complete grade for this portion of the lab.
b. *rogram does not workF (f the program does not work, 5ou must make use of
the open times for the lab room to complete 5our lab e7ercise. 4hen 5our
program instructions are read5, contact 5our staff incharge to set up a time
when the two of 5ou can meet to check 5our program.
&. Attendance at 5our regularl5 scheduled lab period is reBuired. An une7pected absence
will result in loss of credit for 5our lab. (f for valid reason a student misses a lab, or
makes a reasonable reBuest in advance of the class meeting, it is permissible for the
student to do the lab in a different section later in the week if approved b5 the staff
incharge of both the sections. 6abituall5 late students !i.e., students late more than &
minutes more than once% will receive # point reductions in their grades for each
occurrence following the first.
7i
$. Jinal grade in this course will be based on laborator5 assignments. All labs have an
eBual weight in the final grade. =rading will be based on preHlab work, laborator5
reports, postHlab and inHlab performance !i.e., completing lab, answering laborator5
related Buestions, etc.,%.The +taff (ncharge will ask pertinent Buestions to individual
members of a team at random. -abs will be graded as per the following grading
polic5F
*reH-ab 4ork 2#.##K
(nH-ab *erformance '#.##K
*ost -ab 4ork 2#.##K
-aborator5 Report '#.##K
". Reports Due DatesF Reports are due one week after completion of the corresponding
lab. A late lab report will have 2#K of the points deducted for being one da5 late. (f a
report is 2 da5s late, a grade of # will be assigned.
1. Systems of Tests: Regular laborator5 class work over the full semester will carr5 a
weight of .&K. The remaining 2&K weight will be given b5 conducting an end
semester practical e7amination for ever5 individual student if possible or b5
conducting a to L hours duration common written test for all students, based on
all the e7periment carried out in the semester.
#. General Procedure:
a. Properly use the microprocessor and microcontroller trainer kit and identif5
the starting address of the RAM locations and trainer instructions in advance.
b. Cnow the instruction set of the processor and the controllers to be used in the
lab classes.
c. Aerif5 the function of all the programs scheduled for the lab session.
d. *roperl5 use the interfacing cable to connect the peripherals to the processor.
e. After the completion of the e7periments switch off the power suppl5 and
return the components.
7ii
SRM UNIVERSITY
Department of Electronics and Communication Engineering
EC0321 Processor Lab
Laboratory Report Cover Sheet
ODD SEM - 2011
NameF MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
+ectionF Tick 2ne M ! % TD ! % 4 ! % Th ! % Jr ! %
AenueF MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
Title of -abF MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
Preparation Verification
+taff Name ; +ignatureF MMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMM
Experiment Completion Verification
+taff Name ; +ignatureF MMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMM
,ate, TimeF MMMMMMMMMMMMMMMMMMMMMM
Particulars Max Marks Marks Obtained
*relab & marks
-ab *erformance 2#marks
*ost lab &marks
Record 2#marks
Total &# marks
Report Verification
+taff Name ; +ignatureF MMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMM
,ate, TimeF MMMMMMMMMMMMMMMMMMMMMM
7iii
CONTENTS
Experiments Page No
Lab 1
. !a% (ntroduction
.2 !a% 6ardware reBuirement
.' !a% *rogram logic
.) !a% *rocedure
.& !a% *re lab Nuestions
.$ !a% -ab Assignment
.. !a% *ost lab Nuestions 2
. !b% (ntroduction 2
.2 !b% 6ardware reBuirement 2
.' !b% *rogram logic 2
.) !b% *rocedure 2
.& !b% *re lab Nuestions 2
.$ !b% -ab Assignment '
.. !b% *ost lab Nuestions '
Lab 2
2. (ntroduction )
2.2 6ardware reBuirement )
2.' *rogram logic )
2.) *rocedure )
2.& *re lab Nuestions )
2.$ -ab Assignment &
2.. *ost lab Nuestions &
Lab 3
'. (ntroduction $
'.2 6ardware reBuirement $
'.' *rogram logic $
'.) *rocedure $
'.& *re lab Nuestions $
'.$ *ost lab Nuestions .
Lab 4
). (ntroduction "
).2 6ardware reBuirement "
).' *rogram logic "
).) *re lab Nuestions "
).& *ost lab Nuestions 1
Lab 5
&. (ntroduction #
&.2 6ardware reBuirement #
&.' *rogram logic #
&.) *re lab Nuestions
&.& *ost lab Nuestions 2
7iv
Lab 6
$. (ntroduction '
$.2 6ardware reBuirement '
$.' *rogram logic '
$.'. wave scheme '
$.'.2 2 phase scheme '
$.'.' half stepping scheme )
$.) *re lab Nuestions )
$.& -ab Assignment )
$.$ *ost lab Nuestions )
Lab 7
.. (ntroduction &
..2 6ardware reBuirement &
..' *rogram logic &
..'. Mode # G (nterrupt on terminal count &
..'.2 Mode G *rogrammable one shot &
..'.'. Mode 2 G Rate =enerator &
..'.) Mode ' G +Buare 4ave =enerator &
..'.& Mode ) G +oftware triggered strobe &
..) *re lab Nuestions .
..& *ost lab Nuestions .
Lab 8
". !a% (ntroduction "
".2 !a% 6ardware reBuirement "
".' !a% *rogram logic "
".'. !a% Mode # G sBuare wave generation "
".'.2 !a% Mode G saw tooth wave generation "
".) !a% *re lab Nuestions 1
".&. !a% -ab Assignments 1
".$ !a% *ost lab Nuestions 1
".. !b% (ntroduction 2#
".2. !b% 6ardware ReBuirement 2#
".'. !b% *rogram -ogic 2#
".'.. !b% 0hannel +election 2#
".'.2. !b% A to , 0onversion 2#
".'.'. !b% To measure voltage in channel 2#
".). !b% *re lab Buestions 2
".& !b% *ost lab Nuestions 2
Lab 9
1. (ntroduction 22
1.2 6ardware reBuirement 22
1.' *rogram 22
1.) *relab 22
1.& *ost lab
7v
Lab 10
#. (ntroduction 22
#.2 6ardware reBuirement 22
#.' *rogram 22
#.) *relab 22
#.& *ost lab 22
Lab 11
. (ntroduction 2)
.2 6ardware reBuirement 2)
.' *rogram 2)
.) *relab 2)
.& *ost lab 2)
Lab 12
2. (ntroduction 2&
2.2 6ardware reBuirement 2&
2.' *rogram 2&
2.) *relab 2&
2.& *ost lab 2&
Lab 13
'. (ntroduction 2$
'.2 6ardware reBuirement 2$
'.' *rogram 2$
'.) *relab 2$
'.& *ost lab 2$
Lab 14
). (ntroduction 2$
).2 6ardware reBuirement 2$
).' *rogram 2$
).) *relab 2$
).& *ost lab
21
Lab 15
&. (ntroduction '#
&.2 6ardware reBuirement '#
&.' *rogram '#
&.) *relab '2
&.& *ostlab '2
Lab 16
$. (ntroduction ''
$.2 6ardware reBuirement ''
$.' *rogram ''
$.) *relab ''
$.& *ost lab ''
7vi
Lab 17
.. (ntroduction '&
..2 6ardware reBuirement '&
..' *rogram '&
..) *relab '&
..& *ost lab '&
Lab 18
". (ntroduction '&
".2 6ardware reBuirement '&
".' *rogram '&
".) *relab '&
".& *ost lab
7vii
Lab 1
Ex.No.1: 16-Bit Addition & Subtraction
1.1(a) Introduction:
The purpose of this e7periment is to add and to subtract the given two $ bit numbers
and store them in a memor5 location. The student should also be able to design the addition
and subtraction with carr5 and borrow.
1.2(a) Hardware Requirement:
The "#"$ Microprocessor kit, *ower +uppl5.
1.3 (a) Program Logic:
The add instruction reBuires either the addend or the augend to be in a register, unless
the source operand is immediate since the addressing modes permitted for the source and
destination are registerHregister, memor5 to register, register to memor5, register to
immediate, and finall5 memor5 to immediate.
6ence one of the operands is initiall5 moved to A?. Then using the add instruction,
$Hbit addition is performed.
The ne7t arithmetic primitive is +DB. As discussed in A,, it permits the same modes
of addressing. 6ence moving the minuend to a register pair is necessar5. Then the result is
moved to a location in memor5.
1.4 (a) Procedure
. :nter the opcodes in ram memor5 from location ### using +DB command
2. Dsing +T:* command, e7ecute the program instruction b5 instruction
'. After each instruction verified register contents and see that the5 are initialised to the
reBuired values.
1.5(a) Pre Lab Questions
. ,ifference between Microprocessor ; MicrocontrollerO
2. ,efine BD+ and give the classification of Buses
'. 4hat is an addressing modeO
). 6ow the Microprocessors can be categoriEedO
&. 4hat is stack and +ubroutineO
$. Mention the features of "#"$O
.. ,efine 2pcode and 2perand
8. Explain how physical address is formed in 8086.
1.6(a) Lab Assignment
1. Write an assembly language program to move the content in
memory location 1100h into register B and also move to register
!" and also store the content in ! in memory location 1#00$.
%. Write an assembly language program to add and subtract the two
16&bit numbers using the program logic given in 1.#. '(se
immediate and direct addressing modes)
#. Write an algorithm for the *uestions 1 + %" and also draw the
,owchart-
1.7(a) Post Lab Questions (Refer the program to answer these questions)
. 0alculate the ph5sical address for the given data. ,+P###h, B*P2')h
2. 4hat is the purpose of 6-T instructionO
'. 4hat happens if the result is greater than $bitO
). =ive the steps to calculate ph5sical addressO
&. (f carr5 is set to before subtraction what is the instruction to be usedO
$. 4hat is the difference between M2A A?, Q##R and M2A Q2##R, A?O
Ex.No:1-B (Multiplication And Division)
1.1.(b)Introduction
The purpose of this e7periment is to multipl5 and to divide the given two $ bit
numbers and store them in a memor5 location.
1.2 (b) Hardware Requirement
The "#"$ Microprocessor kit, *ower +uppl5.
1.3(b) Program Logic
The "#"$ *rocessor provides both signed and unsigned multipl5 in their instruction
set to overcome the loss of efficienc5 in performing the repeated addition.
The MD- instruction can have both $ and " bit operands and the multiplicand is A?
or A-, accordingl5 the result for a b5te multipl5 is a $ bit number in A? while that for a
word multipl5 is a '2 bit number, the lower word of which is in A? and the higher word in
,?.
1.4(b) Procedure
. :nter the opcodes in ram memor5 from location ### using +DB command
2. Dsing +T:* command, e7ecute the program instruction b5 instruction
a. After each instruction verified register contents and see that the5 are initialised to
the reBuired values.
1.5(b) Pre-Lab Questions
. A single instruction ma5 use more than one addressing modes or some instructions
ma5 not reBuire an5 addressing modes. 4h5O
2. 6ow is the addressing mode of an instruction communicated to the 0*DO
'. 6ow does the 0*D identif5 between "Hbit and $Hbit operationO
). 4hat do 5ou mean b5 pipelined architectureO
&. 4hat is a Jlag registerO
$. 4hat is a machine c5cleO
.. 4hat is a status signalO
". 4hat is minimum mode operation of "#"$O
1. 4hat is the ma7imum memor5 addressing and (/2 addressing capabilities of "#"$O
#. Jrom which address the "#"$ starts e7ecution after resetO
1.6(b) Lab Assignment
2
1. Write an assembly language program to move the content in
memory location 1100h into register B and also move to register !"
and also store the content in ! in memory location 1#00h.'(se based
indexed addressing mode)
%. Write an assembly language program to multiply and divide
the two 16&bit numbers using the program logic given in 1... '(se
immediate and direct addressing modes)
#. Write an algorithm for the *uestions 1 + %" and also draw the
,owchart-
1.7(b) Post-Lab Questions (Refer the program to answer these questions)
. -ist out the t5pe of addressing modes used in 5our program.
2. (f result e7ceeds '2 bit where is it storedO
'. 4hat is the name given to the register combination ,?FA?O
). 4hat is the instruction used for signed divisionO
&. (n the above program instead of ,(A B?, is it possible to use ,(A num2O
'
Lab 2
Ex.No.2: Largest and Smallest number in an array
2.1 Introduction:
The purpose of this e7periment is to find the larger and the smaller numbers from an
arra5 which is stored in a memor5 location.
2.2 Hardware Requirement:
The "#"$ Microprocessor kit, *ower +uppl5.
2.3 Program Logic:
To find the largest number in an5 given arra5, the contents of the arra5 must be
compared with an arbitrar5 biggest number. The first number of the arra5 is taken in a register
A-. The second number of the arra5 is compared with the first one. (f the first one is greater
than the second one, it is left unchanged. 6owever if the second one is greater than the first,
the second number replaces the first one in the A- register. The procedure is repeated for
ever5 number in the arra5 and thus it reBuires n iterations. At the end of nth iteration the
largest number will reside in the register A-.
Jor smallest number the above said logic is repeated but, (f the first number is smaller
than the second one it is left unchanged. 2therwise the second number replaces the first
number in the A- register
2.4 Procedure:
. :nter the opcodes in ram memor5 from location ### using +DB command
2. Dsing +T:* command, e7ecute the program instruction b5 instruction
'. After each instruction verified register contents and see that the5 are initialiEed to the
reBuired values
). :7ecute the program and check for results.
2.5 Pre-Lab Questions:
. ,raw the flowchart to find the largest and smallest number of an arra5O
2. 4hat is the similarit5 and difference between +ubtract and 0ompare (nstructionO
'. 4hat are the addressing modes are used in our programO
). (nitialiEe register 0? to value JJJJ and register A? to value ####, write a program to
e7change the contents of both these registerO
&. (llustrate the use of -:A, -,+, and -:+ instruction and to initialiEe registers using
these instructionsO
$. -ogic calculations are done in which t5pe of registersO
.. (n an "#"$ microprocessor program, data and stack memor5 occupies uniform
memor5 space. +tate true or falseO
". :7plain crossHcompiler, linker, editor and debuggerO
1. +uppose that ,+P###h, ++P2###h, B*P###h and ,(P###h. ,etermine the
memor5 address accessed b5 each of the following instructions.
M2A A-, QB* S ,(R
M2A 0?, QB*R
#. Jorm a >ump instruction that >umps to the address pointed b5 the B? registerO
)
2.6 Lab Assignment
1. Write an assembly language program to sort the numbers of an array
in a memory location 1100h and store the largest number of the array in
1%00h and smallest number in the location 1#00h.
2.7 Post-Lab Questions:
. 4hat is the purpose of M2A ,+, A?O
2. 4hat will be the status of flags after e7ecuting the programO
'. 4hat are the addressing modes are used in our programO
). 4hat is the difference between <DM* and -22* instructionsO
&. 4hat instructions are needed to add A-, '- and ,- together, and place the result in
0-O ,o not destro5 B- or ,-.
$. +how the instruction needed to count the number of 3s found in A-. Jor e7ample if
A- contains ####, the number of 3s is ).
&
Lab 3
Ex.No.3: Sorting of an array in ascending and descending series
3.1 Introduction:
The purpose of this e7periment is to sort the seBuence of numbers from the arra5
stored in a memor5 location into ascending and descending series.
3.2 Hardware Requirement:
The "#"$ Microprocessor kit, *ower +uppl5.
3.3 Program Logic:
To arrange the given numbers in ascending and descending order, the bubble sorting
method is used. (nitiall5 the first number of the series is compared with the second one. (f the
first number is greater than second, e7change their positions in the series otherwise leave the
position unchanged. Then compare the second number in the recent form of the series with
third and repeat the e7change part that 5ou are carried out for the first and second number,
and for all the remaining number of the series. Repeat this procedure for complete series !nH%
times. After nH iterations 5ou will get the largest number at the end of the series. Again start
from the first number of the series. Repeat the same procedure right from the first element to
the last element. After nH2 iteration 5ou will get the second highest number at the last but one
place in the series. Repeat this till the complete series is arranged in ascending order.
3.4 Pre-Lab Questions:
. ,raw the flow chart to arrange a given series of numbers in ascending and
descending order.
2. (n a given program how man5 times ,:0 and <NT instructions are e7ecutedO
4hat will be content in A? register after e7ecuting the programO
M2A A?, ##JJ
M2A 0-, #&
R:*:ATF (N0 A?
,:0 0-
<NT R:*:AT
'. 4rite a small program using ,AA instructionO
). 4hich t5pe of >ump instruction !short, near or far% assembles for the followingF
(f the distance is #2#6 b5tes
(f the distance is ##2#6 b5tes
(f the distance is #####6 b5tes
&. (f ,- P #J'6 and ,6 P .26, -ist the difference after ,6 subtracts from ,-,
and show the contents of the flag register bits.
$. 6ow is register A- is used during e7ecution of ?-ATO
.. 4hat conditional >ump instruction should be used after 0M* A-, '#6 to >ump
when A- eBuals '#6O
$
3.5 Post-Lab QuestionsF
. 4hat is the purpose of ?06= instructionO
2. 4hat is the use of *D+6 and *2* instructionO
'. 4rite an assembl5 language program in "#"$ to sort the given arra5 of $Hbit
numbers in descending order.
). 4hat do sBuare brackets means when the5 appear in an operandO
&. 4hat is the difference between M2A A?, # and +DB A?, A?O There ma5 be more
than one difference to comment on.
$. 4rite a routine to swap nibbles in A-. Jor e7ample if A- contains ':, then it will
contain :' after e7ecution.
.
Lab 4
Ex.No.4: Sum of series
4.1 Introduction:
The purpose of this e7periment is to find the sum of seBuence of numbers from the
arra5 stored in a memor5 location and store the result in a specified location.
4.2 Hardware Requirement:
The "#"$ Microprocessor kit, *ower +uppl5.
4.3 Program Logic:
(n this program we show the addition of # numbers and is used as count for number
of additions. The initial sum is assumed as Eero. (nitiall5, the resulting sum of the first two
numbers will be stored. To this sum, the third number will be added. This procedure will be
repeated till all the numbers in the series are added. A conditional <DM* instruction will be
used to implement the counter checking logic.
4.4 Pre-Lab Questions
. ,raw the flowchart to find the sum of series of "Hnumbers in a given arra5 of #
numbersO
2. 4rite a program to find the sum of series with carr5 and verif5 the answer with "#"$
processor kitO
'. =iven an instruction, how do 5ou identif5 the addressing mode of the instruction,
e7plain with e7ampleO
). (dentif5 the t5pe of addressing modes used in the following data transfer operations.
4hen data is moved from A? register to :? and when the data is moved from :7
register to a memor5 location whose address is given b5 ,? register.
&. A 2#Hbit address bus allows access to a memor5 of capacit5
!a% MB
!b% 2 MB
!c% ) MB
!d% " MB
$. *rograms are written in assembl5 language because the5
!a% run faster than 6ighHlevel language
!b% are portable
!c% easier to write than machine code programs
!d% the5 allow the programmer access to registers or instructions that are not
usuall5 provided b5 a 6ighHlevel language
.. 4hat is meant b5 Maskable interruptsO
!a% An interrupt that can be turned off b5 the programmer.
!b% An interrupt that cannot be turned off b5 the programmer.
!c% An interrupt that can be turned off b5 the s5stem.
!d% An interrupt that cannot be turned off b5 the s5stem
8. /s overlapping of segment possible in 8086-
"
4.5 Post-Lab Questions
. 6ow man5 times the <NT instruction e7ecuted in our programO
2. (n our program, -ist out the instructions which are not affected b5 the flags.
'. 4hich are pointers present in this "#"$O
). 4hich Jlags can be set or reset b5 the programmer and also used to control the
operation of the processorO
&. Jind the error in this programO
M2A A-, ##6
M2A B-, #&6
M2A 0-, #26
A=A(NF A,, A-, B-
<NT A=A(N
,:0 0-
M2A ,(, '##6
M2A Q,(R, A-
6-T
$. -ist the instructions that can be used to clear the accumulator or an5 registersO
1
Part II-8086 Microprocessor Interfacing
EXPERIMENT: 5 8255- PROGRAMMABLE PERIPHERAL INTERFACE (PPI)
5.1 Objective
To interface "2&& *rogrammable *eripheral (nterface with "#"$ microprocessor and
to test mode # operation
5.2 Hardware requirements
The "#"$ Microprocessor kit, "2&& *rogrammable *eripheral (nterface add on card,
(nterface cable and *ower +uppl5.
5.3 Theory
The "2&& is a widel5 used, programmable, parallel (/2 device.(t can be programmed to
transfer data under various conditions, from simple (/2 to interrupt (/2.
Jeatures
Three "Hbit (2 ports *A, *B, *0
*A can be set for Modes #, , 2. *B for #, and *0 for mode # and for B+R. Modes
and 2 are interrupt driven.
*0 has two )Hbit portsF *0 upper !*0D% and *0 lower !*0-%, each can be set
independentl5 for (nput or 2utput. :ach *0 bit can be set/reset individuall5 in B+R
mode.
*A and *0D are =roup A !=A% and *B and *0- are =roup B !=B%
Address/data bus must be e7ternall5 demultiple7ed.
"2&& can be operated in two modes
BSR (Bit Set Reset ) mode or
i. (/2 mode
ii. B+R mode
Bit set/reset, applicable to *0 onl5. 2ne bit is +/R at a time.
0ommand word
,. ,$ ,& ,) ,' ,2 , ,#
# !#PB+R% ? ? ? B2 B B# +/R !P+,#PR%
#
Bit selectF !Taking ,onUt careUs as #%
B2
B
B
#
*0
bit
0ontrol word
!+et%
0ontrol word
!reset%
# # # # #### ### P #h #### #### P ##h
# # #### ## P #'h #### ### P #2h
# # 2 #### ## P #&h #### ### P #)h
# ' #### # P #.h #### ## P #$h
# # ) #### ## P #1h #### ### P #"h
# & #### # P #Bh #### ## P #Ah
# $ #### # P #,h #### ## P #0h
. #### P #Jh #### # P #:h
I/O mode
The (/2 mode is further divided into three modesF
Mode # F all ports function as simple (/2 ports
Mode F 6and shake mode whereb5 *orts A and/or B use bits from port 0 as handshake
signals
Mode 2. F *ort A can be set up for bidirectional data transfer using handshaking signals from
*ort 0, and *ort B can be set up either in Mode # or Mode .
Command word
,. ,$ ,& ,) ,' ,2 , ,#
!P(/2% =A mode select *A *0D =B mode select *B *0-
,$, ,&F =A mode selectF
o ## P mode#
o # P mode
o ? P mode2
,)!*A%, ,'!*0D%F Pinput #Poutput
,2F =B mode selectF #Pmode#, Pmode
,!*B%, ,#!*0-%F Pinput #Poutput
*ort Address
Register Address
0ontrol word register 0$
*ort A 0#
*ort B 02
*ort 0 0)
5.4 Pre-lab Questions