On Sun, 13 Feb 2005 17:39:41 +0100, Lourens Veen <[EMAIL PROTECTED]> wrote: > On Saturday 12 February 2005 19:56, Daniel Phillips wrote: > > Hi Lourens, > > > > On Saturday 12 February 2005 08:09, Lourens Veen wrote: > > > On Saturday 12 February 2005 04:56, Daniel Phillips wrote: > > > > Excuse me, I attached attached yesterday's code to today's email. > > > > Here's the updated code. > > > > > > Took me a while to realise, but I've found the problem. You get 18 > > > bits relative to the [1, 2) range, I get 17 bits relative to the > > > (0.5, 1] range. These are equivalent, because the exponent changes. > > > > This stands to reason because your interpolation expression is the same > > as mine. I presume you've arranged for your multiply to be unsigned. > > There might be differences in the way the table samples are calculated, > > I didn't check that. > > It doesn't really matter that much anyway. As long as it works, it's fine with > me :-). > > > The interpolation should be done in the [1, 2) range to match the range > > of the mantissa. > > Actually, I'm inputting the range [0, 65536), and outputting the range [0, > 65536). That's what we need in hardware. The exponent is just a subtraction, > and the sign remains the same.
Let's not get too caught up in the form. The meaning is always the same. Be sure your meanings are congruent, but don't spend too much effort on the differences. I was fiddling around trying to look for patterns. What I did was do only an 8-bit to 8-bit reciprocal. I'm sometimes seeing a pattern and sometimes not. If we can be really clever about this, could we avoid a table altogether? IS there a pattern? Consider 1/3. 1/3 is 1/1.1. If you think about 1.1 as being "10", then what you do is reverse the bit pattern and replicate, getting "01010101". But then consider 1/7. That's 1/1.11. That gives you "00100100". In this case, what we do is take the "110", invert the bits to "001" and replicate; this would also work for "1.1". This approach does not apply, however, to "1/1.01000000". Perhaps there is a meaningful pattern, but perhaps it's not worth looking for it. I could also consider designing a 1/x divider, just as a basis for comparison. 1.000000 1.000000 00000000 00000000 1.003906 0.996109 00000001 11111110 1.007812 0.992248 00000010 11111100 1.011719 0.988417 00000011 11111010 1.015625 0.984615 00000100 11111000 1.019531 0.980843 00000101 11110110 1.023438 0.977099 00000110 11110100 1.027344 0.973384 00000111 11110010 1.031250 0.969697 00001000 11110000 1.035156 0.966038 00001001 11101110 1.039062 0.962406 00001010 11101100 1.042969 0.958802 00001011 11101010 1.046875 0.955224 00001100 11101001 1.050781 0.951673 00001101 11100111 1.054688 0.948148 00001110 11100101 1.058594 0.944649 00001111 11100011 1.062500 0.941176 00010000 11100001 1.066406 0.937729 00010001 11100000 1.070312 0.934307 00010010 11011110 1.074219 0.930909 00010011 11011100 1.078125 0.927536 00010100 11011010 1.082031 0.924188 00010101 11011001 1.085938 0.920863 00010110 11010111 1.089844 0.917563 00010111 11010101 1.093750 0.914286 00011000 11010100 1.097656 0.911032 00011001 11010010 1.101562 0.907801 00011010 11010000 1.105469 0.904594 00011011 11001111 1.109375 0.901408 00011100 11001101 1.113281 0.898246 00011101 11001011 1.117188 0.895105 00011110 11001010 1.121094 0.891986 00011111 11001000 1.125000 0.888889 00100000 11000111 1.128906 0.885813 00100001 11000101 1.132812 0.882759 00100010 11000011 1.136719 0.879725 00100011 11000010 1.140625 0.876712 00100100 11000000 1.144531 0.873720 00100101 10111111 1.148438 0.870748 00100110 10111101 1.152344 0.867797 00100111 10111100 1.156250 0.864865 00101000 10111010 1.160156 0.861953 00101001 10111001 1.164062 0.859060 00101010 10110111 1.167969 0.856187 00101011 10110110 1.171875 0.853333 00101100 10110100 1.175781 0.850498 00101101 10110011 1.179688 0.847682 00101110 10110010 1.183594 0.844885 00101111 10110000 1.187500 0.842105 00110000 10101111 1.191406 0.839344 00110001 10101101 1.195312 0.836601 00110010 10101100 1.199219 0.833876 00110011 10101010 1.203125 0.831169 00110100 10101001 1.207031 0.828479 00110101 10101000 1.210938 0.825806 00110110 10100110 1.214844 0.823151 00110111 10100101 1.218750 0.820513 00111000 10100100 1.222656 0.817891 00111001 10100010 1.226562 0.815287 00111010 10100001 1.230469 0.812698 00111011 10100000 1.234375 0.810127 00111100 10011110 1.238281 0.807571 00111101 10011101 1.242188 0.805031 00111110 10011100 1.246094 0.802508 00111111 10011010 1.250000 0.800000 01000000 10011001 1.253906 0.797508 01000001 10011000 1.257812 0.795031 01000010 10010111 1.261719 0.792570 01000011 10010101 1.265625 0.790123 01000100 10010100 1.269531 0.787692 01000101 10010011 1.273438 0.785276 01000110 10010010 1.277344 0.782875 01000111 10010000 1.281250 0.780488 01001000 10001111 1.285156 0.778116 01001001 10001110 1.289062 0.775758 01001010 10001101 1.292969 0.773414 01001011 10001011 1.296875 0.771084 01001100 10001010 1.300781 0.768769 01001101 10001001 1.304688 0.766467 01001110 10001000 1.308594 0.764179 01001111 10000111 1.312500 0.761905 01010000 10000110 1.316406 0.759644 01010001 10000100 1.320312 0.757396 01010010 10000011 1.324219 0.755162 01010011 10000010 1.328125 0.752941 01010100 10000001 1.332031 0.750733 01010101 10000000 1.335938 0.748538 01010110 01111111 1.339844 0.746356 01010111 01111110 1.343750 0.744186 01011000 01111101 1.347656 0.742029 01011001 01111011 1.351562 0.739884 01011010 01111010 1.355469 0.737752 01011011 01111001 1.359375 0.735632 01011100 01111000 1.363281 0.733524 01011101 01110111 1.367188 0.731429 01011110 01110110 1.371094 0.729345 01011111 01110101 1.375000 0.727273 01100000 01110100 1.378906 0.725212 01100001 01110011 1.382812 0.723164 01100010 01110010 1.386719 0.721127 01100011 01110001 1.390625 0.719101 01100100 01110000 1.394531 0.717087 01100101 01101111 1.398438 0.715084 01100110 01101110 1.402344 0.713092 01100111 01101101 1.406250 0.711111 01101000 01101100 1.410156 0.709141 01101001 01101011 1.414062 0.707182 01101010 01101010 1.417969 0.705234 01101011 01101001 1.421875 0.703297 01101100 01101000 1.425781 0.701370 01101101 01100111 1.429688 0.699454 01101110 01100110 1.433594 0.697548 01101111 01100101 1.437500 0.695652 01110000 01100100 1.441406 0.693767 01110001 01100011 1.445312 0.691892 01110010 01100010 1.449219 0.690027 01110011 01100001 1.453125 0.688172 01110100 01100000 1.457031 0.686327 01110101 01011111 1.460938 0.684492 01110110 01011110 1.464844 0.682667 01110111 01011101 1.468750 0.680851 01111000 01011100 1.472656 0.679045 01111001 01011011 1.476562 0.677249 01111010 01011010 1.480469 0.675462 01111011 01011001 1.484375 0.673684 01111100 01011000 1.488281 0.671916 01111101 01011000 1.492188 0.670157 01111110 01010111 1.496094 0.668407 01111111 01010110 1.500000 0.666667 10000000 01010101 1.503906 0.664935 10000001 01010100 1.507812 0.663212 10000010 01010011 1.511719 0.661499 10000011 01010010 1.515625 0.659794 10000100 01010001 1.519531 0.658098 10000101 01010000 1.523438 0.656410 10000110 01010000 1.527344 0.654731 10000111 01001111 1.531250 0.653061 10001000 01001110 1.535156 0.651399 10001001 01001101 1.539062 0.649746 10001010 01001100 1.542969 0.648101 10001011 01001011 1.546875 0.646465 10001100 01001010 1.550781 0.644836 10001101 01001010 1.554688 0.643216 10001110 01001001 1.558594 0.641604 10001111 01001000 1.562500 0.640000 10010000 01000111 1.566406 0.638404 10010001 01000110 1.570312 0.636816 10010010 01000110 1.574219 0.635236 10010011 01000101 1.578125 0.633663 10010100 01000100 1.582031 0.632099 10010101 01000011 1.585938 0.630542 10010110 01000010 1.589844 0.628993 10010111 01000010 1.593750 0.627451 10011000 01000001 1.597656 0.625917 10011001 01000000 1.601562 0.624390 10011010 00111111 1.605469 0.622871 10011011 00111110 1.609375 0.621359 10011100 00111110 1.613281 0.619855 10011101 00111101 1.617188 0.618357 10011110 00111100 1.621094 0.616867 10011111 00111011 1.625000 0.615385 10100000 00111011 1.628906 0.613909 10100001 00111010 1.632812 0.612440 10100010 00111001 1.636719 0.610979 10100011 00111000 1.640625 0.609524 10100100 00111000 1.644531 0.608076 10100101 00110111 1.648438 0.606635 10100110 00110110 1.652344 0.605201 10100111 00110101 1.656250 0.603774 10101000 00110101 1.660156 0.602353 10101001 00110100 1.664062 0.600939 10101010 00110011 1.667969 0.599532 10101011 00110010 1.671875 0.598131 10101100 00110010 1.675781 0.596737 10101101 00110001 1.679688 0.595349 10101110 00110000 1.683594 0.593967 10101111 00110000 1.687500 0.592593 10110000 00101111 1.691406 0.591224 10110001 00101110 1.695312 0.589862 10110010 00101110 1.699219 0.588506 10110011 00101101 1.703125 0.587156 10110100 00101100 1.707031 0.585812 10110101 00101011 1.710938 0.584475 10110110 00101011 1.714844 0.583144 10110111 00101010 1.718750 0.581818 10111000 00101001 1.722656 0.580499 10111001 00101001 1.726562 0.579186 10111010 00101000 1.730469 0.577878 10111011 00100111 1.734375 0.576577 10111100 00100111 1.738281 0.575281 10111101 00100110 1.742188 0.573991 10111110 00100101 1.746094 0.572707 10111111 00100101 1.750000 0.571429 11000000 00100100 1.753906 0.570156 11000001 00100011 1.757812 0.568889 11000010 00100011 1.761719 0.567627 11000011 00100010 1.765625 0.566372 11000100 00100001 1.769531 0.565121 11000101 00100001 1.773438 0.563877 11000110 00100000 1.777344 0.562637 11000111 00100000 1.781250 0.561404 11001000 00011111 1.785156 0.560175 11001001 00011110 1.789062 0.558952 11001010 00011110 1.792969 0.557734 11001011 00011101 1.796875 0.556522 11001100 00011100 1.800781 0.555315 11001101 00011100 1.804688 0.554113 11001110 00011011 1.808594 0.552916 11001111 00011011 1.812500 0.551724 11010000 00011010 1.816406 0.550538 11010001 00011001 1.820312 0.549356 11010010 00011001 1.824219 0.548180 11010011 00011000 1.828125 0.547009 11010100 00011000 1.832031 0.545842 11010101 00010111 1.835938 0.544681 11010110 00010110 1.839844 0.543524 11010111 00010110 1.843750 0.542373 11011000 00010101 1.847656 0.541226 11011001 00010101 1.851562 0.540084 11011010 00010100 1.855469 0.538947 11011011 00010011 1.859375 0.537815 11011100 00010011 1.863281 0.536688 11011101 00010010 1.867188 0.535565 11011110 00010010 1.871094 0.534447 11011111 00010001 1.875000 0.533333 11100000 00010001 1.878906 0.532225 11100001 00010000 1.882812 0.531120 11100010 00001111 1.886719 0.530021 11100011 00001111 1.890625 0.528926 11100100 00001110 1.894531 0.527835 11100101 00001110 1.898438 0.526749 11100110 00001101 1.902344 0.525667 11100111 00001101 1.906250 0.524590 11101000 00001100 1.910156 0.523517 11101001 00001100 1.914062 0.522449 11101010 00001011 1.917969 0.521385 11101011 00001010 1.921875 0.520325 11101100 00001010 1.925781 0.519270 11101101 00001001 1.929688 0.518219 11101110 00001001 1.933594 0.517172 11101111 00001000 1.937500 0.516129 11110000 00001000 1.941406 0.515091 11110001 00000111 1.945312 0.514056 11110010 00000111 1.949219 0.513026 11110011 00000110 1.953125 0.512000 11110100 00000110 1.957031 0.510978 11110101 00000101 1.960938 0.509960 11110110 00000101 1.964844 0.508946 11110111 00000100 1.968750 0.507937 11111000 00000100 1.972656 0.506931 11111001 00000011 1.976562 0.505929 11111010 00000011 1.980469 0.504931 11111011 00000010 1.984375 0.503937 11111100 00000010 1.988281 0.502947 11111101 00000001 1.992188 0.501961 11111110 00000001 1.996094 0.500978 11111111 00000000 _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
