Search found 3056 matches

by Richard
Nov 17, 2021 16:05
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

I am working on a few one-off projects, that could fit in an array of FPGAs. Publication of details is not an option, but prime factors are not needed. It is often the case that the identification of a novel algorithm, will lead to revelations about the problem. That in turn may reduce the complexit...
by Richard
Nov 17, 2021 11:39
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

Never fear, the CPU you are now using was written in some version of VHDL.
by Richard
Nov 17, 2021 0:52
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

The algorithm I seek will execute in hardware as VHDL, not as compiled sequentially executed code on an intel or clone CPU. Terse code generates less hardware, speed comes later in hardware. There are no fixed rules here but KISS. FB code written to test ideas must be mutated later into VHDL code if...
by Richard
Nov 15, 2021 23:17
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

@dodicat. My aim was to eliminate the slow Div or Mod test from the inside loop. I have done that. Now I am looking at ways to speed up the resulting envelope by eliminating all silly re-computation. The slowest part of the process was the duplicated counting up again to the last factor found. That ...
by Richard
Nov 15, 2021 0:08
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

@coderJeff
As a purist, I really like it.
I also like it when people drop rocks in my wheel ruts, to help me escape onto alternative tracks.
by Richard
Nov 14, 2021 13:45
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

@Munair I don't think performance is that important at the moment. I was trying to understand the two-stepping algorithm well enough to write code that might work. The code needed is now more obvious. There are enough comments remaining that I might be able to follow the logic again next week. Those...
by Richard
Nov 14, 2021 1:15
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

Here is a faster version of the prime factors code, with two stepping, and without back tracking. ' Prime Factors of a number, without using MOD to test within the inner loop ' ' n = ( a * b ) + c, when c = 0, a and b are factors of n ' ' Features; This code shifts out factors of two, before testing...
by Richard
Nov 06, 2021 5:51
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

Richard, wow, that's compact. Clever. I never would have thought of Loop While b < a ' square root to check bounds on the square root. Good tip!After looking at your code I feel like I should be able recheck the math to get rid of more comparisons. Here is my code to find the rectangle closest to a...
by Richard
Nov 02, 2021 3:58
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Re: Prime Factors without using / Div or Mod.

I'm on holiday exploring the wide algorithm space. Obviously the linear search will run slow for big numbers, but I am not homesick for speed, so I will not abandon the holiday immediately. Also; George Polya wrote. “It is better to solve one problem in 5 different ways than to solve 5 different pro...
by Richard
Oct 30, 2021 18:19
Forum: Sources, Examples, Tips and Tricks
Topic: Prime Factors without using / Div or Mod.
Replies: 22
Views: 3947

Prime Factors without using / Div or Mod.

The aim here was to find prime factors without using / \ or Mod. It can then run on the simplest hardware or microcontroller. Has anyone seen any similar / \ Div free code ? The number here is represented in the form; n = a * b + c. It searches for c = 0, when a and b will be factors. This compact c...
by Richard
May 04, 2021 8:29
Forum: General
Topic: Pentacles
Replies: 153
Views: 19152

Re: Pentacles

They calculate the stall speed , as to how fast you need to go to lift off with an empty plane , with full fuel tanks . and a single 200 pound pilot.. I don't believe you. “They” must be a bunch of idiots. @albert. It may come as a bit of a surprise, but aircraft have been flying for over 100 years...
by Richard
May 03, 2021 1:31
Forum: General
Topic: Pentacles
Replies: 153
Views: 19152

Re: Pentacles

@Richard How do you turn E = MV^2 into pounds of force??? You don't. For the wing at a particular angle of attack you find the lift coefficient Cl , and the drag coefficient Cd . Where the density of air is d, and the speed is v, the forces of lift and drag are; Flift = Cl * d * v² Fdrag = Cd * d *...
by Richard
Apr 28, 2021 13:50
Forum: General
Topic: Pentacles
Replies: 153
Views: 19152

Re: Pentacles

@dodicat. Those bubbles are infectious.
by Richard
Apr 28, 2021 0:10
Forum: General
Topic: Pentacles
Replies: 153
Views: 19152

Re: Pentacles

We have it easy here in Tasmania, the rock at the far end, of the far end, of the Earth. The best defence for a castle is a moat. We have the Torres Strait to the North of Australia, then the Bass Strait between the mainland and Tasmania. New Zealand has the Tasman Sea. I feel sorry for countries on...
by Richard
Apr 27, 2021 13:02
Forum: General
Topic: Pentacles
Replies: 153
Views: 19152

Re: Pentacles

@dodicat Have you got a vaccine yet ? Nice idea for circles inside circles. ... Like a circle in a spiral, like a wheel within a wheel Never ending or beginning on an ever spinning reel As the images unwind, like the circles that you find In the windmills of your mind! https://www.songfacts.com/lyri...