Multiplying Fractions with PIC18F4550

Thread Starter

corsair

Joined Mar 6, 2010
51
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.
 

rjenkins

Joined Nov 6, 2005
1,013
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).
 
Top