Binary to BCD
4x5n
Posts: 745
Sorry for the post but the forum and obex search ability is somewhat limited and didn't turn anything up. I'm looking for a propeller routine/object to convert binary to bcd. Thought I'd try here before trying to write my own.
Comments
BCD_Value := ((Binary / 10) << 4) + (Binary // 10) ' Takes a binary value from 0 to 99 and converts to two digits packed into one byte
Thanks for the response. Sorry for posting the question and then leaving I intended to delete it after seeing similar topics. Alas, I went to the Bears game today the people I went with arrived a bit early and I had to leave.
I was asked to make some changes to code I wrote better then 20yrs ago written for the 68hc11 doing interrupt driven machine control. It's been a long time since I looked at it but it was very large very tight code and I thought I might be better rewriting it for a propeller. The binary to bcd conversion was for a two digit 7 seg display. It was my initial concern as I was thinking through and remembering how the code I had written worked.
While watching the Bears lose today I came to the decision that I really don't want to port the code from the hc11 to the prop and I'll be better off simply modifying the code that already exists. Thanks again for the response.