🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Denis Downey Wed, 05 Aug 1992 13:58
Fast 12 bit multiply on 8 bit machine
#44
Author: Denis Downey
Date: Wed, 05 Aug 1992 13:58
11 lines
639 bytes
I'm looking for a fast way to do 12 bit multiply and divide using the
8 bit multiply and divide available on my microcontroller (87c51).



Anyone out there with any good ideas ??


Thanks !

----------
Re: Fast 12 bit multiply on 8 bit machine
#46
Author: Gideon Yuval
Date: Sun, 09 Aug 1992 01:29
4 lines
519 bytes
Try the PL/M-51 run-time library. It's gone through some hard-core
optimizations.
-- 
Gideon Yuval, gideony@microsoft.com, 206-882-8080 (fax:-883-8101;TWX:160520)
Re: Fast 12 bit multiply on 8 bit machine
#47
Author: Jos Horsmeier
Date: Mon, 10 Aug 1992 16:02
31 lines
1399 bytes
In article <1992Aug5.135844.6978@tigger.jvnc.net> dgd@polaris.aml.com (Denis Downey) writes:
|I'm looking for a fast way to do 12 bit multiply and divide using the
|8 bit multiply and divide available on my microcontroller (87c51).
|
|Anyone out there with any good ideas ??

Well, I don't know if it is a good idea, but I would chop these two numbers
into three nibble parts and do the multiplication like this:

X = 256*X1 + 16*X2 + X3
Y = 256*Y1 + 16*Y2 + Y3

X*Y = 65536*(X1*Y1) + 4096*(X1*Y2 + X2*Y1) + 256*(X1*Y3 + X2*Y2 + X3*Y1) +
      16*(X2*Y3 + X3*Y2) + (X3*Y3)

Division is something else ... the naive approach would be to subtract the
second number (after shifting it left enough bits,) but I'd suggest to read

Aho, Hopcroft & Ullman
Design and Analysis of Algorithm

(from memory) chapter 7 (8?) explains an integer division method, where
the result is taken modulo the wordsize, i.e. 

a/b= c mod 2^n ==> b*c = a mod 2^n

I have the book at home, sorry I can't be more detailed about this ...

kind regards,

Jos aka jos@and.nl
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads