troubleshooting Question

Binary/Hexadecimal conversion

Avatar of Marco Gasi
Marco GasiFlag for Spain asked on
8 Comments1 Solution749 ViewsLast Modified:
Hi, Experts. For learning purposes, I'm writein a small program in Delphi that convert numbers and strings from/To Binary and Hexadecimal format. Actually, I wrote two section: the first one convert decimal numbers and strings to binary, the other one converts numbers and strings to hexadecimal format. To call the right function I set a flag: when the user click 'Convert' button, the program check if user typed only numbers or even letters: in the first case, program will treat the input as a decimal number in the second one program will treat input as a string. Setting the flag accordingly, the program knows how reconvert data to its original format.

Hoping to have been clear, I tell the problem: I'm now trying to write the third section, to convert data between binary and hexadecimal format and the problem is: how to understand if data in hexadecimal format are a number or a literal string? I could leave this problem to my hipothetical user, giving it the responsability to check a radio button to tell the program what the input is, but... this is trivial. I think that computers know how to distinguish an hexadecimal string from an hexadecimal number but how they do? What does the trick so the software itself can understand if it has to display a string or a number reading a hexadecimal value?

I know this could seem stupid, but I'm trying to learn Assembly and I understood that one must deeply understand this type of logic to learn - or so I feel...

Thanks to everyone will try to help me.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros