A bit field is a data structure that consists of one or more adjacent bits which have been allocated for specific purposes, so that any single bit or group of bits within the structure can be set or inspected.[1][2] A bit field is most commonly used to represent integral types of known, fixed bit-width, such as single-bit Booleans.
The meaning of the individual bits within the field is determined by the programmer; for example, the first bit in a bit field (located at the field's base address) is sometimes used to determine the state of a particular attribute associated with the bit field.[3]
Within CPUs and other logic devices, collections of bit fields called flags are commonly used to control or to indicate the outcome of particular operations.[4] Processors have a status register that is composed of flags. For example, if the result of an addition cannot be represented in the destination an arithmetic overflow is set. The flags can be used to decide subsequent operations, such as conditional jump instructions. For example, a JE... (Jump if Equal) instruction in the x86 assembly language will result in a jump if the Z (zero) flag was set by some previous operation.
A bit field is distinguished from a bit array in that the latter is used to store a large set of bits indexed by integers and is often wider than any integral type supported by the language.[citation needed] Bit fields, on the other hand, typically fit within a machine word,[3] and the denotation of bits is independent of their numerical index.[2]
^Penn Brumm; Don Brumm (August 1988). 80386 Assembly Language: A Complete Tutorial and Subroutine Library. McGraw-Hill School Education Group. p. 606. ISBN 978-0-8306-9047-3.
^ abSteve Oualline (1997). Practical C Programming. "O'Reilly Media, Inc.". pp. 403–. ISBN 978-1-56592-306-5.
^ abMichael A. Miller (January 1992). The 68000 Microprocessor Family: Architecture, Programming, and Applications. Merrill. p. 323. ISBN 978-0-02-381560-7.
^Ian Griffiths; Matthew Adams; Jesse Liberty (30 July 2010). Programming C# 4.0: Building Windows, Web, and RIA Applications for the .NET 4.0 Framework. "O'Reilly Media, Inc.". pp. 81–. ISBN 978-1-4493-9972-6.
A bitfield is a data structure that consists of one or more adjacent bits which have been allocated for specific purposes, so that any single bit or group...
A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that compactly stores bits. It can be used...
The minimum value for this field is 5, which indicates a length of 5 × 32 bits = 160 bits = 20 bytes. As a 4-bitfield, the maximum value is 15; this...
mask and zero fields, gather and scatter bits to and from specified bit positions or fields. Integer arithmetic operators can also effect bit-operations...
OS/2 and has several different variants. All of them contain a dword (32-bit) field, specifying their size, so that an application can easily determine which...
eight bits of the 32-bit IPv4 address was the network number field which specified the particular network a host was attached to. The remaining 24 bits specified...
most significant bit on the left. However, in this particular bit order presentation, the Label field reads with its most significant bit on the right. Like...
that members of the C basic character set have positive values). Also, bitfield types specified as plain int may be signed or unsigned, depending on the...
a bitfield called interframe space. Interframe space consists of at least three consecutive recessive (1) bits. Following that, if a dominant bit is...
then the exponent field consists of the 8 bits following the sign bit (the 2 bits mentioned plus 6 bits of "exponent continuation field"), and the significand...
of two parts: the network prefix in the high-order bits and the remaining bits called the rest field, host identifier, or interface identifier (IPv6),...
systems that use 32 bits to represent times in inodes Binary file formats with 32-bit time fields Databases with 32-bit time fields Database query languages...
theory to make an arbitrary n-bit central processing unit (CPU). Each of these component modules processes one bitfield or "slice" of an operand. The...
an (optional) 16-bitfield. This field exists if any of the E, S, or PN bits are on. The field must be interpreted only if the S bit is on. N-PDU number...
and 17 data bytes, in addition to the "Len" (8 bitfield), "Enc" (4 bitfield), and "End" (4 bitfield). The symbol is capable of level L error correction...
Bit manipulation instructions sets (BMI sets) are extensions to the x86 instruction set architecture for microprocessors from Intel and AMD. The purpose...
The case of the different letters in the name (bit 5 of the numeric value of the character) is a bitfield that provides the decoder with some information...
indirect word specified either 6-bit or 9-bit character fields within its 36-bit word. The DEC PDP-10, also 36-bit, had special instructions which allowed...
contain up to 8 bits per pixel, allowing a single image to reference its own palette of up to 256 different colors chosen from the 24-bit RGB color space...
explicitly allow the use of the 16-bitfield after the MAC addresses to be used as a length field or a type field. The AppleTalk v2 protocol suite on...
uniquely identifies every user of a cellular network. It is stored as a 64-bitfield and is sent by the mobile device to the network. It is also used for acquiring...
splits this byte into a 6-bit Differentiated Services (DS) field and a 2-bit Explicit Congestion Notification (ECN) field. While Differentiated Services...
just the K field which indicates if the error is minor or major. However all three fields are usually logically combined into a 20 bitfield called Key...