Multiplying Fractions with PIC18F4550

Discussion in 'Embedded Systems and Microcontrollers' started by corsair, Mar 27, 2010.

  1. corsair

    Thread Starter Member

    Mar 6, 2010
    Is there an easy way to multiply fractions in assembly language using a PIC18F4550 instruction set?

    I need to convert from Fahrenheit to Celsius and from Celsius to Fahrenheit.
  2. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    You don't need fractions, you should be using three simple integer ops in sequence.

    C to F: /5, *9, +32

    F to C: -32, /9, *5

    If you need fractional degree resolution, then work in tenths or hundredths of a degree, still as an integer. (And scale the 32 offset to 320 or 3200).