Basic Commands Manual: Section 2 Page 24:Version 6.8
The NCD command is given as:
1. Are the bits counted from the left-hand side here ? As I understood the msb is at the left, so why is bit15 given the value 1 ?
2. How would one derive the LOGbase2 of a number in the Picaxe ?
Thanks to the maths gurus for input...
The NCD command is given as:
Questions:NCD
The encoder function takes a value and finds the position of the highest bit in
that number that is a 1. Therefore the result will be a number 1 to 16, when bit15
is 1 the answer is 1, when only bit0 is 1 the value is 16. If the value is 0, the result
will be 0.
e.g let b1 = ncd %00001000 (answer b1 = 3)
1. Are the bits counted from the left-hand side here ? As I understood the msb is at the left, so why is bit15 given the value 1 ?
2. How would one derive the LOGbase2 of a number in the Picaxe ?
Thanks to the maths gurus for input...