This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

c dode for 24bit*8bit multiplication,result of 32bit should be divided by 32 bit

i want to multiply 24bit value which i get from spi ,i stored it in an array of 3byte & i want to multiply with a constant of 8bit,the result i get which is a 32bit has to be divided with a constant of 32bit
i want a c code for this procedure so pls help me

Parents
  • i want a c code for this procedure so pls help me<p>

    Well, you have three choices:

    1. Code 24x8 multiplication in C yourself. I would not recommend this, since you cannot make use of the carry flag in C, making any type of overflow checking very messy.

    2. If you're not strapped for RAM and CPU cycles: Just use long integers.

    3. Roll your own assembly function for the 24x8 multiplication. However, that doesn't really qualify as C.

Reply
  • i want a c code for this procedure so pls help me<p>

    Well, you have three choices:

    1. Code 24x8 multiplication in C yourself. I would not recommend this, since you cannot make use of the carry flag in C, making any type of overflow checking very messy.

    2. If you're not strapped for RAM and CPU cycles: Just use long integers.

    3. Roll your own assembly function for the 24x8 multiplication. However, that doesn't really qualify as C.

Children