Click here to Skip to main content
15,566,160 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: How to determine if 2 labelled graphs are identical? Pin
Greg Utas14-Nov-20 5:03
mveGreg Utas14-Nov-20 5:03 
GeneralCLOSED Pin
AlgoHelp14-Nov-20 5:24
AlgoHelp14-Nov-20 5:24 
GeneralRe: How to determine if 2 labelled graphs are identical? Pin
Greg Utas14-Nov-20 6:41
mveGreg Utas14-Nov-20 6:41 
GeneralRe: How to determine if 2 labelled graphs are identical? Pin
Greg Utas15-Nov-20 2:27
mveGreg Utas15-Nov-20 2:27 
QuestionLong Division / Assembly Language Style Pin
C-P-User-313-Oct-20 5:34
C-P-User-313-Oct-20 5:34 
AnswerRe: Long Division / Assembly Language Style Pin
Richard Deeming13-Oct-20 5:53
mveRichard Deeming13-Oct-20 5:53 
GeneralRe: Long Division / Assembly Language Style Pin
harold aptroot13-Oct-20 6:31
harold aptroot13-Oct-20 6:31 
AnswerRe: Long Division / Assembly Language Style Pin
trønderen13-Oct-20 7:25
trønderen13-Oct-20 7:25 
Have you considered table lookup?

No smiley ... In the days when a CPU filled a rack of boards, and the ALU (Arithmetic/Logic Unit) alone was a least one board, maybe more, there was a machine that did that, although for floating point rather than integer. The most significant bits of the mantissas (always kept normalized, with a hidden MSB) were used as indexes into a huge 2D table in ROM, giving the 11 most significant bits. From that, a Newton iteration was done, doubling the precision for each iteration. The entire iteration was done in hardware: The initial lookup took one clock cycle, each iteration took an extra clock cycle (two for single precision, four for double precision). The final normalization of the result took yet another clock cycle.

This FP divide was so fast that the CPU didn't have any integer divide logic. It was faster to convert the integers to 64 bit FP, do the division and convert back. The FP logic alone was a circuit board about A3 size (i.e. twice the size of a standard typewriter paper) packed with chips.

For all I know, maybe modern CPUs use the same technique today. In the late 1970s, it was so remarkable that the design was presented in internationally recognized professional magazines.

If I were to write a division function for arbitrary length integers (or arbitrary precision float), I would consider seriously something in this direction. If the machine provides a division instruction, you can use that to obtain the first 'n' bits, rather than using a huge lookup table.
GeneralRe: Long Division / Assembly Language Style Pin
Greg Utas13-Oct-20 13:04
mveGreg Utas13-Oct-20 13:04 
AnswerRe: Long Division / Assembly Language Style Pin
Gerry Schmitz13-Oct-20 9:33
mveGerry Schmitz13-Oct-20 9:33 
AnswerRe: Long Division / Assembly Language Style Pin
Patrice T6-Nov-20 16:46
mvePatrice T6-Nov-20 16:46 
QuestionFinding possible combinations for tetris-like cages Pin
vinaysingh8424-Sep-20 15:25
vinaysingh8424-Sep-20 15:25 
AnswerRe: Finding possible combinations for tetris-like cages Pin
Gerry Schmitz25-Sep-20 8:41
mveGerry Schmitz25-Sep-20 8:41 
AnswerRe: Finding possible combinations for tetris-like cages Pin
vinaysingh8429-Sep-20 14:15
vinaysingh8429-Sep-20 14:15 
QuestionCalculate time complexity step by step of given two program program Pin
Member 1151248623-Sep-20 1:22
Member 1151248623-Sep-20 1:22 
AnswerRe: Calculate time complexity step by step of given two program program Pin
Richard MacCutchan23-Sep-20 4:34
mveRichard MacCutchan23-Sep-20 4:34 
AnswerRe: Calculate time complexity step by step of given two program program Pin
trønderen23-Sep-20 5:07
trønderen23-Sep-20 5:07 
AnswerRe: Calculate time complexity step by step of given two program program Pin
Gerry Schmitz24-Sep-20 14:01
mveGerry Schmitz24-Sep-20 14:01 
QuestionRandom File & Folder Names Pin
Richard Andrew x6422-Sep-20 11:42
professionalRichard Andrew x6422-Sep-20 11:42 
AnswerRe: Random File & Folder Names Pin
Victor Nijegorodov22-Sep-20 11:56
Victor Nijegorodov22-Sep-20 11:56 
GeneralRe: Random File & Folder Names Pin
Richard Andrew x6422-Sep-20 12:06
professionalRichard Andrew x6422-Sep-20 12:06 
QuestionHow can I calculate time complexity and compare between given two algorithms? Pin
Member 1151248618-Sep-20 19:12
Member 1151248618-Sep-20 19:12 
QuestionRe: How can I calculate time complexity and compare between given two algorithms? Pin
Richard MacCutchan18-Sep-20 22:42
mveRichard MacCutchan18-Sep-20 22:42 
AnswerRe: How can I calculate time complexity and compare between given two algorithms? Pin
Member 1151248619-Sep-20 1:45
Member 1151248619-Sep-20 1:45 
AnswerRe: How can I calculate time complexity and compare between given two algorithms? Pin
trønderen19-Sep-20 3:43
trønderen19-Sep-20 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.