Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Binary division restoring algorithm PIC 18F family

Status
Not open for further replies.

atferrari

Full Member level 4
Joined
Jun 29, 2004
Messages
237
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Location
Buenos Aires - Argentina
Activity points
1,996
Four days ago I finished the testing of a binary division algorithm 3216 unsigned based on the "restoring" method.

It may be found here: **broken link removed** where you will look for "PICs" scrolling down to below MUL_1616U

My comments:

a) Something that nobody tells you about the actual implementation of this method:

the shifting to the left of the dividend can cause an overflow detectable ONLY, through testing the Carry bit. (If set, the divisor must be substracted from the dividend as indicated by the method). Otherwise, the standard test "is divisor equal or less than dividend?" will fail, leading you to a final wrong result.

Just by working backwards from few known results, I realized that a failure appeared when, at least, one overflow occurred due the dividend shifting along the process.

b) The other routines are simple ones, that I use quite often. I know their limits and they fit my current needs. Please neglect them.

The other binary division routine based on the "Kenyan" algorithm (see a posting of myself from few days ago) completes the lot.
 

Shorter version posted

Division 32/16 bits unsigned. I've just posted a slightly shorter version of the algorithm.

Now the code takes 22 lines including RETURN

Enter here: **broken link removed** and look for "PICs". Scroll down, below MUL_1616U.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top