Word (computer architecture) explained

In computing, a word is the natural unit of data used by a particular processor design. A word is a fixed-sized datum handled as a unit by the instruction set or the hardware of the processor. The number of bits or digits 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 datum 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).

Documentation for older computers with fixed word size commonly states memory sizes in words rather than bytes or characters. The documentation sometimes uses metric prefixes correctly, sometimes with rounding, e.g., 65 kilowords (kW) meaning for 65536 words, and sometimes uses them incorrectly, with kilowords (kW) meaning 1024 words (210) and megawords (MW) meaning 1,048,576 words (220). With standardization on 8-bit bytes and byte addressability, stating memory sizes in bytes, kilobytes, and megabytes with powers of 1024 rather than 1000 has become the norm, although there is some use of the IEC binary prefixes.

Several of the earliest computers (and a few modern as well) use binary-coded decimal rather than plain binary, typically having a word size of 10 or 12 decimal digits, and some early decimal computers have no fixed word length at all. Early binary systems tended to use word lengths that were some multiple of 6-bits, with the 36-bit word being especially common on mainframe computers. The introduction of ASCII led to the move to systems with word lengths that were a multiple of 8-bits, with 16-bit machines being popular in the 1970s before the move to modern processors with 32 or 64 bits. Special-purpose designs like digital signal processors, may have any word length from 4 to 80 bits.

The size of a word can sometimes differ from the expected due to backward compatibility with earlier computers. If multiple compatible variations or a family of processors share a common architecture and instruction set but differ in their word sizes, their documentation and software may become notationally complex to accommodate the difference (see Size families below).

Uses of words

Depending on how a computer is organized, word-size units may be used for:

