276°
Posted 20 hours ago

32 AMP Plug To 16 AMP Socket 240V Blue 4mm HO7RN-F Changeover Lead

£9.9£99Clearance
ZTS2023's avatar
Shared by
ZTS2023
Joined in 2023
82
63

About this deal

starts with 65/21 = 3, remainder 2 ; 24/21 = 1, remainder 3 ; 33/21 = 1, remainder 12, so the final answer is 311, remainder 12. But it has to be accepted that one of the weaknesses of the PICaxe system is that number-crunching is not its forte.

ALLAN, I tried your code in my run time environment hoping it would just work , but got some unpredictable results which I have no time to look at just now. Here we need to use the formula for the sum of a geometric series up to n terms: s = a*(r I actually got your older 32/16 routine going perfectly in my application thanks, which takes around 10 msecs on an 18M2 running at a MHz clock rate and makes the logic of maths so much more hassle free with the headroom it gives. That is very different from a "32 bit" division with 3 "input" words and perhaps as many (assigned) output words (result, remainder).

I have a practice of renaming the registers to make software configuration more flexible and easily followed (see example below) , so perhaps PICAXE does not allow us to nest assignment under the variable symbols you define for the divide routine, in which case I might need to point these back to the absolute register values (bo, b1 w3 etc) ( HIPPY - is that the case? Just an update that I've now posted my "full" 32 bit by 16 bit division routine in the code snippets section. The footprint probably is quite large, but using << and >> rather than any divides or multiply there will be no other multiplies or divides in the code so it should be quite fast. So the subroutine now supports full 32/16 bits, amounts to 52 bytes and should run on any PICaxe; I'll post the modified version if you wish.

So I was planning to start with my simplest version (maximum 15 bit divisor with maximum 16 bit result) which only uses about 37 bytes of code but looks useful for calibrating/scaling readadc10 and calibadc10 data with good resolution, etc. GCF of 16 and 32 is the largest possible number that divides 16 and 32 exactly without any remainder. I am still hoping that someone will come up with a smart and compact long division mechanism that will to divide a 32 bit number by a 16 bit word where the values are set such that the answer will never be more that a 16 bit word. However, I believe that womai's code takes about 30% longer to execute (probably because of the / and * instructions) and I suspect (not tested) westaut's is longer still because of the 32 iterations.Of course "formatting" output data can be very space-hungry, or is the bintoascii command rather inefficient? I don't know if this may help or inspire anyone, but here's the code to calculate a 32-bit result from a 16-bit x 16-bit multiplication, "result = lhs * rhs", using only word and byte values. These high tensile stainless spokes proved to be ideal, which is why they're used all around the world on wheel sets such as SM Pro Platinum, Dubya, and Haan. Thinking more about the repeated use of "partial" divisions (byte, word or any other base), I now rather doubt that it's a viable solution.

However, I think I've tried that before and encountered complications, but maybe only with overflow/underflow checking, which (I assume) we're ignoring here. There are no doubt many "elegant" solutions, but a normal "Long Division" as you'd do on paper (I hope) is quite easy in binary.I like the way you have reduced the word and byte registers required and the great documentation to go with it - very smart.

It's all from quite some time ago so I don't have any ready answers as to why there may be bugs or where they may be. However, PICAXE does allow 16-bit by 8-bit divide ( and 16-bit by 16-bit ) and there are three overlapping groups of 16-bits in a 32-bit number. One handy thing with SYMBOL commands is that they can do 32-bit maths, so can be used to determine the two 16-bit most significant and least significant 16-bit words of a value.But I would likely work out on paper what each step of the algorithm should produce and then compare what stepping through the program produces. The tent has 3 central poles and ridge pole, the walls are detachable which is great for ventilation in the summer. Fitted with a 32 AMP 415V 3P+Earth+Neutral IP44 rated industrial plug and a 16 AMP 415V 3P+Earth+Neutral industrial socket. Be careful in changing to other variables than those used here as some of the consituent bits of word variables w1 and w0 are used to simplify the maths. a spirit of justice to him who sits in judgment, and a strength to those who repel the onslaught at the gate.

Asda Great Deal

Free UK shipping. 15 day free returns.
Community Updates
*So you can easily identify outgoing links on our site, we've marked them with an "*" symbol. Links on our site are monetised, but this never affects which deals get posted. Find more info in our FAQs and About Us page.
New Comment