> I need a clarification on how the following (marked in bold) will be
> encoded in PER.
>
> As far as my understaning of ITU-T document X.691 (section 13.3),
>
> value EnumType ::= 12 (value is not in the Extension root). Below, the
> corresponding ASN.1 spec is marked in bold.
>
> will be encoded as,
>
> 1 Extension bit
> 0 000110 (Encoding 12-6 as Normally small non-negative number).
> 6 is the maximum index of the enum values in the root.
>
> The hex equivalent is 0x86.
>
> Please let me know is it right? Do we need complement the value when it
> is not within the extension root?
> Kindly suggest.
>
>
> Below is the ASN.1 spec.
> EnumType ::= ENUMERATED {
> a,
> b,
> c,
> d,
> e,
> f,
> ...
> }
Dear Mr. Nidugala:
Yes, you are right about the 86. Assuming the ASN.1 looks like this
EnumType ::= ENUMERATED { a, b, c, d, e, f, ..., g, h, i, j, k, l, m }
the list of possible values up through your example, 12, follows
name value hex bit breakout
a 0 0x 0 (in root) + 000 (value)
b 1 1x 0 (in root) + 001 (value)
c 2 2x 0 (in root) + 010 (value)
d 3 3x 0 (in root) + 011 (value)
e 4 4x 0 (in root) + 100 (value)
f 5 5x 0 (in root) + 101 (value)
g 6 80 1 (in ext ) + 0000000 (value)
h 7 81 1 (in ext ) + 0000001 (value)
i 8 82 1 (in ext ) + 0000010 (value)
j 9 83 1 (in ext ) + 0000011 (value)
k 10 84 1 (in ext ) + 0000100 (value)
l 11 85 1 (in ext ) + 0000101 (value)
m 12 86 1 (in ext ) + 0000110 (value)
Notice that the count restarts with 0 once we are in the extension. Also
notice that the encoded values a through f are only 4 bits long. If we had
Z ::= SEQUENCE { x EnumType, y EnumType }
tworoots Z ::= { x d, y d }
twoexts Z ::= { x m, y m }
tworoots would encode as 33, while twoexts would encode as 8686.
Please let me know if this helps.
=====================================================================
Conrad Sigona Voice Mail : 1-732-302-9669 x400
OSS Nokalva Fax : 1-419-831-5035
[EMAIL PROTECTED] My direct line : 1-315-845-1773