Running 2 Youtube Channel : The Masti Adda (Fun based ) : The Knowledge Adda (Knowledge based) : Subscribe for Knowledge with Fun....

Multiplication using techniques of repeated addition

Written by @
Aim: Write a program to multiply 05 by 08 using the technique of repeated addition and store output at external memory 3020H.
Apparatus Used: Micro-controller kit.
Assumption: Multiplication can be achieved by adding the multiplicand repeatedly as many times as the multiplier. As 05*08
05+05+05+05+05+05+05+05=40
Algorithm:
  • Firstly clear the accumulator.
  • Load Multiplier in a Register R2.
  • Add multiplicand to the Accumulator.
  • Now Add multiplicand to accumulator till  R2=0.
  • Initialize the memory location to store Output.
  • Store output at given location. 
Program:
 
Description of used instruction:

MOV: Used for Load and Copy the Data. This copies a byte from the source location to destination. 
ADD: This adds the source byte to the accumulator and keeps result in accumulator. 
DJNZ: In this instruction a byte is decremented, and if result is not zero it will jump to the target address. 
MOVX: This instruction transfer data between external memory and register. 
DPTR: This is Data Pointer. It is used for containing 16 bit data or memory address. 
SJMP: Short Jump loop is used for indefinite loop within program.

Result:
Output:  A=05*08=40 (28) H and it will store at external memory 3020H.
Procedure to look output:
·         After ending (SJMP) the program, press Enter two times.
·         You will get message “Welcome to ------KIT”.
·         Press G and Provide initial address of program as in this program, starting address is 3000 H.
·         Press Enter.
·         After pressing Enter, You will get Message “Execution Completed”.
·         Press Reset on micro-controller KIT.
·         Press M and You will get Message “Enter Address”.
·         Provide Address for Output as in this Program 3020H and Press Space and you get Output.


1 comment:

  1. Here are soje insightful quotes I like... Lemme know if
    you like them:

    "Imagination is more important than knowledge.

    "I, at any rate, am convinced that He (God) doesn't throw dice."

    "The significant matter is not to stop questioning; fascination has its own reason for existing."

    "Science without religion is lame, religion without science is blind."

    "Two things are infinite: the universe and human stupidity; and I'm not
    certain about the universe."

    "Falling in love isn't at all the most dumb thing that people do -- but gravitation cannot be
    held responsible for it."

    "The most beautiful experience we can have is the mysterious.
    It is the fundamental emotion that stands at the cradle of true art and true science."

    "Anyone who hasn't made a mistake has never tried anything new."


    "Try not to become a man of success, but instead try to become
    a man of worth"

    Feel free to surf to my webpage :: taxi fee calculator

    ReplyDelete