Professional Documents
Culture Documents
8051 Programs Using Kit: Exp No: Date: Arithmetic Operations Using 8051
8051 Programs Using Kit: Exp No: Date: Arithmetic Operations Using 8051
8051 Programs Using Kit: Exp No: Date: Arithmetic Operations Using 8051
To perform the arithmetic operations such as addition, subtraction, multiplication and division
on 8051 microcontroller
Apparatus Required:
8051 microcontroller Trainer kit – 1nNo
8-bit Addition
Algorithm:
1. Start
2. Get the I operand in accumulator and the II operand with the content of accumulator
using ADD
3. Store the result in memory
4. Stop the execution
Program:
Flowchart:
START
Move Data-1 to A
STOP
Test data:
Inputs: A =72H
A = 15H
Output: 87
Output Screenshots:
8-bit Subtraction:
Algorithm:
1. Start
2. Get the two numbers, which are to be subtracted
3. Subtract the two numbers using SUBB and store the result in the corresponding memory
location
4. Stop
Program:
Test data:
Inputs: A – 72H Output: 5D
A – 15H
Output Screenshots:
8-bit multiplication
Algorithm:
1. Start
2. Get the two numbers, which are to be multiplied
3. Multiply the two numbers using MUL and store the LSB of result in the accumulator and
MSB of result in register
4. Stop the execution
Program:
MUL AB Multiply A, B
MOV 01H, A
MOV 02H, A
Flow chart:
Start
Get multiplier in A
Get multiplicand in B
Multiply A and B
Stop
Test data:
DATA2 = 15H
Outputs: 95A
8 –bit Division
Algorithm:
1. Start
2. Get the two numbers, which are to be divided
3. Divide the two numbers using DIV and store the question in the accumulator and remainder
in register B
4. Stop the execution
Program:
Get dividend in A
Get divisor in B
Divide A by B
stop
Test data:
Output Screenshots:
Result:
Thus the above programs have been implemented and executed and the required outputs have been
obtained.
EXP NO: DATE:
Aim:
Apparatus Required:
Algorithm:
Program:
START
STOP
Program:
MOV A, B
MOV 02H, A
STOP STOP: SJMP STOP
Output Screenshots:
Result:.
Thus the above program has been implemented and executed and the required output has
been obtained.
Algorithm:
Output Screenshots:
Result:
Thus the above program has been implemented and executed and the required output has been
obtained.