5
-- Use a bit string type to model binary data whose format and
6
-- length are unspecified,
7
-- or specified elsewhere, and whose length in bits is not necessarily
8
-- a multiple of eight.
11
G3FacsimilePage ::= BIT STRING
12
-- a sequence of bits conforming to Recommendation T.4.
14
image G3FacsimilePage ::= '100110100100001110110'B
15
trailer BIT STRING ::= '0123456789ABCDEF'H
16
body1 G3FacsimilePage ::= '1101'B
17
body2 G3FacsimilePage ::= '1101000'B
20
-- Use a bit string type with a size constraint to model the
21
-- values of a fixed sized bit field.
24
BitField ::= BIT STRING (SIZE (12))
25
map1 BitField ::= '100110100100'B
26
map2 BitField ::= '9A4'H
27
map3 BitField ::= '1001101001'B -- Illegal - violates size constraint
30
-- Use a bit string type to model the values of a bit map, an
31
-- ordered collection of logical variables
32
-- indicating whether a particular condition holds for each of a
33
-- correspondingly ordered collection of objects.
35
DaysOfTheWeek ::= BIT STRING {
36
sunday(0), monday (1), tuesday(2),
37
wednesday(3), thursday(4), friday(5),
38
saturday(6) } (SIZE (0..7))
40
sunnyDaysLastWeek1 DaysOfTheWeek ::= {sunday, monday, wednesday}
41
sunnyDaysLastWeek2 DaysOfTheWeek ::= '1101'B
42
sunnyDaysLastWeek3 DaysOfTheWeek ::= '1101000'B
43
sunnyDaysLastWeek4 DaysOfTheWeek ::= '11010000'B -- Illegal - violates size constraint
46
-- Use a bit string type with named bits to model the values of a
47
-- collection of related logical variables.
50
PersonalStatus ::= BIT STRING
51
{married(0), employed(1), veteran(2), collegeGraduate(3)}
53
billClinton PersonalStatus ::= {married, employed, collegeGraduate}
54
hillaryClinton PersonalStatus ::= '110100'B