Calculator Flowchart 8051
Calculator Flowchart 8051
Calculator Flowchart 8051
Start
LCD initialization
Read Input
Calculate Result
Print output
OP = ADD?
Result is
Negative?
YES
YES
LCD
initialization
Read Key
NO
YES
Calculate
Result
Print valid
input on
LCD
Clear ACC
YES
NO
Convert
result to
ASCII then
print on
LCD
OP = MUL?
Print Output
Convert numbers
from ASCII to Bin
by masking higher
nibble
YES
Divide result by 10
Multibly the two
operands and
save results
NO
Save Operands/
Operation in RAM
byte for each one
Increment DPTR
for next code
Convert
Quotient to
ASCII then
print to LCD
OP = DIV?
ACC = ZERO?
YES
RET
NO
Have entered
operands and
operation?
YES
NO
OP = SUB?
Check If Valid
Read Input
NO
YES
Divide the two
operands and
save results
NO
Convert
remainder
to ASCII
then print
on LCD
RET
RET
RET
NO