Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multiplication 568 423.

Similar presentations


Presentation on theme: "Multiplication 568 423."— Presentation transcript:

1 Multiplication 568 423

2 568 423 4 Multiplication Operation
1. multiply two digits, save the carry 568 423 4 Carry: 2

3 568 423 04 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 568 423 04 Carry: 2

4 568 423 1504 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 568 423 1504 Carry:

5 568 423 1504 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 4. multiply a number by a digit 568 423 1504 Carry:

6 568 423 1504 1136 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 4. multiply a number by a digit 568 423 1504 1136 Carry:

7 568 423 1504 1136 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 4. multiply a number by a digit 5. shift a number 1 digit to the left 568 423 1504 1136 Carry:

8 568 423 1504 1136 12864 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 4. multiply a number by a digit 5. shift a number 1 digit to the left 6. add two numbers 568 423 1504 1136 12864 Carry:

9 568 423 1504 1136 12864 2272 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 4. multiply a number by a digit 5. shift a number 1 digit to the left 6. add two numbers 568 423 1504 1136 12864 2272 Carry:

10 568 423 1504 1136 12864 2272 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 4. multiply a number by a digit 5. shift a number k digits to the left 6. add two numbers 568 423 1504 1136 12864 2272 Carry:

11 568 423 1504 1136 12864 2272 240064 Multiplication Operation
1. multiply two digits, save the carry 2. multiply two digits, add the carry, save the carry 3. multiply two digits, place result 4. multiply a number by a digit 5. shift a number k digits to the left 6. add two numbers 568 423 1504 1136 12864 2272 240064 Carry:

12 Multiplication What functions do we need:
1. addNum(n1, n2) – two integers as input, output is the sum 2. shilfLeft(n, k) – an integer n and a shift number k, output is n multiplied by 10 raised to power k 3. multiplyLine(n, d) – an integer n and a digit d as input, output is n times d.

13 Multiplication function number = multiplyNum(n1, n2); number = [];
k=0; % line multiply shifts k position for i=length(n2):-1:1 number = addNum(number, shiftLeft(multiplyLine(n1,n2(i)),k)); k = k+1; end


Download ppt "Multiplication 568 423."

Similar presentations


Ads by Google