Appendix B:

Representation Codes

Code Name Size in Bytes Descirption
1 FSHORT 2 Low precision floating point
2 FSINGL 4 IEEE single precision floating point
3 FSING1 8 Validated single precision floating point
4 FSING2 12 Two-way validated single precision floating point
5 ISINGL 4 IBM single precision floating point
6 VSINGL 4 VAX single precision floating point
7 FDOUBL 8 IEEE double precision floating point
8 FDOUB1 16 Validated double precision floating point
9 FDOUB2 24 Two-way validated double precision floating point
10 CSINGL 8 Single precision complex
11 CDOUBL 16 Double precision complex
12 SSHORT 1 Short signed integer
13 SNORM 2 Normal signed integer
14 SLONG 4 Long signed integer
15 USHORT 1 Short unsigned integer
16 UNORM 2 Normal unsigned integer
17 ULONG 4 Long unsigned integer
18 UVARI 1, 2, or 4 Variable-length unsigned integer
19 IDENT V Variable-length identifier
20 ASCII V Variable-length ASCII character string
21 DTIME 8 Date and time
22 ORIGIN V Origin reference
23 OBNAME V Object name
24 OBJREF V Object reference
25 ATTREF V Attribute reference
26 STATUS 1 Boolean status
27 UNITS V Units expression

These codes define the manner in which data is represented. The values of Representation Codes as recorded under DLIS are indicated in the Code column in decimal form. The symbolic names used in this document to refer to Representation Codes are listed in the Name column.

B.1 Code FSHORT: Low Precision Floating Point

Byte Bit Meaning Field
1 1 -1 M
2 2-1
3 2-2
4 2-3
5 2-4
6 2-5
7 2-6
8 2-7
2 1 2-8
2 2-9
3 2-10
4 2-11
5 23 E
6 22
7 21
8 20
Value = M * 2E
2‘s complement 12-bit fractional mantissa with 4-bit unsigned integer exponent.

B.2 Code FSINGL: IEEE Single Precision Floating Point

Byte Bit Meaning Field
1 1 -1 S
2 27 E
3 26
4 25
5 24
6 23
7 22
8 21
2 1 20
2 2-1 M
3 2-2
4 2-3
5 2-4
6 2-5
7 2-6
8 2-7
3 1 2-8
2 2-9
3 2-10
4 2-11
5 2-12
6 2-13
7 2-14
8 2-15
4 1 2-16
2 2-17
3 2-18
4 2-19
5 2-20
6 2-21
7 2-22
8 2-23
Value = (-1)S * (1+M) * 2 E-127,  0 < E < 255   [normalized]
Value = (-1)S * M * 2-126, E = 0, M != 0   [denormalized]
Value = (-1)S * 0, E = 0, M = 0
Value = (-1)S * <infinity>, E = 255, M = 0
Value = NaN (Not a Number), E = 255, M != 0
Single precision floating point format as defined in ANSI Document STD 754-1985, IEEE Standard for Binary Floating-Point Arithmetic.

15310 = 2318 = (1 + .1448) * 2134-127 =

    01000011 00011001 00000000 00000000 

-15310 = -2318 = -(1 + .1448) * 2134-127 =

    11000011 00011001 00000000 00000000 

B.3 Code FSING1: Validated Single Precision Floating Point

Byte Field
1 V(FSINGL)
2
3
4
5 A(FSINGL)
6
7
8
Value = V
A >= 0.0
V is a nominal value with a confidence interval of [V - A, V + A]. This specification delegates to the Producer the assignment of meaning to the interval, i.e., whether it is a true bound of the actual value measured or some statistical estimate of the actual value.

B.4 Code FSING2: Two-Way Validated Single Precision Floating Point

Byte Field
1 V(FSINGL)
2
3
4
5 A(FSINGL)
6
7
8
5 B(FSINGL)
6
7
8
Value = V
A, B >= 0.0
V is a nominal value with a confidence interval of [V - A, V + B]. This specification delegates to the Producer the assignment of meaning to the interval, i.e., whether it is a true bound of the actual value measured or some statistical estimate of the actual value.

B.5 Code ISINGL: IBM Single Precision Floating Point

Byte Bit Meaning Field
1 1 -1 S
2 26 E
3 25
4 24
5 23
6 22
7 21
8 20
2 1 2-1 M
2 2-2
3 2-3
4 2-4
5 2-5
6 2-6
7 2-7
8 2-8
3 1 2-9
2 2-10
3 2-11
4 2-12
5 2-13
6 2-14
7 2-15
8 2-16
4 1 2-17
2 2-18
3 2-19
4 2-20
5 2-21
6 2-22
7 2-23
8 2-24
Value = (-1)S * M * 16E-64
Value = 0,  S = E = M = 0
24-bit fractional mantissa with sign bit and 7-bit excess-64 integer exponent, base 16.

When encoding ISINGL values, the following restrictions apply for purposes of normalization:

B.6 Code VSINGL: VAX Single Precision Floating Point

Byte Bit Meaning Field
2 1 -1 S
2 27 E
3 26
4 25
5 24
6 23
7 22
8 21
1 1 20
2 2-2 M
3 2-3
4 S-4
5 2-5
6 2-6
7 2-7
8 2-8
4 1 2-9
2 2-10
3 2-11
4 2-12
5 2-13
6 2-14
7 2-15
8 2-16
3 1 2-17
2 2-18
3 2-19
4 S-20
5 2-21
6 2-22
7 2-23
8 2-24
Value = (-1)2 * (0.5 + M) * 2E-128, E > 0
Value = 0,  E = 0, S = 0, M arbitrary
Value undefined (reserved),  E = 0, S = 1
CAUTION: Note the unusual byte ordering in this illustration!

This representation corresponds to the VAX F-floating format, with bytes ordered according to increasing internal address. That is, when loaded in memory, byte 1 goes into address A, byte 2 into address A+1, byte 3 into A+2, and byte 4 into A+3. As usual, when written to the DLIS Logical Format, byte 1 is written first, followed by byte 2, then 3, then 4.

B.7 Code FDOUBL: IEEE Double Precision Floating Point

Byte Bit Meaning Field
1 1 -1 S
2 210 E
3 29
4 28
5 27
6 26
7 25
8 24
2 1 23
2 22
3 21
4 20
5 2-1 M
6 2-2
7 2-3
8 2-4
3 1 2-5
2 2-6
3 2-7
4 2-8
5 2-9
6 2-10
7 2-11
8 2-12
4 1 2-13
2 2-14
3 2-15
4 2-16
5 2-17
6 2-18
7 2-19
8 2-20
5 1 2-21
2 2-22
3 2-23
4 2-24
5 2-25
6 2-26
7 2-27
8 2-28
6 1 2-29
2 2-30
3 2-31
4 2-32
5 2-33
6 2-34
7 2-35
8 2-36
7 1 2-37
2 2-38
3 2-39
4 2-40
5 2-41
6 2-42
7 2-43
8 2-44
8 1 2-45
2 2-46
3 2-47
4 2-48
5 2-49
6 2-50
7 2-51
8 2-52
Value = (-1)S * (1 + M) * 2E-1023, 0 < E < 2047 [normalized]
Value = (-1)S * (M) * 21022, E = 0, M != 0   [denormalized]
Value = (-1)S * 0, E = 0, M = 0
Value = (-1)S * <infinity>, E = 2047, M = 0 
Value = NaN (Not a Number), E = 2047, M != 0 
Double precision floating point format as defined in ANSI Document STD 754-1985, IEEE Standard for Binary Floating-Point Arithmetic.

15310 = 2318 = (1 + .1448) * 21030-127) =

    01000000 01100011 00100000 00000000 
-15310 = -2318 = -(1 + .1448) * 21030-127) =
    11000000 01100011 00100000 00000000 

B.8 Code FDOUB1: Validated Double Precision Floating Point

Byte Field
1 V(FDOUBL)
2
3
4
5
6
7
8
2 A(FDOUBL)
2
3
4
5
6
7
8
Value = V
A >= 0.0
V is a nominal value with a confidence interval of [V - A, V + A]. This specification delegates to the Producer the assignment of meaning to the interval, i.e., whether it is a true bound of the actual value measured or some statistical estimate of the actual value.

B.9 Code FDOUB2: Two-Way Validated Double Precision Floating Point

