> Hello,
> I'm using CCS-PCM and I need to do this calculation:
> /////////////////////////////////////////////////////////
> byte a, b, c; // byte variables are unsigned 8 bits
> byte x, y, z;
> word xx, yy; // word variables are unsigned 16 bits
> byte end_value;
> xx = a * 6000 + b * 100 + c;
> yy = x * 6000 + y * 100 + z;
> end_value = yy * 255 / xx;
> /////////////////////////////////////////////////////////
> The largest possible value for xx and yy in this application is 599999
> (a 24 bit value).
> The variables a,b,c and x,y,z holds two time values as
> minutes,seconds,cents.
> The calculation is 24 bit, but the result is only 8 bit. Any ideas on
> how can I make this using only 8 bits and 16 bits variables?
> Thank you VERY much,
> Brusque
> -----------------------------------
> Edson Brusque
> Research and Development
> C.I.Tronics Lighting Designers Ltda
> (47) 323-2138
> Blumenau - SC - Brazil
>
http://www.citronics.com.br
> -----------------------------------
> --
>
http://www.piclist.com hint: To leave the PICList
>
.....piclist-unsubscribe-requestKILLspam
.....mitvma.mit.edu
>