I need to write a program for my microcontrollers class that takes a user inputted value, unit, and desired unit. And then converts the inputted value and unit to the proper value in the desired unit.
The problem I'm up against right now is that the conversion factor for say, inches to cm is 2.54. You can't just input a non-integer number and tell the processor to multiply it together. So I'm wondering what sort of solutions there are for representing a decimal in binary/hex, doing the required operation, and output a final number.
I'm very new to programming in assembly language and using microcontrollers altogether so any help would be awesome. Thanks for the help!
The problem I'm up against right now is that the conversion factor for say, inches to cm is 2.54. You can't just input a non-integer number and tell the processor to multiply it together. So I'm wondering what sort of solutions there are for representing a decimal in binary/hex, doing the required operation, and output a final number.
I'm very new to programming in assembly language and using microcontrollers altogether so any help would be awesome. Thanks for the help!