Byte Field
1 V(FDOUBL)
2
3
4
5
6
7
8
1 A(FDOUBL)
2
3
4
5
6
7
8
1 B(FDOUBL)
2
3
4
5
6
7
8
Value = V
A, B >= 0.0
V is a nominal value with a confidence interval of [V - A, V + B]. This specification delegates to the Producer the assignment of meaning to the interval, i.e., whether it is a true bound of the actual value measured or some statistical estimate of the actual value.

B.10 Code CSINGL: Single Precision Complex

Byte Field
1 R(FSINGL)
2
3
4
5 I(FSINGL)
6
7
8
Value = R + i* I,  i = (-1)1/2
Single precision real part R (Representation Code FSINGL) and single precision imaginary part I (Representation Code FSINGL).

B.11 Code CDOUBL: Double Precision Complex

Byte Field
1 R(FDOUBL)
2
3
4
5
6
7
8
9 I(FDOUBL)
10
11
12
13
14
15
16
Value = R + i* I,  i = (-1)1/2
Double precision real part R (Representation Code FDOUBL) and double precision imaginary part I (Representation Code FDOUBL).

B.12 Code SSHORT: Short Signed Integer

Byte Bit Meaning Field
1 1 -27 I
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I
Two's complement 1-byte integer.

8910 = 1318 =

    01011001 
-8910 = -1318 =
    10100111 

B.13 Code SNORM: Normal Signed Integer

Byte Bit Meaning Field
1 1 -215 I
2 214
3 213
4 212
5 211
6 210
7 29
8 28
2 1 27
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I
Two's complement 2-byte integer. 15310 = 2318 =
    00000000 10011001 
-15310 = -2318 =
    11111111 01100111 

B.14 Code SLONG: Long Signed Integer

Byte Bit Meaning Field
1 1 -231 I
2 230
3 229
4 228
5 227
6 226
7 225
8 224
2 1 223
2 222
3 221
4 220
5 219
6 218
7 217
8 216
3 1 215
2 214
3 213
4 212
5 211
6 210
7 29
8 28
4 1 27
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I
Two's complement 4-byte integer.

15310 = 2318 =

    00000000 00000000 00000000 10011001 
-15310 = -2318 =
    11111111 11111111 11111111 01100111 

B.15 Code USHORT: Short Unsigned Integer

Byte Bit Meaning Field
1 1 27 I
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I
Unsigned 1-byte integer.

21710 = 3318 =

    10100111 

B.16 Code UNORM: Normal Unsigned Integer

Byte Bit Meaning Field
1 1 215 I
2 214
3 213
4 212
5 211
6 210
7 29
8 28
2 1 27
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I
Unsigned 2-byte integer.

32,92110 = 1002318 =

    10000000 10011001 

B.17 Code ULONG: Long Unsigned Integer

Byte Bit Meaning Field
1 1 231 I
2 230
3 229
4 228
5 227
6 226
7 225
8 224
2 1 223
2 222
3 221
4 220
5 219
6 218
7 217
8 216
3 1 215
2 214
3 213
4 212
5 211
6 210
7 29
8 28
4 1 27
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I
Unsigned 4-byte integer. 15310 = 2318 =
    00000000 00000000 00000000 10011001 

B.18 Code UVARI: Variable-Length Unsigned Integer

Unsigned binary integers, in the range 0 - (230 - 1), can be represented by means of 1, 2, or 4 bytes. Bits 1 and 2 of byte 1 indicate the number of bytes used to represent the value. A one-byte entity is indicated when bit 1 = 0. A two-byte entity is indicated when bit 1 = 1 and bit 2 = 0. A four-byte entity is indicated when bit 1 = 1 and bit 2 = 1. Specific representations are specified below. Field L indicates the length in bytes of the representation. Field I is the value of the representation.
Byte Bit Meaning Field
1 1 0 L
2 26 I
3 25
4 24
5 23
6 22
7 21
8 20
Value = I
Range is zero to (27 - 1)
Byte Bit Meaning Field
1 1 1 L
2 0
3 213 I
4 212
5 211
6 210
7 29
8 28
2 1 27
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I

Range is 27 to (214 - 1)

Byte Bit Meaning Field
1 1 1 L
2 1
3 229 I
4 228
5 227
6 226
7 225
8 224
2 1 223
2 222
3 221
4 220
5 219
6 218
7 217
8 216
3 1 215
2 214
3 213
4 212
5 211
6 210
7 29
8 28
4 1 27
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Value = I

Range is 214 to (230 - 1)

