MPMC Lab Maual EXP 1,2s
MPMC Lab Maual EXP 1,2s
MPMC Lab Maual EXP 1,2s
LAB IN-CHARGE
Dr.K.Shanthi, Dr.S.Prema, Dr.N. Manikanda Prabu, Mr.M.Navin Kumar,
Mr.R.R.Thirunavukkarasu
OBJECTIVES
Students should report to the concerned labs as per the time table schedule
While entering into the LAB students should wear their ID cards, shoes and
proper uniform.
Students should come with observation and record note book to the laboratory.
Students are required to prepare thoroughly to perform the experiment before
coming to the Laboratory
After completion of the experiment, certification of the concerned staff in-charge
in the observation book is necessary
The record of observations along with the detailed experimental procedure of the
experiment performed in the immediate last session should be submitted and
certified by the staff in-charge
TABLE OF CONTENTS
Page
S.No Name of the experiment
No.
10
11
Objective
To study the microprocessor 8086
8086 MICROPROCESSOR
Features of 8086 microprocessor
It is a 16 bit µp.
8086 has a 20 bit address bus can access upto 220 memory locations (1 MB) .
It can support upto 64K I/O ports.
It provides 14, 16-bit registers.
It has multiplexed address and data bus AD0- AD15 and A16 – A19.
It requires single phase clock with 33% duty cycle to provide internal timing.
8086 is designed to operate in two modes, Minimum and Maximum.
It can prefetch upto 6 instruction bytes from memory and queues them in order to speed up
instruction execution.
It requires +5V power supply.
Architecture of 8086
The BIU performs all bus operations such as instruction fetching, reading and
writing operands for memory and calculating the addresses of the memory operands. The
instruction bytes are transferred to the instruction queue.
•EU executes instructions from the instruction system byte queue.
SEGMENT REGISTERS
CS - points at the segment containing the current program.
DS - generally points at segment where variables are defined.
ES - extra segment register, it's up to a coder to define its usage.
SS - points at the segment containing the stack.
AD15-AD0 : These are the time multiplexed memory I/O address and data lines.
A19/S6,A18/S5,A17/S4,A16/S3 : These are the time multiplexed address and
status lines.
BHE/S7 : The bus high enable is used to indicate the transfer of data over the
higher order ( D15-D8 ) data bus
RD – Read : This signal on low indicates the peripheral that the processor is
performings emory or I/O read operation
READY : This is the acknowledgement from the slow device or memory that
they have completed the data transfer
INTR-Interrupt Request : This is a triggered input. This is sampled during
the last clock cycles of each instruction to determine the availability of the re-
quest
TEST : This input is examined by a ‘WAIT’ instruction
CLK- Clock Input : The clock input provides the basic timing for processor
operation and bus ontrol activity
MN/MX : The logic level at this pin decides whether the processor is to operate in
either minimum or maximum mode.
M/IO – Memory/IO : This is a status line logically equivalent to S2 in maxi-
mum mode. When it is low, it indicates the CPU is having an I/O operation,
and when it is high, it indicates that the CPU is having a memory operation
Result:
Thus 8086 Microprocessor was studied successfully.
OBJECTIVE:
To write the assembly language program to perform arithmetic operation
using 8086 microprocessors.
PRE LAB-WORK
ALGORITHM:
FLOWCHART
IN LAB WORK
PROGRAM : ADDITION
Input
Output
ALGORITHM:
FLOWCHART
IN LAB WORK
PROGRAM : SUBTRACTION
Input
Output
ALGORITHM:
FLOWCHART
IN LAB WORK
PROGRAM : MULTIPLICATION
Input
Output
ALGORITHM:
FLOWCHART
IN LAB WORK
PROGRAM : DIVISION
Input
Output
Post‐Lab Questions:
1. Define microprocessor.
2. Write any 4 addressing modes used in 8086 microprocessors.
3. List the applications of microprocessor.
4. What is BIU and EU?
5. Mention any four types of instruction set used in 8086 microprocessors.
RESULT:
Thus the program for addition, subtraction, multiplication and division of given data was
executed and verified.
OBJECTIVE:
To write an Assembly Language Program for finding the smallest and largest
element in an array using 8086 trainer kit.
ALGORITHM:
FLOWCHART
Fig: Finding the largest number Fig: Finding the smallest number
IN LAB WORK
PROGRAM
Output (Smallest/Largest)
Post‐Lab Questions:
RESULT:
Thus the program for finding the largest and smallest data from a given array was
executed and verified
Objective
To study the 8051 microcontroller
8051 MICROCONTROLLER
FEATURES:
8-bit ALU, Accumulator and 8-bit Registers; hence it is an 8-bit microcontroller
8-bit data bus - It can access 8 bits of data in one operation
16-bit address bus - It can access 216 memory locations - 64 KB (65536 locations) each
of RAM and ROM
On-chip RAM - 128 bytes (data memory) and On-chip ROM - 4 kByte (program
memory)
Four byte bi-directional input/output port
UART (serial port)
Two 16-bit Counter/timers
Two-level interrupt priority
ARCHITECTURE OF 8051
1.ALU
All arithmetic and logical functions are carried out by the ALU.
2. Program Counter (PC)
A program counter is a 16-bit register and it has no internal address. The PC holds the
address of the next instruction residing in memory
3. Registers
Registers are usually known as data storage devices. 8051 microcontroller has 2
registers, namely Register A and Register B. Register A serves as an accumulator while
Register B functions as a general purpose register.
8051 microcontroller also has 7 Special Function Registers (SFRs). They are:
1. Serial Port Data Buffer (SBUF)
2. Timer/Counter Control (TCON)
3. Timer/Counter Mode Control (TMOD)
4. Serial Port Control (SCON)
5. Power Control (PCON)
PIN DESCRIPTION
Pins 1 – 8:- Recognized as Port 1. Different from other ports, this port doesn’t provide any
other purpose. Port 1 is a domestically pulled up, quasi bi directional Input/output port.
Pin 9:- As made clear previously RESET pin is utilized to set the micro-controller 8051 to its
primary values, whereas the micro-controller is functioning or at the early beginning of
application. The RESET pin has to be set elevated for two machine rotations.
Pins 10 – 17:- Recognized as Port 3. This port also supplies a number of other functions such
as timer input, interrupts, serial communication indicators TxD & RxD, control indicators for
outside memory interfacing WR & RD, etc. This is a domestic pull up port with quasi bi
directional port within.
Pins 18 and 19:- These are employed for interfacing an outer crystal to give system clock.
Pins- 21-28:- Recognized as Port 2 (P 2.0 – P 2.7) – other than serving as Input/output port,
senior order address bus indicators are multiplexed with this quasi bi directional port.
Pin- 29:- Program Store Enable or PSEN is employed to interpret sign from outer program
memory.
Pin-31:- Address Latch Enable or ALE is brought into play to de-multiplex the address data
indication of port 0 (for outer memory interfacing). Two ALE throbs are obtainable for every
machine rotation.
Pins 32-39: Recognized as Port 0 (P0.0 to P0.7) – other than serving as Input/output port,
low order data & address bus signals are multiplexed with this port (to provide the use of
outer memory interfacing). This pin is a bi directional Input/output port (the single one in
microcontroller 8051) and outer pull up resistors are necessary to utilize this port as
Input/output.
Pin-40: Termed as Vcc is the chief power supply. By and large it is +5V DC.
Result:
Thus the 8051 Microcontroller was studied successfully
OBJECTIVE:
To write an assembly language program to convert BCD to Binary number and Binary
to BCD number using 8051 microcontroller kit.
SYSTEM AND SOFTWARE TOOL REQUIRED:
1. 8051 microcontroller kit
2. Keyboard
ALGORITHM:
a) BCD to Binary
Step 1: Start the program.
Step 2: Initialize the data pointer and Move it to A and R0
Step 3: Perform AND operation for value of A with 0FH
Step 4: Move the values of A to R1
Step 5: Move the value of R0 to A
Step 6: Perform AND operation for value of A with F0H.
Step 7: Rotate right the contents of A 4 times
Step 8: Move the value of 0AH to B and multiply the values of A and B
Step 10: Add the content of A and R1
Step 11: Increment DPTR and move the value of A to it.
Step 12: Stop the program.
b) BCD to Binary
Step 1: Start the program.
Step 2: Initialize the data pointer and Move it to A and R0
Step 3: Perform AND operation for value of A with 0FH
Step 4: Move the values of A to R1
Step 5: Move the value of R0 to A
Step 6: Perform AND operation for value of A with F0H.
Step 7: Rotate right the contents of A 4 times
Step 8: Move the value of 0AH to B and multiply the values of A and B
Step 9: Add the content of A and R1
Step 10: Increment DPTR and move the value of A to it.
Step 11: Stop the program.
FLOW CHART
START
STOP
START
STOP
1. Upon reset, all ports of the 8051 are configured as _____________ (output, input).
2. Which ports of the 8051 have internal pull‐up resistors?
3. Which ports of the 8051 require the connection of external pull‐up resistors in order to be
used for I/O? Show the drawing for the connection
IN LAB WORK
PROGRAM
i) Binary to BCD
Memory Label Mnemonics Opcode Comment
MOV DPTR,#4500 Initialize DPTR as 4500
MOVX A,@DPTR Move the content of
DPTR to A
MOV B,#64 Move the value 64 to B
DIV AB Divide the content of A
by B
INC DPTR Increment the content of
DPTR
MOVX @DPTR,A Move the content of A to
DPTR
MOV A,B Move the content of B to
A
MOV B,#0A Move the 0AH to B
DIV AB Divide the content of B
by A
INC DPTR Increment the content of
DPTR
MOVX @DPTR,A Move the content of A to
DPTR
MOV A,B Move the content of B to
A
INC DPTR Increment the content of
DPTR
MOVX @DPTR,A Move the content of A to
DPTR
HERE SJMP HERE Short jump to HERE
RESULT:
Thus an assembly language program to convert BCD to Binary number and Binary
to BCD number using 8051 microcontroller kit was executed and its output is verified.