开发者

Reading hexadecimal values in English

开发者 https://www.devze.com 2023-01-22 01:10 出处:网络
I\'ve been reading hexadecimal on a digit by digit basis for many years and am now fed up with translating hex values for numbers requiring more than 16 bits into English. Does a more elegant form of

I've been reading hexadecimal on a digit by digit basis for many years and am now fed up with translating hex values for numbers requiring more than 16 bits into English. Does a more elegant form of translating hexadecimal to English exist?

In English, a simple system exists for converting decimal values to English. Decimal 10 is English "ten", decimal 57 is english "fifty-seven", decimal 32767 is "thirty-two thousand seven hundre开发者_如何学Pythond sixty-seven", etc.

As far as I know, there exists no system for elegantly representing hexadecimal in English. Hexadecimal 10 is English "one zero" or "one oh", hexadecimal F0ED is "eff oh eee dee", hexadecimal 30F538B9310 is English "three oh eff five three eight bee nine three one oh". Values requiring more bits become increasingly painful to translate. Sometimes converting it to the decimal equivalent to get an elegant English translation, so hexadecimal 10 becomes "sixteen".

Thanks for any help.


This is in Knuth - googling the phrase "vybong bysanton" (which has stuck in my mind ever since reading it) produces this slashdot comment and response:

In section 4.1 of The Art of Computer Programming, Donald Knuth describes:

...a prominent Swedish-American civil engineer named John W. Nystrom [who] decided to... [devise] a complete system of numeration, weights, and measures based on radix-16 arithmetic. He wrote, "I am not afraid, or do not hesitate, to advocate a binary system of arithmetic and metrology. I know I have nature on my side; if I do not succeed to impress upon you its utility and great importance to mankind, it will reflect that much less credit on our generation, upon our scientific men and philosophers." Nystrom devised special means for pronouncing hexadecimal numbers; for example, [0xC0160] was to be read "vybong, bysanton." His entire system was called the Tonal System, and it is described in J. Franklin Inst. 46 (1863), 263-275, 337,348, 402-407.

Maybe you should get that issue of that journal and give it a try.

(response:)

quoted from http://www.monmouth.com/~colonel/tonal.html [monmouth.com]

From Recreations in Mathematics, by H. E. Licks (Van Nostrand, 1917):

John W. Nystrom of Philadelphia devised about fifty years ago the tonal system&quot of numeration in which 16 is the base instead of 10 as in the decimal system. The numerals 1, 2, 3, 4, etc., were called An, De, Ti, Go, etc., and new characters were devised for 10, 11, 12, 13, 14, 15. This system embraced also a new division of the year into 16 months, these having the names Anuary, Debrian, Timander, Gostus, Suvenary, Bylian, Ratamber, Mesidius, Nictorary, Kolumbian, Husander, Victorius, Lamboary, Polian, Fylander, Tonborious, the first two letters of each month being the names of the sixteen numerals.

This is slightly inaccurate. The figure 9 was used for 10, on the principle of making the digits for 8 or greater look like those of their 16's complements written upside down; and a new figure was devised for 9. The name of 12 was Vy, not Vi; and I believe that the meth, nith, vyth, and tonth months were named Mesudius, Nictoary, Vyctorius, and Tonborius.

The year began at the winter solstice, that being the Anth of Anuary. Every month had tonra days except for Debrian, Gostus, and Lamboary, which had only tonby, but Debrian had an extra day in leap years.

The powers of ton were: ton, san, mill, bong. These could be used as prefixes to indicate multiplication or as suffixes to indicate division. For instance, the day was divided into ton (sixteen) tims, a tim into ton timtons, and a timton into ton timsans.


My coworkers and I frequently use the decimal groupings to describe values, so 0x10000 is "hex ten thousand" or 0xF0000 as "hex eff-zero thousand". While this is by no means efficient, it usually works for us. I would prefer to group at 4 digits instead 3, but lack the desire to look for or create a name. ;-)

I've never found any naming convention aside from reading off each digit.


Are you looking for something for you to do yourself when reading such numbers, or for an algorithm for a computer?

If it is something for yourself, then I don't think there is an easy way - just practice. Eg. recognizing A0 is 160, so A3 must be 163, etc.

If you are looking for an algorithm for a computer, then convert to decimal first, and then convert to text. so A3 -> 163 -> "one hundred" + "and sixty" + "three".


mmm.. ) convert it to decimals first, then convert result to english? mmm? :D or I missed something? )


Rather than invent different lingo (which most listeners will not be familiar with) from a mathematical perspective, I prefer simply saying "hex" at the beginning or at the end of the hexadecimal string.

For numbers less than 100hex (i.e., 256dec), I typically say the decimal convention for the numbers if the hex number is only composed of digits 0-9. Thus "forty-six-hex" would be 70dec. When the hex number comprises at least one digit of A-F, I normally just read those hex digits and the decimal digits. Thus "forty-cee-hex" would be 76dec.

For larger numbers, I just use what ever is clearest. Thus 100hex would be either "one hundred hex" or "one zero zero hex" depending on personal preference.

Also "hex" and "dec" in this answer should be written as subscripts, which I'm not sure how to do in this answer!

The short answer is to say the hex digits in whatever is clearest to the listener. Appending "hex" removes any ambiguity in the communication. Hope this helps.


"Does a more elegant form of translating hexadecimal to English exist?"

A system I developed for fun I think is much more elegant, albeit not very practical for communicating with anybody except perhaps me. :)

http://www.castedo.com/binspeak/

The spoken structure is modelled after the way we speak base 10 numbers in English, however I made it language agnostic so it does not re-use existing English words, so it is not really in English.

The webpage lets you try out different sound systems (see the Resymbolize section) so you can make 8 roughly sound like the English word "eight" by choosing sounds "e" and "t" to replace my default choice of sounds "u" and "s".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号