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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/29/00 06:07
Read: times


 
#4768 - RE: Convert 16Bit Binary to S_decimal
Use binary-to-bcd conversion. Result will be BCD-HEX, in every thetrade will be plased decimal number. 0x400 after conversion will be 0x1024.

you can use 16 bits division, but there are simple algorythm (dont use division)
It based on this :

(x*10)/16=(x<<3+x<<1)>>4=(x>>1+x>>3)

I havent code example for 8051, but on www.atmel.com is appnote for BIN-TO-BCD on AVR core. You can translate it about 5 min.

List of 2 messages in thread
TopicAuthorDate
Convert 16Bit Binary to S_decimal            01/01/70 00:00      
RE: Convert 16Bit Binary to S_decimal            01/01/70 00:00      

Back to Subject List