home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / pub / lpf / byte-order.patent < prev    next >
Text File  |  1992-11-03  |  4KB  |  90 lines

  1. US patent number 4,956,809 covers using a single standard byte
  2. ordering for transfer of data between machines whose normal byte
  3. ordering is different, if the machines are using a portable operating
  4. system.
  5.  
  6. Unless invalidated (by prior art from mid-1982 or earlier), this
  7. patent prohibits the principal means for transfering data between
  8. disparate types of computer systems.  For example, Sun is now being
  9. faced with demands to pay royalties for NFS (Network File System),
  10. which uses this method.  (NFS is used on most networked Unix machines
  11. to refer to files on other machines on the network.)
  12.  
  13. Here is a layman's explanation of the communication problem for
  14. different byte orderings, and of the solution which this patent
  15. covers.  The solution is considered so obvious by programmers that
  16. most of them laugh and find it hard to believe it was patented in
  17. 1990.
  18.  
  19. The memory of today's computers is divided into units called bytes.
  20. Each byte holds a single text character, or a number from 0 to 255.
  21. Each byte of storage has a unique address.  These addresses start at 0
  22. and range upward.
  23.  
  24. When you need to represent a number in a range bigger than 0 to 255,
  25. you need more than one byte.  For example, two bytes can hold a number
  26. in the range from 0 to 65535.  Four bytes can hold a number in the
  27. range from 0 to 4294967295.  This four-byte number might be held in
  28. bytes 72, 73, 74 and 75--four consecutive bytes.
  29.  
  30. There are various options for distributing the value of the number
  31. among the bytes.  In practice, most of today's computers use one of
  32. two methods.  The "little endian" method is to put the less
  33. significant figures in the low-numbered bytes.  The "big endian"
  34. method is to put the most significant figures in the low numbered
  35. bytes.  (These names come from "Gulliver's Travels".)
  36.  
  37. You can think of this as the computerized equivalent of deciding which
  38. way to write the digits in a number.  Normally we put the most
  39. significant digit on the left, and the other digits follow in
  40. decending significance as we move to the right.  Thus, one hundred and
  41. four is written 104.  Since the most significant digit comes first (in
  42. our left-to-right convention for ordering all text), this is
  43. big-endian.
  44.  
  45. It would be just as practical to write the digits in the opposite
  46. order--first the one's digit, then the ten's digit, and so on.  Then
  47. one hundred and four would be 401.  That would be little-endian.  One
  48. advantage of little-endian format is that addition and subtraction can
  49. be done by considering the digits in the order they are written.  Big
  50. endian order requires reading the digits from back to front.
  51.  
  52. If you transfer a block of data from a big-endian computer to a
  53. little-endian computer, preserving the order of the bytes, all the
  54. multi-byte numbers will be scrambled.  Likewise, if a big-endian
  55. person writes the number one hundred and four as 104, a little-endian
  56. person will misread it as four hundred and one.
  57.  
  58. We can solve this confusion by establishing a conventional publication
  59. order for the digits of numbers.  For example, we can declare that all
  60. numbers in published works will be written with the one's digit last
  61. (big-endian).  People who normally think of numbers this way will read
  62. and write them normally.  People who normally think of numbers with
  63. the one's digit first (little endian) would read and write numbers
  64. "backwards" (from their point of view) in published works.
  65.  
  66. The same solution works for computer communication.  The simplest way
  67. to communicate data between different computers is to set up a
  68. convention for the ordering of the bytes in any multi-byte number.  If
  69. the big-endian ordering convention is chosen, then little-endian
  70. computers must reverse the byte order when they read and write network
  71. messages.
  72.  
  73. This is exactly what is covered by US patent 4,956,809.
  74.  
  75. Here is a message containing big-endian numbers:
  76.  
  77.     March 16 1953
  78.  
  79. The same message, containing little-endian numbers:
  80.  
  81.     March 61 3591
  82.  
  83. Note that words like "March" are not reversed, because they are
  84. composed of characters, which are single-byte values.
  85.  
  86.  
  87. If you find prior art dated 1982 or earlier, please inform
  88. league@prep.ai.mit.edu.
  89.  
  90.