Bit Field

A bit field is a common idiom used in computer programming to store multiple, logical, neighboring bits, where each of the sets of bits, and single bits can be addressed. A bit field is most commonly used to represent integral types of known, fixed bit-width. A well-known usage of bit-fields is to represent a set of bits, and/or series of bits, known as flags. For example, the first bit in a bit field can be used to determine the state of a particular attribute associated with the bit field.

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. Bit fields, on the other hand, typically fit within a machine word, and the denotation of bits is independent of their numerical index.

Read more about Bit FieldImplementation, Examples

Other articles related to "bit field, fields, field, bits, bit":

IEEE 802.1Q - Frame Format
... Instead, for Ethernet frames, it adds a 32-bit field between the source MAC address and the EtherType/Length fields of the original frame, extending the minimum and ... The TCI field is further divided into PCP, CFI, and VID. 16 bits 3 bits 1 bit 12 bits TPID TCI PCP CFI VID Tag Protocol Identifier (TPID) a 16-bit field set to a value of 0x8100 in order to identify the frame as an IEEE 802.1Q-tagged frame ...
... They used a memory system which had 25 bits width, and could be configured with from 8,192 words to 32,768 words of memory. 25 for the data word, 2 for "modulo-3 check" bits, and 2 for spares ... It supported the following data formats 25 bit signed binary numbers excess-3 binary coded decimal with 4 bits per digit, allowing 6 digit signed decimal numbers alphanumerics with 6 bits ...
BMP File Format - File Structure - DIB Header (bitmap Information Header)
... All of them contain a dword (32 bit) field, specifying their size, so that an application can easily determine which header is used in the image ... Adds optional RGB bit masks ... Removes optional RGB bit masks ...
C Syntax - Data Structures - Structures and Unions - Bit Fields
... C also provides a special type of structure member known as a bit field, which is an integer with an explicitly specified number of bits ... A bit field is declared as a structure member of type int, signed int, unsigned int, or _Bool, following the member name by a colon () and the number of bits it ... The total number of bits in a single bit field must not exceed the total number of bits in its declared type ...
Bit Field - Examples
... Declaring a bit field in C #include // opaque and show #define YES 1 #define NO 0 // line styles #define SOLID 1 #define DOTTED 2 #define DASHED 3 // primary colors #define BLUE 4 // 100 #defin ...

Famous quotes containing the words field and/or bit:

    the whole field is a
    white desire, empty, a single stem;
    a cluster, flower by flower,
    a pious wish to whiteness gone over—
    or nothing.
    William Carlos Williams (1883–1963)

    We will get everything out of her that you can squeeze out of a lemon and a bit more.... I will squeeze her until you can hear the pips squeak.
    Eric, Sir Geddes (1875–1937)