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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/11/09 14:00
Modified:
  07/11/09 14:15

Read: times


 
#167083 - Basics (edited)
Responding to: ???'s previous message
Giang Ho said:
Yes, I have actually used a lot of "if..else" statements to convert.

Almost certainly a very cumbersome way of doing it.

BCD is a very well established way of representing numbers in digital systems - you should easily be able to find plenty of descriptions of it with a little searching on this forum or google.

Or you could just start with Wikipedia...


Hint: Try drawing the binary representation of 0x16 - what do you notice about where the 1st hex digit is located within the byte?
And the 2nd hex digit...?

You do need to understand the basic mathematical concepts of place value and radix notation; from the links I gave earlier, see: http://www.8052.com/forum/read/67454


List of 14 messages in thread
TopicAuthorDate
Convert BCD, hex and decimal in C (DS1307 related)            01/01/70 00:00      
   Keyboard?            01/01/70 00:00      
   Another thought about that keyboard...            01/01/70 00:00      
      Re:Another thought about that keyboard...            01/01/70 00:00      
         Wrong approach?            01/01/70 00:00      
            Re: Wrong approach?            01/01/70 00:00      
               Division            01/01/70 00:00      
               Not a shortcut?            01/01/70 00:00      
                  Re: Not a shortcut?            01/01/70 00:00      
                     Basics (edited)            01/01/70 00:00      
                        addition to the above            01/01/70 00:00      
                           Look at the DS1307 datasheet            01/01/70 00:00      
   Check this            01/01/70 00:00      
      Incorrect            01/01/70 00:00      

Back to Subject List