Anybody have a tidy way to display a 28 bit number on an LCD in decimal? I’m multiplying two 16 bit words, but based on the max values for each, the total should result in 28 bits or less.
Here is the way I am doing it now:
Check the high word. If it’s >0 then divide the 32 bit product (using DIV32) by a multiple of 10 (based on the value of in the high word). Then print out the result with appropriate number of trailing 0s. This has the effect of rounding off the last digits (up to 4 if the number is large).
This works well enough, but I am guessing somebody else has a better way of doing this.
Steve
Bookmarks