keil software

how can i convert int value into float in 8051 assebly?i want to find the average of 12 int valuse which may be float so i want the result in float?

Parents
  • how can i convert int value into float in 8051 assebly?
    Basically, you don't. Because the 8051 has no notion whatsoever of what a floating-point number is. You can't convert to something that doesn't exist in the world view of the CPU.

    Nor do you really need to. The average of 12 integers is a fraction. Not all fractions have to be represented as floating-point numbers. Most, indeed, shouldn't. Learn about fixed-point arithmetics.

Reply
  • how can i convert int value into float in 8051 assebly?
    Basically, you don't. Because the 8051 has no notion whatsoever of what a floating-point number is. You can't convert to something that doesn't exist in the world view of the CPU.

    Nor do you really need to. The average of 12 integers is a fraction. Not all fractions have to be represented as floating-point numbers. Most, indeed, shouldn't. Learn about fixed-point arithmetics.

Children
More questions in this forum