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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/16/09 20:41
Read: times


 
#164676 - D'oh! You've given it away
Responding to: ???'s previous message
I said:
It is left as an excercise to the student to consider how this may be extended to give ASCII text representation in Hexadecimal notation...
http://www.8052.com/forumchat/read/164655


Richard Erlacher said:
if he wants it in ascii-HEX, he has to compare the binary nybble with 9, then, if the value is 9 or less, add it to 0x30, else, given, now, that the value is greater than 9, he has to subtract 9 and add the difference to 0x41, or perform some equivalent operation.


Now you've given it all away!

Don't you find those operations quite different, Andy?

The principle remains the same in both cases; viz,

1. Isolate the individual digits to be displayed;

2. Convert those digits to the appropriate displayable character representation (eg, ASCII).

Yes, the implementation detail of step 2. is somewhat more involved - but it still remains an exercise in converting the digit value to displayable form.

Thus the generic description holds.

List of 25 messages in thread
TopicAuthorDate
16bit number to ascii            01/01/70 00:00      
   Base conversion.            01/01/70 00:00      
      Number Base (Radix) and Place Value            01/01/70 00:00      
      ASCII            01/01/70 00:00      
         Right ... I forgot about that part.            01/01/70 00:00      
            What I'd wonder ...            01/01/70 00:00      
               Is it relevant?            01/01/70 00:00      
                  That's somewhat of a description            01/01/70 00:00      
                     D'oh! You've given it away            01/01/70 00:00      
                        Well ... not quite ...            01/01/70 00:00      
                           That was step 1.            01/01/70 00:00      
      not hard when talking in human language or C...            01/01/70 00:00      
         Irrelevant            01/01/70 00:00      
   Op code?            01/01/70 00:00      
      Ah, yes ... the Fairchild FND-70 driver ...            01/01/70 00:00      
         nybble-to-7-segment encoder            01/01/70 00:00      
            if...            01/01/70 00:00      
               30 years ago            01/01/70 00:00      
            That's a BIG if            01/01/70 00:00      
               Serial output            01/01/70 00:00      
                  That might work in SOME cases ...            01/01/70 00:00      
                     But I'm not that fast            01/01/70 00:00      
                        What about infrequently recurring events?            01/01/70 00:00      
         FND-70 driver? Luxury!            01/01/70 00:00      
            Decoding DTMF            01/01/70 00:00      

Back to Subject List