Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/06/04 01:05
Read: times


 
#67988 - Back to basics - Ali
Responding to: ???'s previous message
If A is a 16 bit number and you are going to divide it by 36000000, then even when for the maximum value of 0xFFFF, your answer will be 0.001820! Quite useless that way for a 8 bit controller. So just think in a different way : Either multiply the numerator by a value like 10,000 to get some meaningful value or just use 36 for the division and adjust the decimals finally when you are displaying the result in BCD.

Looks like you are making another energy meter. In a recent thread on Energy meter someone had posted a link to a dedicated chip CS5460A from Cirrus logic. A cursory glance at the data sheet tells me its a simple thing to use. Maybe it can save you all the arithmetic headaches...

Raghu



List of 10 messages in thread
TopicAuthorDate
division by large no            01/01/70 00:00      
   RE: division by large no            01/01/70 00:00      
   RE: division by large no            01/01/70 00:00      
      RE: division by large no            01/01/70 00:00      
         RE: division by large no            01/01/70 00:00      
            RE: division by large no            01/01/70 00:00      
               division by large no            01/01/70 00:00      
                  RE: division by large no            01/01/70 00:00      
                     division by large no            01/01/70 00:00      
                  Back to basics - Ali            01/01/70 00:00      

Back to Subject List