Fixed-point numbers: Holders for fixed point, usually integer, numerical values may be available in one or in several different sizes, but one of the sizes available will almost always be the word. The other sizes, if any, are likely to be multiples or fractions of the word size. The smaller sizes are normally used only for efficient use of memory; when loaded into the processor, their values usually go into a larger, word sized holder.
  • Floating-point numbers: Holders for floating-point numerical values are typically either a word or a multiple of a word.
  • Addresses: Holders for memory addresses must be of a size capable of expressing the needed range of values but not be excessively large, so often the size used is the word though it can also be a multiple or fraction of the word size.
  • Registers: Processor registers are designed with a size appropriate for the type of data they hold, e.g. integers, floating-point numbers, or addresses. Many computer architectures use general-purpose registers that are capable of storing data in multiple representations.
  • Memory–processor transfer: When the processor reads from the memory subsystem into a register or writes a register's value to memory, the amount of data transferred is often a word. Historically, this amount of bits which could be transferred in one cycle was also called a catena in some environments (such as the Bull). In simple memory subsystems, the word is transferred over the memory data bus, which typically has a width of a word or half-word. In memory subsystems that use caches, the word-sized transfer is the one between the processor and the first level of cache; at lower levels of the memory hierarchy larger transfers (which are a multiple of the word size) are normally used.
  • Unit of address resolution: In a given architecture, successive address values almost always designate successive units of memory; this unit is the unit of address resolution. In most computers, the unit is either a character (e.g. a byte) or a word. (A few computers have used bit resolution.) If the unit is a word, then a larger amount of memory can be accessed using an address of a given size at the cost of added complexity to access individual characters. On the other hand, if the unit is a byte, then individual characters can be addressed (i.e. selected during the memory operation).
  • Instructions: Machine instructions are normally the size of the architecture's word, such as in RISC architectures, or a multiple of the "char" size that is a fraction of it. This is a natural choice since instructions and data usually share the same memory subsystem. In Harvard architectures the word sizes of instructions and data need not be related, as instructions and data are stored in different memories; for example, the processor in the 1ESS electronic telephone switch has 37-bit instructions and 23-bit data words.
  • Word size choice

    When a computer architecture is designed, the choice of a word size is of substantial importance. There are design considerations which encourage particular bit-group sizes for particular uses (e.g. for addresses), and these considerations point to different sizes for different uses. However, considerations of economy in design strongly push for one size, or a very few sizes related by multiples or fractions (submultiples) to a primary size. That preferred size becomes the word size of the architecture.

    Character size was in the past (pre-variable-sized character encoding) one of the influences on unit of address resolution and the choice of word size. Before the mid-1960s, characters were most often stored in six bits; this allowed no more than 64 characters, so the alphabet was limited to upper case. Since it is efficient in time and space to have the word size be a multiple of the character size, word sizes in this period were usually multiples of 6 bits (in binary machines). A common choice then was the 36-bit word, which is also a good size for the numeric properties of a floating point format.

    After the introduction of the IBM System/360 design, which uses eight-bit characters and supports lower-case letters, the standard size of a character (or more accurately, a byte) becomes eight bits. Word sizes thereafter are naturally multiples of eight bits, with 16, 32, and 64 bits being commonly used.

    Variable-word architectures

    Early machine designs included some that used what is often termed a variable word length. In this type of organization, an operand has no fixed length. Depending on the machine and the instruction, the length might be denoted by a count field, by a delimiting character, or by an additional bit called, e.g., flag, or word mark. Such machines often use binary-coded decimal in 4-bit digits, or in 6-bit characters, for numbers. This class of machines includes the IBM 702, IBM 705, IBM 7080, IBM 7010, UNIVAC 1050, IBM 1401, IBM 1620, and RCA 301.

    Most of these machines work on one unit of memory at a time and since each instruction or datum is several units long, each instruction takes several cycles just to access memory. These machines are often quite slow because of this. For example, instruction fetches on an IBM 1620 Model I take 8 cycles (160 μs) just to read the 12 digits of the instruction (the Model II reduced this to 6 cycles, or 4 cycles if the instruction did not need both address fields). Instruction execution takes a variable number of cycles, depending on the size of the operands.

    Word, bit and byte addressing

    See main article: word addressing and byte addressing. The memory model of an architecture is strongly influenced by the word size. In particular, the resolution of a memory address, that is, the smallest unit that can be designated by an address, has often been chosen to be the word. In this approach, the word-addressable machine approach, address values which differ by one designate adjacent memory words. This is natural in machines which deal almost always in word (or multiple-word) units, and has the advantage of allowing instructions to use minimally sized fields to contain addresses, which can permit a smaller instruction size or a larger variety of instructions.

    When byte processing is to be a significant part of the workload, it is usually more advantageous to use the byte, rather than the word, as the unit of address resolution. Address values which differ by one designate adjacent bytes in memory. This allows an arbitrary character within a character string to be addressed straightforwardly. A word can still be addressed, but the address to be used requires a few more bits than the word-resolution alternative. The word size needs to be an integer multiple of the character size in this organization. This addressing approach was used in the IBM 360, and has been the most common approach in machines designed since then.

    When the workload involves processing fields of different sizes, it can be advantageous to address to the bit. Machines with bit addressing may have some instructions that use a programmer-defined byte size and other instructions that operate on fixed data sizes. As an example, on the IBM 7030[1] ("Stretch"), a floating point instruction can only address words while an integer arithmetic instruction can specify a field length of 1-64 bits, a byte size of 1-8 bits and an accumulator offset of 0-127 bits.

    In a byte-addressable machine with storage-to-storage (SS) instructions, there are typically move instructions to copy one or multiple bytes from one arbitrary location to another. In a byte-oriented (byte-addressable) machine without SS instructions, moving a single byte from one arbitrary location to another is typically:

    1. LOAD the source byte
    2. STORE the result back in the target byte

    Individual bytes can be accessed on a word-oriented machine in one of two ways. Bytes can be manipulated by a combination of shift and mask operations in registers. Moving a single byte from one arbitrary location to another may require the equivalent of the following:

    1. LOAD the word containing the source byte
    2. SHIFT the source word to align the desired byte to the correct position in the target word
    3. AND the source word with a mask to zero out all but the desired bits
    4. LOAD the word containing the target byte
    5. AND the target word with a mask to zero out the target byte
    6. OR the registers containing the source and target words to insert the source byte
    7. STORE the result back in the target location

    Alternatively many word-oriented machines implement byte operations with instructions using special byte pointers in registers or memory. For example, the PDP-10 byte pointer contained the size of the byte in bits (allowing different-sized bytes to be accessed), the bit position of the byte within the word, and the word address of the data. Instructions could automatically adjust the pointer to the next byte on, for example, load and deposit (store) operations.

    Powers of two

    Different amounts of memory are used to store data values with different degrees of precision. The commonly used sizes are usually a power of two multiple of the unit of address resolution (byte or word). Converting the index of an item in an array into the memory address offset of the item then requires only a shift operation rather than a multiplication. In some cases this relationship can also avoid the use of division operations. As a result, most modern computer designs have word sizes (and other operand sizes) that are a power of two times the size of a byte.

    Size families

    As computer designs have grown more complex, the central importance of a single word size to an architecture has decreased. Although more capable hardware can use a wider variety of sizes of data, market forces exert pressure to maintain backward compatibility while extending processor capability. As a result, what might have been the central word size in a fresh design has to coexist as an alternative size to the original word size in a backward compatible design. The original word size remains available in future designs, forming the basis of a size family.

    In the mid-1970s, DEC designed the VAX to be a 32-bit successor of the 16-bit PDP-11. They used word for a 16-bit quantity, while longword referred to a 32-bit quantity; this terminology is the same as the terminology used for the PDP-11. This was in contrast to earlier machines, where the natural unit of addressing memory would be called a word, while a quantity that is one half a word would be called a halfword. In fitting with this scheme, a VAX quadword is 64 bits. They continued this 16-bit word/32-bit longword/64-bit quadword terminology with the 64-bit Alpha.

    Another example is the x86 family, of which processors of three different word lengths (16-bit, later 32- and 64-bit) have been released, while word continues to designate a 16-bit quantity. As software is routinely ported from one word-length to the next, some APIs and documentation define or refer to an older (and thus shorter) word-length than the full word length on the CPU that software may be compiled for. Also, similar to how bytes are used for small numbers in many programs, a shorter word (16 or 32 bits) may be used in contexts where the range of a wider word is not needed (especially where this can save considerable stack space or cache memory space). For example, Microsoft's Windows API maintains the programming language definition of WORD as 16 bits, despite the fact that the API may be used on a 32- or 64-bit x86 processor, where the standard word size would be 32 or 64 bits, respectively. Data structures containing such different sized words refer to them as:

    A similar phenomenon has developed in Intel's x86 assembly language – because of the support for various sizes (and backward compatibility) in the instruction set, some instruction mnemonics carry "d" or "q" identifiers denoting "double-", "quad-" or "double-quad-", which are in terms of the architecture's original 16-bit word size.

    An example with a different word size is the IBM System/360 family. In the System/360 architecture, System/370 architecture and System/390 architecture, there are 8-bit bytes, 16-bit halfwords, 32-bit words and 64-bit doublewords. The z/Architecture, which is the 64-bit member of that architecture family, continues to refer to 16-bit halfwords, 32-bit words, and 64-bit doublewords, and additionally features 128-bit quadwords.

    In general, new processors must use the same data word lengths and virtual address widths as an older processor to have binary compatibility with that older processor.

    Often carefully written source code  - written with source-code compatibility and software portability in mind  - can be recompiled to run on a variety of processors, even ones with different data word lengths or different address widths or both.

    Table of word sizes

    key: bit: bits, c: characters, d: decimal digits, w: word size of architecture, n: variable size, wm: word mark
    data-sort-type="number" YearComputer
    architecture
    data-sort-type="number" Word
    size
    w
    data-sort-type="number" Integer
    sizes
    data-sort-type="number" Floating
    point
    sizes
    data-sort-type="number" Instruction
    sizes
    Unit of
    address
    resolution
    data-sort-type="number" Char
    size
    1837Babbage
    Analytical engine
    50 dwFive different cards were used for different functions, exact size of cards not known.w
    1941Zuse Z322 bitw8 bitw
    1942ABC50 bitw
    1944Harvard Mark I23 dw24 bit
    1946
    (1948)
    ENIAC
    (w/Panel #16)
    10 dw, 2w
    (w)

    (2 d, 4 d, 6 d, 8 d)


    1948Manchester Baby32 bitwww
    1951UNIVAC I12 dwww1 d
    1952IAS machine40 bitwww5 bit
    1952Fast Universal Digital Computer M-234 bitw?w34 bit = 4-bit opcode plus 3×10 bit address10 bit
    1952IBM 70136 bitw, www, w6 bit
    1952UNIVAC 60n d1 d, ... 10 d2 d, 3 d
    1952ARRA I30 bitwww5 bit
    1953IBM 702n c0 c, ... 511 c5 cc6 bit
    1953UNIVAC 120n d1 d, ... 10 d2 d, 3 d
    1953ARRA II30 bitw2www5 bit
    1954
    (1955)
    IBM 650
    (w/IBM 653)
    10 dw
    (w)
    ww2 d
    1954IBM 70436 bitwwww6 bit
    1954IBM 705n c0 c, ... 255 c5 cc6 bit
    1954IBM NORC16 dww, 2www
    1956IBM 305n d1 d, ... 100 d10 dd1 d
    1956ARMAC34 bitwwww5 bit, 6 bit
    1956LGP-3031 bitw16 bitw6 bit
    1958UNIVAC II12 dwww1 d
    1958SAGE32 bitwww6 bit
    1958Autonetics Recomp II40 bitw, 79 bit, 8 d, 15 d2www, w5 bit
    1958ZEBRA33 bitw, 65 bit2www5 bit
    1958Setuntrit (~9.5 bits)up to 6 tryteup to 3 trytes4 trit?
    1958Electrologica X127 bitw2www5 bit, 6 bit
    1959IBM 1401n c1 c, ...1 c, 2 c, 4 c, 5 c, 7 c, 8 cc6 bit + wm
    1959
    (TBD)
    IBM 1620n d2 d, ...
    (4 d, ... 102 d)
    12 dd2 d
    1960LARC12 dw, 2ww, 2www2 d
    1960CDC 160448 bitwwww6 bit
    1960IBM 1410n c1 c, ...1 c, 2 c, 6 c, 7 c, 11 c, 12 cc6 bit + wm
    1960IBM 707010 dw, 1-9 dwww, d2 d
    1960PDP-118 bitwww6 bit
    1960Elliott 80339 bit
    1961IBM 7030
    (Stretch)
    64 bit1 bit, ... 64 bit,
    1 d, ... 16 d
    ww, wbit (integer),
    w (branch),
    w (float)
    1 bit, ... 8 bit
    1961IBM 7080n c0 c, ... 255 c5 cc6 bit
    1962GE-6xx36 bitw, 2 ww, 2 w, 80 bitww6 bit, 9 bit
    1962UNIVAC III25 bitw, 2w, 3w, 4w, 6 d, 12 dww6 bit
    1962Autonetics D-17B
    Minuteman I Guidance Computer
    27 bit11 bit, 24 bit24 bitw
    1962UNIVAC 110736 bitw, w, w, wwww6 bit
    1962IBM 7010n c1 c, ...1 c, 2 c, 6 c, 7 c, 11 c, 12 cc6 b + wm
    1962IBM 709436 bitww, 2www6 bit
    1962SDS 9 Series24 bitw2www
    1963
    (1966)
    Apollo Guidance Computer15 bitww, 2ww
    1963Saturn Launch Vehicle Digital Computer26 bitw13 bitw
    1964/
    1966
    PDP-6/PDP-1036 bitww, 2 www6 bit
    7 bit (typical)
    9 bit
    1964Titan48 bitwwwww
    1964CDC 660060 bitwww, ww6 bit
    1964Autonetics D-37C
    Minuteman II Guidance Computer
    27 bit11 bit, 24 bit24 bitw4 bit, 5 bit
    1965Gemini Guidance Computer39 bit26 bit13 bit13 bit, 26 —bit
    1965IBM 113016 bitw, 2w2w, 3ww, 2ww8 bit
    1965IBM System/36032 bitw, w,
    1 d, ... 16 d
    w, 2ww, w, 1w8 bit8 bit
    1965UNIVAC 110836 bitw, w, w, w, w, 2ww, 2www6 bit, 9 bit
    1965PDP-812 bitwww8 bit
    1965Electrologica X827 bitw2www6 bit, 7 bit
    1966SDS Sigma 732 bitw, ww, 2ww8 bit8 bit
    1969Four-Phase Systems AL18 bitw???
    1970MP94420 bitw???
    1970PDP-1116 bitw2w, 4ww, 2w, 3w8 bit8 bit
    1971CDC STAR-10064 bitw, ww, ww, wbit8 bit
    1971TMS1802NC4 bitw??
    1971Intel 40044 bitw, d2w, 4ww
    1972Intel 80088 bitw, 2 dw, 2w, 3ww8 bit
    1972Calcomp 9009 bitww, 2ww8 bit
    1974Intel 80808 bitw, 2w, 2 dw, 2w, 3ww8 bit
    1975ILLIAC IV64 bitww, www
    1975Motorola 68008 bitw, 2 dw, 2w, 3ww8 bit
    1975MOS Tech. 6501
    MOS Tech. 6502
    8 bitw, 2 dw, 2w, 3ww8 bit
    1976Cray-164 bit24 bit, www, ww8 bit
    1976Zilog Z808 bitw, 2w, 2 dw, 2w, 3w, 4w, 5ww8 bit
    1978
    (1980)
    16-bit x86 (Intel 8086)
    (w/floating point: Intel 8087)
    16 bitw, w, 2 d
    (2w, 4w, 5w, 17 d)
    w, w, ... 7w8 bit8 bit
    1978VAX32 bitw, w, w, 1 d, ... 31 d, 1 bit, ... 32 bitw, 2ww, ... 14w8 bit8 bit
    1979
    (1984)
    Motorola 68000 series
    (w/floating point)
    32 bitw, w, w, 2 d
    (w, 2w, 2w)
    w, w, ... 7w8 bit8 bit
    1985IA-32 (Intel 80386) (w/floating point)32 bitw, w, w
    (w, 2w, 80 bit)
    8 bit, ... 120 bit
    w ... 3w
    8 bit8 bit
    1985ARMv132 bitw, ww8 bit8 bit
    1985MIPS I32 bitw, w, ww, 2ww8 bit8 bit
    1991Cray C9064 bit32 bit, www, w, 48 bitw8 bit
    1992Alpha64 bit8 bit, w, w, ww, ww8 bit8 bit
    1992PowerPC32 bitw, w, ww, 2ww8 bit8 bit
    1996ARMv4
    (w/Thumb)
    32 bitw, w, ww
    (w, w)
    8 bit8 bit
    2000IBM z/Architecture64 bit8 bit, w, w, w
    1 d, ... 31 d
    w, w, 2ww, w, w8 bit8 bit, UTF-16, UTF-32
    2001IA-6464 bit 8 bit, w, w, ww, w41 bit (in 128-bit bundles)[2] 8 bit8 bit
    2001ARMv6
    (w/VFP)
    32 bit8 bit, w, w
    (w, 2w)
    w, w8 bit8 bit
    2003x86-6464 bit8 bit, w, w, ww, w, 80 bit8 bit, ... 120 bit8 bit8 bit
    2013ARMv8-A and ARMv9-A64 bit8 bit, w, w, ww, ww8 bit8 bit
    data-sort-type="number" YearComputer
    architecture
    data-sort-type="number" Word
    size
    w
    data-sort-type="number" Integer
    sizes
    data-sort-type="number" Floating
    point
    sizes
    data-sort-type="number" Instruction
    sizes
    Unit of
    address
    resolution
    data-sort-type="number" Char
    size
    key: bit: bits, c: characters, d: decimal digits, w: word size of architecture, n: variable size, wm: word mark

    See also

    Notes and References

    1. Reference Manual 7030 Data Processing System . August 1961 . Format . http://bitsavers.org/pdf/ibm/7030/22-6530-2_7030RefMan.pdf#page=59 . 50–57 . December 15, 2021 . IBM .
    2. Intel Itanium Architecture Software Developer's Manual . 3: Intel Itanium Instruction Set Reference . 4. Instruction Formats . https://www.intel.com/content/dam/www/public/us/en/documents/manuals/itanium-architecture-vol-3-manual.pdf#page=302 . 3:293 . Three instructions are grouped together into 128-bit sized and aligned containers called bundles. Each bundle contains three 41-bit instruction slots and a 5-bit template field. . April 25, 2022 .