Re: Hexadecimal Numbers

Subject: Re: Hexadecimal Numbers
From: "Ridder, Fred" <F -dot- Ridder -at- DIALOGIC -dot- COM>
Date: Thu, 26 Jun 1997 10:05:39 -0400

>-----Original Message-----
>From: James Lockard [SMTP:jamesl -at- DMTI -dot- COM]
>Sent: Wednesday, June 25, 1997 2:06 PM
>Subject: Hexadecimal Numbers
>
><snip>
>Some of the options I found <for representing hexadecimal numbers> include
>decimal 32 = hexadecimal 20
>decimal 32 = 0x20
>decimal 32 = 20h
>decimal 32 = 20H
>decimal 32 = $20
>decimal 32 = &20
>decimal 32 = X'20'
>decimal 32 = 20 (base 16)
>decimal 32 = 20 (hex)
>
>Is there a standard technique for representing hex numbers? If not, what
>techniques or guidelines have you followed in the past? Also, do you
>treat hexadecimal numbers differently in different contexts? That is,
>would you use a different technique with in a paragraph of explanation
>than you would in a number table or code sample?
>
>**************************************
>As other posters have noted, it depends on the specific context.
>Many of the conventions you list are specific to a particular programming
>language, with most of the "odd" variations related to assembly languages
>for particular processor families or semi-archaic high-level languages.
>At my last employer I documented computer boards based on DSP
>processors from four different chip manufacturers whose assemblers
>used three different conventions. In code examples there is no choice
>but to use the specific convention, but I think there is good justification
>for using a more common (I can't bring myself to call it "standard")
>convention in text because some of the prefixed symbols are easily
>misinterpreted outside of code; I'm thinking specifically of the prefixed
>"$", which was the convention used by one of the DSP families I used
>to have to deal with.
>
>Standard notation for C language programming is the "0x" prefix, which
>makes this one reasonable choice for use in text. However, I think you'll
>find the "h" or "H" suffix is probably the most commonly used. If I only
>had to indicate hex in text a handful of times through a publication, I'd
>probably use "(hex)" for its greater emphasis.
>
>Other issues related to hex notation are whether to use "a..f" or "A..F"
>for the high hex digits, whether to separate 8-digit hex numbers (32-bit
>values) into two groups of four digits for better readability, and whether
>to use a monospace font for hex numbers so that they all appear the
>same length when printed (this can be particularly important in tables).
>Remember that in most fonts the decimal digit characters are all the
>same width to keep columns of numbers properly aligned, but upper-case
>"A".."F" are usually slightly wider than the digits and lower-case "a".."f"
>are significantly narrower. BTW, if you use the suffix-h notation to
>indicate hex you may want to cast the suffix in the opposite case
>that you use for the hex digits, again in the interest of readability.
>
Fred Ridder (mailto:f -dot- ridder -at- dialogic -dot- com)
Senior Technical Writer
Dialogic Corporation, Parsippany, NJ

And to keep our marketing people happy:
Get the Dialogic Edge at: http://www.dialogic.com
>

TECHWR-L (Technical Communication) List Information: To send a message
to 2500+ readers, e-mail to TECHWR-L -at- LISTSERV -dot- OKSTATE -dot- EDU -dot- Send commands
to LISTSERV -at- LISTSERV -dot- OKSTATE -dot- EDU (e.g. HELP or SIGNOFF TECHWR-L).
Search the archives at http://www.documentation.com/ or search and
browse the archives at http://listserv.okstate.edu/archives/techwr-l.html


Previous by Author: Re: why bytes are Bs and not bs
Next by Author: Re: Converting Windows Help to Mac Help
Previous by Thread: Hexadecimal Numbers
Next by Thread: Re: Hexadecimal Numbers


What this post helpful? Share it with friends and colleagues:


Sponsored Ads