Subject: RE: [rohc] sigcomp - meaning of the F bit in the input_bit_order

From: "Ollis, Paul" <[email-masked]>
Date: Tue, 17 May 2005 10:35:31 +0100

Hi Christian, Partha,

Actually the F/H and P bits do not quite work as suggested. (From this point
on I will just talk about the F-but rather than the F/H bit.)
The effects of the F-bit are different to the effects of the P-bit. 

The P-bit only affects how bits within each byte are read. The F-bit affects
how the bits are assembled into the input value; and the value can be up to 16
bits long. The difference is not immediately obvious but I think a concrete
example helps show how this works.

(The rest of this will be easier to read using fixed width font.)

Suppose your input buffer contains the bytes

    hex: F0 A3
    bin: 1111 0000   1010 0011

If the P-bit is zero (0) then the order the bits are read in 
the following order (starting with a).

    1111 0000   1010 0011 
    abcd efgh   ijkl mnop

So if, for example 11 bits are input, the bits read are:

    1 1 1 1  0 0 0 0   1 0 1
    a b c d  e f g h   i j k

and the input buffer is then as shown ('x' marks bits that 
have been used).

    xxxx xxxx   xxx0 0011
                   l mnop
          
and the next INPUT-BITS starts with bit 'l'.

If the P-bit is one (1) then the order the bits input order is.

    1111 0000   1010 0011
    hgfe dcba   ponm lkji

Giving the results, for 11 bits input.

    0 0 0 0  1 1 1 1  1 1 0
    a b c d  e f g h  i j k
    
    xxxx xxxx   1010 0xxx
                ponm l   

The F-bit affects how the bits 'a' to 'k' are interpreted to give the result.

If the F-bit is zero (0) then bit 'a' is the MSB and 'k' is the LSB. So for
F=0, P=0 the value is

   1 1 1 1  0 0 0 0  1 0 1  or  111 1000 0101  or (as hex) 785
   a b c d  e f g h  i j k

and for F=0, P=1 the value is

   0 0 0 0  1 1 1 1  1 1 0  or  000 0111 1110  or (as hex) 07E
   a b c d  e f g h  i j k

When F is one(1), bit 'k' is the MSB and 'a' is the LSB. 
So for F=1, P=0

   1 0 1  0 0 0 0  1 1 1 1  or  101 0000 1111  or (as hex) 50F
   k j i  h g f e  d c b a

and F=1, P=1

   0 1 1  1 1 1 1  0 0 0 0  or  011 1111 0000  or (as hex) 3F0
   k j i  h g f e  d c b a

Notice that F=1, P=1 does *not* give the same result as F=0, P=0.
Also, F=0, P=1 gives a different result to F=1, P=0.

I hope this helps make things clearer.
 
Cheers,
Paul

-----Original Message-----
From: [email-masked] [mailto:[email-masked]] 
Sent: 16 May 2005 12:27
To: Cristian CONSTANTIN
Cc: [email-masked]; [email-masked]; [email-masked]
Subject: Re: [rohc] sigcomp - meaning of the F bit in the input_bit_order register

Hi, 

Please read in-line 

Cristian CONSTANTIN <[email-masked]> 
Sent by: [email-masked] 
04/13/2005 04:18 PM 
[email-masked] 
cc
Subject[rohc] sigcomp - meaning of the F bit in the input_bit_order        register

hi!

please help me to grasp the meaning of the F/H bits :-) 
in the SigComp rfc, at 8.2.  Requesting Additional Compressed Data there
is this statement:

 "When an INPUT instruction requests n bits of compressed data, it
  interprets the received bits as an integer between 0 and 2^n - 1.
  The F-bit and the H-bit specify whether the bits in these integers
  are considered to arrive in MSB to LSB order (bit set to 0) or in LSB
  to MSB order (bit set to 1)."

how should this be interpreted?

1. same as for the P bit; that is the bytes themselves are always in 
network byte order but the bits in the bytes are in LSB to MSB order when
F=1 and the other way around for F=0.

<Partha> Yes, F-Bit is same as P-Bit for the INPUT-BITS instruction </Partha> 

2. the bits in the _(short) integer_ are:
  
a. LSB to MSB for F=1. that would mean that the component bytes are
  also swapped which would more or less contradict another statement in
  8.2:
  "Note that the input_bit_order register cannot change the order in
  which the bytes themselves are passed to the INPUT instructions
  (bytes are always passed in the same order as they occur in the
  SigComp message)."

<Partha>  The input_bit_order register talks only about the order of flow of bits within a byte. 
          It has nothing to do with the order of flow of bytes </Partha> 
   
b. MSB to LSB for F=0. 

now, if 1 is the right interpretation, then wouldn't P=1 && F=1 cancel 
each other's effect?

<Partha>  Yes, your understanding of the above point is correct. </Partha> 

thank you for your attention.
bye now!
cristian
-- 
_          | There are many people who use UNIX or Linux  
(_'_        | who IMHO do not understand UNIX.
 (_'rist   |              --David Korn  
GPG public key at wwwkeys.de.pgp.net
_______________________________________________
Rohc mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/rohc

***********************  FSS-Unclassified   ***********************

_______________________________________________
Rohc mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/rohc