Post Reply 
Multiply Function [x]
08-05-2018, 03:33 AM (This post was last modified: 08-05-2018 06:21 AM by Gamo.)
Post: #17
RE: Multiply Function [x]
Thank You to everyone who gave more information about this topic.

I came across to this "Division Function" as well by using the
"Repeated Subtraction" algorithm

I decided to program this division function by using the repeated substraction.
This algorithm will work only with perfect division result so I make this program that if division is not perfect then return result as (-1)

Example: First Start f [REG]

24÷3
24 [ENTER] 3 [R/S] ---> 8

2475÷25
2475 [ENTER] 25 [R/S] ---> 99

2475÷24
2475 [ENTER] 24 [R/S] ---> -1 // Not a perfect division

Program: Division by Repeated Subtraction
Code:

01 STO 0
02 X<>Y
03 STO 1
04 RCL 1
05 RCL 0
06   -
07 STO 1
08   1
09 CHS
10 X<>Y
11 X≤Y ?
12 GTO 26
13 RCL 1
14 X=0 ?
15 GTO 19
16   1
17 STO+2
18 GTO 04
19 RCL 2
20   1
21   +
22   0
23 STO 2
24 X<>Y
25 GTO 00
26   0
27 STO 2
28   1
29 CHS
30 GTO 00

Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Multiply Function [x] - Gamo - 08-03-2018, 09:27 AM
RE: Multiply Function [x] - Pekis - 08-03-2018, 01:04 PM
RE: Multiply Function [x] - rprosperi - 08-03-2018, 01:13 PM
RE: Multiply Function [x] - wynen - 08-03-2018, 01:07 PM
RE: Multiply Function [x] - Dave Britten - 08-03-2018, 02:10 PM
RE: Multiply Function [x] - Dieter - 08-03-2018, 02:40 PM
RE: Multiply Function [x] - Thomas Klemm - 08-03-2018, 05:33 PM
RE: Multiply Function [x] - Thomas Klemm - 08-03-2018, 06:45 PM
RE: Multiply Function [x] - Leviset - 08-03-2018, 10:54 PM
RE: Multiply Function [x] - ijabbott - 08-03-2018, 11:05 PM
RE: Multiply Function [x] - Gamo - 08-04-2018, 01:41 AM
RE: Multiply Function [x] - Gamo - 08-04-2018, 04:23 AM
RE: Multiply Function [x] - Namir - 08-04-2018, 08:26 AM
RE: Multiply Function [x] - brickviking - 08-05-2018, 03:12 AM
RE: Multiply Function [x] - Gamo - 08-05-2018 03:33 AM
RE: Multiply Function [x] - Thomas Klemm - 08-05-2018, 04:07 PM



User(s) browsing this thread: 1 Guest(s)