Programming/Word

From Omnia
Jump to navigation Jump to search

Word:

"In computing, word is a term for the natural unit of data used by a particular processor design. A word is a fixed-sized piece of data handled as a unit by the instruction set or the hardware of the processor. The number of bits in a word (the word size, word width, or word length) is an important characteristic of any specific processor design or computer architecture.
The size of a word is reflected in many aspects of a computer's structure and operation; the majority of the registers in a processor are usually word sized and the largest piece of data that can be transferred to and from the working memory in a single operation is a word in many (not all) architectures. The largest possible address size, used to designate a location in memory, is typically a hardware word (here, "hardware word" means the full-sized natural word of the processor, as opposed to any other definition used)." [1]

x86 Example

The x86 family, of which processors of three different word lengths (16-bit, later 32- and 64-bit) have been released.

For 16bit word

bit = 1 bit
nybble = 4 bits = 1/2 byte
byte = 8 bits = 2 nybbles
WORD = 2 bytes = 4 nybbles = 16 bits
DWORD = 2 WORDs = 4 bytes = 8 nybbles = 32 bits
QWORD = 2 DWORDs = 4 WORDs = 8 bytes = 64 bits