Hello,Signona

Thanks for your kind help all the while. :)

Yeah. I have download the two books you listed in previous mail. Also I get one 
copy of the ITU-T specifications about ASN.1.I have read X.680 and X.691 for my 
understanding on unaligned PER application. As a newer to read this two specs 
maybe there are some difficulties to understand well. I will put more efforts 
onto it.

Again thanks.

Cheers!
 
Zhao Chao
-----Original Message-----
From: Conrad Sigona [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 11:07 PM
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: Re: [ASN1] Can anyone give an ULIGNED PER Encoding sample?

> 1.   Can anyone give a sample of unaligned PER encoding?

Yes, but I'm not so sure it would be useful without your reviewing the 
books I suggested. PER is somewhat advanced considering you don't yet 
understand tags.

In any case, let's take the specifications

    Y ::= INTEGER
    Z ::= INTEGER (0..15)

which say that Y may take any integer, while Z may only take integers 
within the range 0-15. If I use unaligned PER to encode them, the encoder 
takes advantage of the fact that Z can only have 16 possible states. That 
is, the length of Y, since one cannot put a bound on the possible values, 
is unknown, so it would have to include a length field. Z, on the other 
hand, can only have 16 states, and it only takes 4 bits to enumerate the 
16 states, so PER uses 4 bits for the value and no bits for the length.

By way of example

    y Y ::= 15  -- in unaligned PER, this becomes 010F
    z Z ::= 15  -- in unaligned PER, this becomes F

> 2.  INTEGER(0..10,...,5) -the value 5 encodes as a root value,not as an 
> extension addition
>
> How to understand this definition above?"0..10" denotes size 
> constrained."..." denotes extension.How about the value 5?How to 
> understand it as a root value?Any sample of its application?

The 0..10 part says that the integer must take a value within the range 
0-10. The ",..." part says it is extensible, that is, that a future 
release of the ASN.1 might relax that constraint. Imagine we have
Z defined like in question 1 above, but that we wish to allow some 
flexibility for the future. We could define it like this

    Z ::= INTEGER (0..10,...)

which means that someone might come along and relax the restriction later 
on (actually the concept of extensibility is more complicated, but I don't 
want to give you a lesson on extensibility at this early stage; you should 
read the books).

In time, someone does come along and wishes to relax the constraint on Z 
to also allow 11-15. The way he would do it is

    Z ::= INTEGER (0..10, ..., 11..15)

Values with the range 0-10 are considered within the root; values outside 
that range are considered within the extension. Your example 
"(0..10,...,5)" doesn't make much sense since the 5 is already within the 
root.

> 3.What's the function of TAG in set/sequence/choice... ?What's impact to 
> encodings by TAG?

Please read the books. Once you've read them, if you still don't 
understand tags, please ask again.

=====================================================================
Conrad Sigona                    Voice Mail     : 1-732-302-9669 x400
OSS Nokalva                      Fax            : 1-614-388-4156
[EMAIL PROTECTED]                   My direct line : 1-315-845-1773


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

Reply via email to