You are on page 1of 42

FLOW CHART

DECIMAL TO HEXADECIMAL CODE CONVERSION

17
Ex. No:2 CODE CONVERSION AND MATRIX MULTIPLICATION
DATE:

2. a) CODE CONVERSION

AIM:

To perform BCD to Hexadecimal code conversion using 8086 microprocessor.

APPARATUS REQUIRED:

8086 Microprocessor Kit.

ALGORITHM:

1. Start the program


2. Move the data for memory location to reg AL
3. Move the data for memory location to reg AL
4. Apply the logical AND of AH reg content with 0F
5. Move the result of logical operation to BL.
6. Apply the logical AND of AL with F0H
7. Initialize the lower order C reg of 04H and rotate the AL reg content
8. Multiply the AL reg content with 04H
9. Add the result with BL reg content
10. Move the equivalent binary from AL reg content to memory location
11. Halt the program

18
Output:

19
PROGRAM:

RESULT:

Thus the code conversion has been performed using 8086 processor.

20
FLOW CHART

21
2. b) MATRIX MULTIPLICATION

AIM:

To perform multiplication of two 3x3 matrices using 8086 micrprocessor

APPARATUS REQUIRED:

8086 Microprocessor Kit.

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

Mode 0 Mode 1 & 2

START
START
Store control word in control register

Store control word in


control register
Input to be read from port A

Input to be read from port A


Disable all interrupts except RST
6.5
Store into accumulator
Store output to port B
Output written on port B

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

Mode 1 & Mode 2


1. Initialize accumulator to hold control word (for port A)
2. Store control word in control word register
3. Initialize accumulator to hold control word (for port B)
4. Place contents in control word register.
5. Disable all maskable interrupts, enable RST 5.5
6. send interrupt mask for RST 6.5 & 7.5
7. Enable interrupt flag
8. Read data from port A, 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

Check TX/RX Ready

No

Is it High
Yes

Write Data into data register

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:

KEYBOARD AND DISPLAY

START

SET UP
POINTER
INITIALIZE THE COUNTER

SET 8279 FOR 8-DIGIT CHARACTER


DISPLAY

SET 8279 FOR CLEARING THE


DISPLAY

WRITE THE COMMAND TO DISPLAY

LOAD THE CHARACTER INTO


ACCUMULATOR AND DISPLAY

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

Get the data

Add the values

Store the result

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:

6.a) 8- BIT ADDITION

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

Get the data

Subtract the values

Store the result

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

Get the data

Multiply the values

Store the result

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:

1) Start the program


2) Get the two data
3) Multiply two data
4) Store the results
5) Stop the program

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

Get the data

Divide the values

Store the result

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:

1) Start the program


2) Get the two data
3) Divide two data
4) Store the results
5) Stop the program

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:

STEPPER MOTOR CONTROL

START

INTIALIZE COUNTER FOR LOOK UP TABLE

GET THE FIRST DATA FROM THE ACCUMULATOR

MOVE DATA INTO THE ACCUMULATOR

DRIVE THE MOTOR


CIRCUITARY

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:

SL.NO COMPONENTS SPECIFICATION QUANTITY

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

You might also like