GRAEME SMITH email: grysmith@freenet.edmonton.ab.ca YMCA Edmonton Address has changed with little warning! (I moved across the hall! :) ) Email will remain constant... at least for now. On Mon, 14 Jun 1999, Mike Keitz wrote: > >The problem is, that the circuit I need, > >is characterized as a slope type formula... ie: y=mx+b, M tends to > >have relatively small changes between different versions, so to get > >the > >same result, > > If you're considering a graphical accelerator or vector to raster > converter these problems have been extensively studied and optimized in > the past. There should be plenty of literature available. Nope, as far as I know, nobody else is working on this particular set of applications yet.... but then, what do I know? > > >The values range from 1 to 128 for the 8 bit values (xmin), and > >1.0 to 255.0 for the 16 bit values. > > Use the 16-bit number as a fixed point with 8 bits of fraction. Then the > high byte is the integer part and the low byte is the fraction (the LSB > is 1/256). So there are 256 evenly spaced increments between 1 and 2 as > well as 2 and 3, etc. The maximum value is 255 + 255/256. > I was thinking about that.... its still relatively slow, I would think, and to do it properly I would need a more expensive chip... > To multiply these numbers by an integer, just multiply in binary. The > the low 8 bits of the result are fraction and the rest is the integer. > > >Essentially what I need to do, is calculate the Y for a slope function > >with a variable slope, and upper and lower limits. > > > >Y = M * (X-Xmin) + -127 > > If you are going compute values of Y for consecutive values of X it is > only necessary to evaluate the whole formula for the first one. > Subsequent values of Y can be obtained by just adding M to the last one. > Sorry, not calculating consecutive values, values will vary, depending on the individual application in ways that are not predictable at this point. In fact the Slope might vary as often as X. Grey