Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site fluke.UUCP
Path: utzoo!linus!philabs!cmcl2!floyd!harpo!ihnp4!alberta!ubc-vision!uw-beaver!microsoft!fluke!dave
From: dave@fluke.UUCP (Dave Van Ess)
Newsgroups: net.math
Subject: Math for Smart Alecks
Message-ID: <912@vax2.fluke.UUCP>
Date: Mon, 30-Jan-84 15:39:16 EST
Article-I.D.: vax2.912
Posted: Mon Jan 30 15:39:16 1984
Date-Received: Fri, 3-Feb-84 02:45:24 EST
Organization: John Fluke Mfg. Co., Everett, Wash
Lines: 36

I'd like to expand a little farther on Terry Ligocki's explaination of
the "Smart Aleck Multiplication" algorithym. Terry is correct in saying that
it is just a binary shift and add routine. What makes this routine special
is that the operations on each of the number are independent of each other.
The first number need only to be divided by 2 and have oddness determined,
while the second number is only doubled and totaled. This independence frees
the two numbers from having the same base. As an example the following
operation would not be difficult.

		ff  *  19   = 4845
		  hex    bcd    bcd

All that is needed is, a halfing routine for the first number ( shift right ), a
way of determining oddness in the first number ( the zero bit ), a way of
determining a zero for the first number, and a bcd adding routine for the second
number. Below is the algorithym stated for the general case.

		X   *   Y   =  Z
		 a       b      b

		Zb= 0b
		while ( Xa != 0a ) {
		 	if ( Xa is odd ) {
				Zb = Zb + Yb
			}
			Xa = Xa / 2a
			Yb = Yb + Yb
		}

This algorithym can be useful where some value needs to have it's base changed
but also needs to be normalized.

						Dave Van Ess
						John Fluke Mfg. Co.
						Everett Wa