Professional Documents
Culture Documents
17
Ex. No:2 CODE CONVERSION AND MATRIX MULTIPLICATION
DATE:
2. a) CODE CONVERSION
AIM:
APPARATUS REQUIRED:
ALGORITHM:
18
Output:
19
PROGRAM:
RESULT:
Thus the code conversion has been performed using 8086 processor.
20
FLOW CHART
21
2. b) MATRIX MULTIPLICATION
AIM:
APPARATUS REQUIRED:
ALGORITHM:
1. Get the start addresses of first matrix, second matrix and the result matrix.
2. Move the first and second matrices into AL and BL respectively.
3. Multiply the contents of first row and first column and store the result in the first location
in the result matrix.
4. Increment the result matrix location and store the product of first row and second column
in the new location.
5. Repeat the above steps till the end of the result location is reached.
6. Stop the program.
PROGRAM
22
OUTPUT:
23
RESULT:
Thus the Matrix multiplication has been performed using 8086 processor.
24
FLOWCHART
Parallel interface
START
START
Store control word in control register
STOP
STOP
25
Ex. No:3 INTERFACING WITH 8086-PARALLEL COMMUNICATION
INTERFACE
DATE:
AIM:
To write ALP by interfacing 8255 with 8086 in mode 0, mode 1 and mode 2
APPARATUS REQUIRED:
8086 kit, 8255 interface kit.
ALGORITHM:
Mode 0
1. Initialize accumulator to hold control word
2. store control word in control word register
3. Read data port A.
4. Store data from port A in memory
5. Place contents in port B
26
OUTPUT:
27
28
29
RESULT:
Thus the ALP for interfacing 8255 with 8086 in mode 0, mode 1 and mode 2 was written
and executed successfully,
30
FLOW CHART:
SERIAL INTERFACE AND PARALLEL INTERFACE
START
No
Is it High
Yes
STOP
31
Ex. No:4 INTERFACING WITH 8086-SERIAL COMMUNICATION
INTERFACE
DATE:
AIM:
To write an 8086 ALP to transmit and receive data between two serial ports.
APPARATUS REQUIRED:
8086 kit (2 Nos), RS232 cable.
ALGORITHM:
1. Initialize 8253 and 8251 to check the transmission and reception of a character
2. Initialize8253 to give an output of 150Khz at channel 0 which will give a 9600 baud rate of
8251.
3. The command word and mode word is written to the 8251 to set up for subsequent operations
4. The status word is read from the 8251 on completion of a serial I/O operation, or when the
host CPU is checking the status of the device before starting the next I/O operation
32
OUTPUT:
33
RESULT :
Thus the 8086 ALP for transmit and receive a data between two serial ports was written
and executed successfully.
34
FLOWCHART:
START
SET UP
POINTER
INITIALIZE THE COUNTER
DELAY
35
Ex. No : 5 INTERFACING WITH 8086 – KEYBOARD AND DISPLAY
CONTROLLER
DATE:
AIM :
To display the rolling message “HELP US “in the display.
APPARATUS REQUIRED:
8086 Microprocessor kit, Power supply, interfacing board.
ALGORITHM:
Display of rolling message “HELP US “
1. Initialize the counter
2. Set 8279 for 8 digit character display, right entry
3. Set 8279 for clearing the display
4. Write the command to display
5. Load the character into accumulator and display it
6. Introduce the delay
7. Repeat from step 1.
PROGRAM TABLE
36
OUTPUT:
LOOK-UP TABLE:
37
RESULT:
Thus the assembly language program for interfacing keyboard and display with 8086
processor was written and executed successfully.
38
FLOW CHART:
Start
Stop
Manual calculation
70H = 0111 0000
20H= 0010 0000 (+)
SUM=
Input:
ADDRESS DATA
Output:
39
EX.NO:6 ARITHMETIC AND LOGIC INSTRUCTIONS USING 8051
MICROCONTROLLER
DATE:
AIM:
To learn to write an assembly language program for performing addition of two 8-bit data
using 8051.
APPARATUS REQUIRED:
1)8051 micro controller kit
2) Power supply unit.
ALGORITHM:
1) Start the program
2) Get the data
3) Add two data
4) Store the result
5) Stop the program
PROGRAM:
RESULT:
Thus the assembly language program for performing 8-bit addition using 8051 is
performed and the output is justified.
40
FLOW CHART:
Start
Stop
Manual calculation
70H = 0111 0000
20H= 0010 0000 (-)
Difference=
Input:
ADDRESS DATA
Output:
41
6. b) 8- BIT SUBTRACTION
AIM:
To learn to write an assembly language program for performing 8- bit subtraction using
8051.
APPARATUS REQUIRED:
1)8051 micro controller kit
2) Power supply unit.
ALGORITHM:
1) Start the program
2) Get the data
3) Subtract two data
4) Store the result
5) Stop the program
PROGRAM:
RESULT:
Thus the assembly language program for performing 8-bit subtraction using 8051 is
performed and the output is justified.
42
FLOW CHART
Start
Stop
Manual calculation
06H = 0000 0110
02H= 0000 0010 (*)
Product=
INPUT:
ADDRESS DATA
OUTPUT:
43
6.C) 8-BIT MULTIPLICATION
AIM:
To learn to write an assembly language program for performing 8- bit multiplication
using 8051.
APPARATUS REQUIRED:
1)8051 microcontroller
2) Power supply
ALGORITHM:
PROGRAM:
RESULT:
Thus the assembly language program for performing 8-bit multiplication using 8051
is performed and the output is justified.
44
FLOW CHART
Start
Stop
Manual calculation
(A): 06H = 0000 0110
(B): 02H = 0000 0010 /
Divisor=
Input:
ADDRESS DATA
Output:
45
6.D). 8 - BIT DIVISION
AIM:
To learn to write an assembly language program for performing 8- bit division using 8051.
APPARATUS REQUIRED:
1)8051 microcontroller
2) Power supply
ALGORITHM:
PROGRAM:
RESULT:
Thus the assembly language program for performing 8-bit division using 8051 is
performed and the output is justified.
46
47
6.E) LOGICAL OPERATIONS USING 8051
AIM
To write an assembly language program to find logical operation using 8051.
APPARATUS REQUIRED
S.No Apparatus Specification Quantity
1 8051 kit - 1
2 Power supply I/P 230V, O/P 5V 1
1. OR OPERATION
Program
48
OUTPUT
49
2. AND OPERATION
Program
3. XOR OPERATION
Program
50
OUTPUT
51
RESULT
Thus the assembly language program for logical operation using 8051 was written and executed
successfully.
52
FLOWCHART:
START
DELAY
DECREMENT COUNTER
YES
IS B = 0 ?
NO
GET THE DATA FROM LOOK UP
TABLE
53
Ex. No: 7 STEPPER MOTOR INTERFACING WITH 8051 MICROCONTROLLER
DATE:
AIM:
To write an assembly language program in 8086 to rotate the motor at different speeds.
APPARATUS REQUIRED:
1. 8051 1
Microcontroller kit
2. +5 V, dc,+12 V dc 1
Power Supply
3. - 1
Stepper Motor Interface board
4. - 1
Stepper Motor
ALGORITHM:
For running stepper motor clockwise and anticlockwise directions
(i) Get the first data from the lookup table.
(ii) Initialize the counter and move data into accumulator.
(iii) Drive the stepper motor circuitry and introduce delay
(iv) Decrement the counter is not zero repeat from step(iii)
(v) Repeat the above procedure both for backward and forward directions.
54
55
PROGRAM
56
57
RESULT:
Thus the assembly language program for interfacing 8051 with stepper motor control was
executed successfully.
58