B.19 Code IDENT: Variable-Length Identifier

Byte Meaning
1 L(USHORT)
2 to (1+N) ASCII Characters
L = Length of Character String (N)
1st Character is in Byte 2, Last Character is in Byte 1+N
Each byte in the character string contains a single 7-bit ASCII code in bits 2-8. Bit 1 is zero. For this Representation Code, the permissible ASCII codes are those from 3310 (!) to 9610 (`) and from 12310 ({) to 12610 (~), inclusive. This excludes all transmission control characters, all "white space", and the lower case alphabet. This Representation Code is intended for use with Labels and other identifiers that typically undergo matching processes. Restriction to upper case letters is made to support more efficient implementations. Exclusion of white space is made to minimize ambiguities.

Two IDENT values satisfy a match (i.e., are considered to be equal) whenever they have the same number of characters and the corresponding characters match.

"ABC" =

    00000011 01000001 01000010 01000011 

B.20 Code ASCII: Variable-Length ASCII Character String

Byte Meaning
1 to k L(UVARI)
(k+1) to (k+N) ASCII Characters
L = Length of Character String (N)
k = Length of UVARI representation of N
1st Character is in Byte k+1, Last Character is in Byte k+N
Each byte in the character string contains a single 7-bit ASCII code in bits 2-8. Bit 1 is zero. There is no constraint on the ASCII codes which may be included.

"A
b" (A <linefeed> b) =

    00000011 01000001 00001010 01100010 

B.21 Code DTIME: Date/Time

Byte Bit Meaning Field
1 1 27 Y
2 26
3 25
4 24
5 23
6 22
7 21
8 20
2 1 23 TZ
2 22
3 21
4 20
5 23 M
6 22
7 21
8 20
3 1 27 D
2 26
3 25
4 24
5 23
6 22
7 21
8 20
4 1 27 H
2 26
3 25
4 24
5 23
6 22
7 21
8 20
5 1 27 MN
2 26
3 25
4 24
5 23
6 22
7 21
8 20
6 1 27 S
2 26
3 25
4 24
5 23
6 22
7 21
8 20
7 1 215 MS
2 214
3 213
4 212
5 211
6 210
7 29
8 28
8 1 27
2 26
3 25
4 24
5 23
6 22
7 21
8 20
Y = Years Since 1900 (Range 0 to 255)
TZ = Time Zone (0 = Local Standard, 1 = Local Daylight Savings, 2 = Greenwich Mean Time)
M = Month of the Year (Range 1 to 12)
D = Day of Month (Range 1 to 31)
H = Hours Since Midnight (Range 0 to 23)
MN = Minutes Past Hour (Range 0 to 59)
S = Seconds Past Minute (Range 0 to 59)
MS = Milliseconds Past Second (Range 0 to 999)
9:20:15.62 PM, April 19, 1987 (DST) =
87 years since 1900, 4th month, 19th day,
21 hours since midnight, 20 minutes past hour,
15 seconds past minute, 620 milliseconds past second =
    01010111 00010100 00010011 00010101
    00010100 00001111 00000010 01101100 

B.22 Code ORIGIN: Origin Reference

This Code is a variable-length unsigned integer, equivalent to UVARI, and is used to identify or refer to an Origin. Values with this Representation Code are assigned by applications to ensure their uniqueness within a DLIS Logical File.

B.23 Code OBNAME: Object Name

Byte Meaning
1 to k O(ORIGIN)
k+1 C(USHORT)
(k+2) to end I(IDENT)
O = Origin Reference
C = Copy Number
I = Identifier

This is known as a compound Representation Code, since it is constructed of other codes. Each part that corresponds to another Code is called a Subfield of the Code.

The Origin Subfield must reference an Origin Object that is present in the same Logical File. The Identifier Subfield must be non-null. The Copy Number is used to distinguish two Objects of the same Type that otherwise have the same Origin and Identifier.

B.24 Code OBJREF: Object Reference

Byte Meaning
1 to k T(IDENT)
(k+1) to end N(OBNAME)
T = Object Type
N = Object Name
This is known as a compound Representation Code, since it is constructed of other codes. Each part that corresponds to another Code is called a Subfield of the Code.

The value of k is the number of bytes required to represent the given Object Type using Representation Code IDENT. Code OBJREF is used to locate an Object. It includes the Object's Type (T) and the Object’s Name (N), which consists of Origin, Copy Number, and Identifier Subfields. This combination of four items of information is sufficient to identify any Object in a Logical File.

B.25 Code ATTREF: Attribute Reference

Byte Meaning
1 to k T(IDENT)
(k+1) to (k+j) N(OBNAME)
(k+j+1) to end L(IDENT)
T = Object Type
N = Object Name
L = Attribute Label
This is known as a compound Representation Code, since it is constructed of other codes. Each part that corresponds to another Code is called a Subfield of the Code.

The value of k is the number of bytes required to represent the given Object Type using Representation Code IDENT. The value of j is the number of bytes required to represent the given Object Name using Representation Code OBNAME. Code ATTREF is used to locate an Attribute of an Object. It includes the Object's Type (T), the Object’s Name (N), which consists of Origin, Copy Number, and Identifier Subfields, and the desired Attribute Label (L). This combination of five items of information is sufficient to identify any Attribute of any Object in a Logical File.

T or N or L may be null. When T is null, then T is assumed to be the Type of the Object from which the reference is made. When N is null, then N is assumed to be the Name of the Object from which the reference is made. When N is null, then T must also be null. Further, when N is null, then L must not be null and must be different from the Label of the Attribute from which the reference is made. Thus, it is possible to reference another Attribute in the same Object, but self references are forbidden. When L is null, then L is assumed to be the Label of the Attribute from which the reference is made. When L is null, then N must not be null and must be the name of another Object of the same Type.

B.26 Code STATUS: Boolean Status Value

Byte Meaning
1 S(USHORT)
Value = ALLOWED = TRUE = ON, if S = 1
Value = DISALLOWED = FALSE = OFF, if S = 0

B.27 Code UNITS: Units Expression

Byte Meaning
1 L(USHORT)
2 to (1+N) ASCII Characters
L = Length of Units Expression (N)
1st Character is in Byte 2, Last Character is in Byte 1+N

Syntactically, Representation Code UNITS is similar to Representation Codes IDENT and ASCII. However, upper case and lower case are considered distinct (e.g., "A" and "a" for Ampere and annum, respectively), and permissible characters are restricted to the following ASCII codes:

A UNITS value defines the units of measure associated with a quantity. A UNITS value consists of a scalar and a units expression. The units expression consists of one or more units letter symbols (see below), each with an integer exponent.

The absence of the UNITS field provides no information about the units of measurement of the associated quantity. The presence of a null UNITS field implies that the associated quantity is unitless.

A non-null UNITS field consists of a units expression, optionally preceded by a scalar. If absent, the implied value of the scalar is one (1). The scalar is a constant in the form of a fraction:

xEn/y
where x and y are decimal numbers,

n is a decimal integer, and
E is the character "E".

The optional component "En" signifies the power of 10 multiplier of the numerator. The default value of the optional denominator component "/y" is one.

The number "x" may be represented as a set of ASCII numeric digits, an optional decimal point ("."), and an optional leading minus sign ("-"). The plus sign ("+") is not allowed. Leading zeros are not allowed, except that a single zero is required before the decimal point for fractional values. Trailing zeros in the fractional part are not allowed. A decimal point may only occur if followed by digits.

The number "y" is represented similarly to "x", except that only positive numbers are allowed.

The integer "n" is represented similarly to "x", except that the decimal point and fractional part are not allowed.

The units expression consists of a combination of units factors. Each units factor consists of a dictionary-controlled "letter symbol" and an exponent. The exponent of each letter symbol is optional, with a default value of one (1). The exponent for a letter symbol is represented by a decimal integer constant immediately following the letter symbol.

The units expression is either a multiplicative combination of distinct units factors or a numerator and a denominator, each of which is a multiplicative combination of distinct units factors. The factors in a multiplicative combination are separated by the dot character (".").

If the numerator/denominator form is used, the denominator follows the numerator and is separated from it by a single slash ("/"). If the denominator consists of more than one units factor, the denominator is preceded by an open parenthesis ("(") and followed by a close parenthesis (")").

Letter symbols are composed from the alphabetic characters ("A", "B", "C", ..., "Z", and "a", "b", "c", ..., "z").

This Representation Code and its interpretation are consistent with methods in common use, and specifically with guidelines published in the following documents: