Lab Experiments 1 and 2
Lab Experiments 1 and 2
(18EC2205)
LABORATORY MANUAL
2019-2020
Course Coordinator
Dr. N.Prabakaran, Associate Professor
Course Instructors
Mr.NageshMantravadi, Associate Dean
Mr.Venkata Suman, Assistant Professor
Mrs. K.V.Sowmya, Assistant Professor
Mrs.V.Teju, Assistant Professor
Mr.Khanal Madhav Prasad, Assistant Professor
Mr.K.T.P.S.kumar, Assistant Professor
This lab session has three components: pre-lab session, in-lab session and post lab session.
The pre-lab work should complete at home well before the regular lab session.
The inlab component is performed in the laboratory at specified time slots.
The post-lab is performed outside of regular laboratory hours to complete the lab report.
In lab Session
1. Complete the Pre-lab work evaluation session from your lab instructors.
2. Receive the components and make the connection as per the lab instructors approved design.
3. Upload the compiled codes into the MCU 8051/Arduino/Raspberry pi boards and execute the
codes for the exercises and observe the output/ results.
4. Complete all the tasks given in the exercises and get verification from the lab instructors.
5. Note the results and store the necessary figures and data for the lab report.
6. Answer the viva questions to test your understanding of the lab material.
Year/Semester: II/1
Course Title: Embedded Controllers
L-T-P-
Course Code: 18EC2205 2-0-3-2
S
4 (a) Design Doorbell Music Synthesis with buzzer using Arduino Microcontroller Board.
(b) Optional: Doorbell Tone/Music may also be synthesized.
5
Design Temperature controlled fan with LM35 and Arduino Microcontroller Board.
6 Design a Traffic Light controller System using Microcontroller 8051 Programming.
Design a System to count the number of students entering to a class. And then:
(b) Also send the Data to PC using RS-232 interfaced with Microcontroller 8051.
(a) Develop an Assemble Language/ C Program to interface a DC Motor and L293D driver with
Microcontroller 8051.
8
(b) Optional: Design the prototype of Elevator with DC Motor and L293D using 8051
programming.
4
Design Weather Monitoring System for IOT application using a Microcontroller Board.
ID NO:
Pre Lab Session In Lab Session Post Lab VIVA(5 M) Total Marks
Work(5M) Work (15 M) Session Work
(5 M) (30 M)
Remarks:
Pre-Lab Work:
8086 has 16-bit flag register, and there are 9 valid flag bits. The format of flag register is like
below.
Bit D D D D D D D D D D D D D D D D
s 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Fla O D I T S Z A P C
Bit D D D D D D D D D D D D D D D D
s 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
gs C Y
In 8086 there are 6 different flags which are set or reset after 8-bit or 16-bit operations. These
flags and their functions are listed below.
Flag Bit Function
S After any operation if the MSB is 1, then it indicates that the number is negative. And
this flag is set to 1
AC When some arithmetic operations generates carry after the lower half and sends it to
upper half, the AC will be 1
P This is even parity flag. When result has even number of 1, it will be set to 1,
otherwise 0 for odd number of 1s
CY This is carry bit. If some operations are generating carry after the operation this flag
is set to 1
O The overflow flag is set to 1 when the result of a signed operation is too large to fit.
PROGRAM:
RESULT:
EXPERIMENT NO.1b:
AIM: To Develop an Assembly language Program to find No. of Positive numbers and No.
of Negative numbers in a given Array
SOFTWARE USED: Emu8086
Pre-Lab Work:
Standard numbers, anything greater than zero, are described as ‘positive’ numbers. We don’t
put a plus sign (+) in front of them because we don’t need to since the general understanding
is that numbers without a sign are positive.
Numbers that are less than zero are known as 'negative' numbers. These have a minus sign (−)
in front of them to indicate that they are less than zero (for example, -10 or 'minus 10').
PROGRAM:
RESULT:
Viva Questions:
1. What is the difference between min mode and max mode of 8086?
2. What is the difference between near and far procedure?
3. What is the difference between Macro and procedure?
4. What is the difference between instructions RET & IRET?
5. What is the difference between instructions MUL & IMUL?
6. What is the difference between instructions DIV & IDIV?
7. What is difference between shifts and rotate instructions?
8. Which are strings related instructions?
9. Which are addressing modes and their examples in 8086?
10. What does u mean by directives?
EXPERIMENT NO.2:
AIM: Write ALP to Sort the Array of Numbers in ascending and descending order using
8086 Programming.
ID NO:
Pre Lab Session In Lab Session Post Lab VIVA(5 M) Total Marks
Work(5M) Work (15 M) Session Work
(5 M) (30 M)
Remarks:
Pre-Lab Work:
Here we are sorting the number in bubble sorting technique. In this sorting technique there
will be n passes for n different numbers. In ith pass the ith largest element will be placed at the
end. This is comparison based sort. We taking two consecutive numbers, compare them, and
then swap them if the numbers are not in correct order. The following diagram is showing
how the sorting is working.
Input
Address Data
… …
500 06
501 51
502 24
503 2C
504 CF
505 3E
506 45
… …
Flow Diagram:
PROGRAM:
Result:
1. Save the screenshot/Pictures of Program and output obtained, and bring printout of the
same in next lab.
Viva Questions:
1. What is the size of instruction queue in 8088?
2. Which are the registers present in 8086?
3. What is pipelining in 8086?
4. How many 16 bit registers are available in 8086?
5. Specify addressing modes for any instruction?
6. What are assembler directives?
7. What .model small stands for?
8. What is the supply requirement of 8086?
9. What is the relation between 8086 processor frequency & crystal frequency?
10. Functions of Accumulator or AX register?