In Section 11.3 Constrained integer types, Larmouth gives an example PER
encoding:

integer11 INTEGER (0..32000) ::= 0, 31000

integer11 C:P00000000 00000000, C:P01111001 00011000

However referring to the standard:

10.5.6 In the case of the UNALIGNED variant the value ("n" – "lb") shall
be encoded as a non-negative-binary-integer in a bit-field as specified
in 10.3 with the minimum number of bits necessary to represent the range.
   NOTE – If "range" satisfies the inequality 2^m < "range" ≤ 2^(m + 1),
then the number of bits = m + 1.

2^14 (=16384) < 32000 - 0 + 1 ≤ 2^15 (=32768) and so the minimum number
of bits is 15 (not 16) and therefore the encodings should be

integer11 C:P0000000 00000000, C:P1111001 00011000

I've checked this with asn1c and it agrees with my reasoning.

Dominic.

_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to