• Hexadecimal Arithmetic
    I want to carry out following Hexadecimal Arithmetic operation using C code Multiplication...................................... char A[2] = { 0x01, 0x02}; char B[2] = { 0x03, 0x04}; I want...
  • A51 only allows 16 bit arithmetic - Help!!
    Hi, I have the following code #define FT_RESOLUTION_NS 240 #define US_2_FT_TICKS(x) (((x) * 1000)/FT_RESOLUTION_NS) values calculated with US_2_FT_TICKS where the x * 1000 bit overflows 16...
  • Arithmetic on numbers larger than 32 bits
    I need to add a 32-bit number to a 48-bit number. What I want to do is perform the first 32 bit arithmetic in C as follows: Wv.A += Wv.B ; And to propagate the carry to the most significant word as...
  • Arithmetic using numeric constants
    Hello, We came across a mystery/bug yesterday. This was tested with C51 v9.53 (Simplicity Studio) and 9.56 (uVision). unsigned char data c; unsigned int data d; // The values 0x7B and 0xFF7B...
  • Floating Point Arithmetic Bug?
    I am experiencing unexpected results when performing floating point arithmetic. void main( void ) { long raw_value; float scaling_factor = 0.0762951; float scaling_offset = -1000; float result; ...