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 >
Wrap
Text File
|
1992-11-03
|
4KB
|
90 lines
US patent number 4,956,809 covers using a single standard byte
ordering for transfer of data between machines whose normal byte
ordering is different, if the machines are using a portable operating
system.
Unless invalidated (by prior art from mid-1982 or earlier), this
patent prohibits the principal means for transfering data between
disparate types of computer systems. For example, Sun is now being
faced with demands to pay royalties for NFS (Network File System),
which uses this method. (NFS is used on most networked Unix machines
to refer to files on other machines on the network.)
Here is a layman's explanation of the communication problem for
different byte orderings, and of the solution which this patent
covers. The solution is considered so obvious by programmers that
most of them laugh and find it hard to believe it was patented in
1990.
The memory of today's computers is divided into units called bytes.
Each byte holds a single text character, or a number from 0 to 255.
Each byte of storage has a unique address. These addresses start at 0
and range upward.
When you need to represent a number in a range bigger than 0 to 255,
you need more than one byte. For example, two bytes can hold a number
in the range from 0 to 65535. Four bytes can hold a number in the
range from 0 to 4294967295. This four-byte number might be held in
bytes 72, 73, 74 and 75--four consecutive bytes.
There are various options for distributing the value of the number
among the bytes. In practice, most of today's computers use one of
two methods. The "little endian" method is to put the less
significant figures in the low-numbered bytes. The "big endian"
method is to put the most significant figures in the low numbered
bytes. (These names come from "Gulliver's Travels".)
You can think of this as the computerized equivalent of deciding which
way to write the digits in a number. Normally we put the most
significant digit on the left, and the other digits follow in
decending significance as we move to the right. Thus, one hundred and
four is written 104. Since the most significant digit comes first (in
our left-to-right convention for ordering all text), this is
big-endian.
It would be just as practical to write the digits in the opposite
order--first the one's digit, then the ten's digit, and so on. Then
one hundred and four would be 401. That would be little-endian. One
advantage of little-endian format is that addition and subtraction can
be done by considering the digits in the order they are written. Big
endian order requires reading the digits from back to front.
If you transfer a block of data from a big-endian computer to a
little-endian computer, preserving the order of the bytes, all the
multi-byte numbers will be scrambled. Likewise, if a big-endian
person writes the number one hundred and four as 104, a little-endian
person will misread it as four hundred and one.
We can solve this confusion by establishing a conventional publication
order for the digits of numbers. For example, we can declare that all
numbers in published works will be written with the one's digit last
(big-endian). People who normally think of numbers this way will read
and write them normally. People who normally think of numbers with
the one's digit first (little endian) would read and write numbers
"backwards" (from their point of view) in published works.
The same solution works for computer communication. The simplest way
to communicate data between different computers is to set up a
convention for the ordering of the bytes in any multi-byte number. If
the big-endian ordering convention is chosen, then little-endian
computers must reverse the byte order when they read and write network
messages.
This is exactly what is covered by US patent 4,956,809.
Here is a message containing big-endian numbers:
March 16 1953
The same message, containing little-endian numbers:
March 61 3591
Note that words like "March" are not reversed, because they are
composed of characters, which are single-byte values.
If you find prior art dated 1982 or earlier, please inform
league@prep.ai.mit.edu.