Conrad said it succinctly - c).  And Ed queried your syntax for the type
definition.

But *I* want to query your use of "valuA" and "valueB".  Here you are
naming bits in the bitstring, you are not defining abstract values.  It
is, of course, perfectly legal to name a bit as "valueA", but it is
**pretty misleading**.

A VALUE of the bitstring could be:

        {valueA,  valueB}

meaning that the valueA bit and the valueB bit are both set (to one) in
the value, and all other bits are not set.  So the VALUE above is
101000000.......
with arbtrarily many trailing zero bits.

But don't ask me to go into the arbitrarily many trailing zero bits
question!

The Standard says you can only use this notation if "trailing zero bits
are not significant".  So the 0000...... don't matter.

John L


Ed Day wrote:
> 
> My guess is option c) .
> 
> (BTW: it is "BIT STRING" not "BIT_STRING").
> 
> Regards,
> 
> Ed Day
> Objective Systems, Inc.
> REAL WORLD ASN.1 AND XML SOLUTIONS
> Tel: +1 (484) 875-3020
> Fax: +1 (484) 875-2913
> Toll-free: (877) 307-6855 (USA only)
> mailto:eday@;obj-sys.com
> http://www.obj-sys.com
> 
> ----- Original Message -----
> From: "Ricardo Barroso" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, October 31, 2002 2:39 PM
> Subject: [ASN.1] BIT_STRING value meaning?
> 
> > Hi!
> >
> > I have a question about BIT_STRINGs because I haven't understood one
> > thing...
> >
> > If I have the following ASN.1 definition:
> >
> >     MyBitString ::= BIT_STRING {
> >         valueA    (0),
> >         valueB    (2)    }
> >
> > What are the correct representation of the BIT_STRING bits correspondent
> > to valueB?
> >
> >     a) 01000000    (the lowest bit is at left and the value is the
> > decimal correspondent value)
> >     b) 00000010    (the lowest bit is at right and the value is the
> > decimal correspondent value)
> >     c) 00100000    (the lowest bit is at left and the value means that
> > the correspondent second (2) bit number has value one (1))
> >     d) 00000100    (the lowest bit is at right and the value means that
> > the correspondent second (2) bit number has value one (1))
> >
> > I suppose that's the option a) but I don't know If I am right!?
> >
> > Thanks in advance,
> > Ricardo Barroso
> >

-- 
   Prof John Larmouth
   Larmouth T&PDS Ltd
   (Training and Protocol Development Services)
   1 Blueberry Road                     
   Bowdon                               [EMAIL PROTECTED]
   Cheshire WA14 3LS                    Tel: +44 161 928 1605
   England                              Fax: +44 161 928 8069

Reply via email to