You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by "Costello, Roger L." <co...@mitre.org> on 2019/02/15 12:33:29 UTC

I don't understand bitOrder - please help!

Hello DFDL community,

I've read the portions of the specification that discuss bitOrder. I'm lost.

I ran some tests to get a feel for the difference between leastSignificantBitFirst and mostSignificantBitFirst. See below. Based on my tests, it appears there is no difference between leastSignificantBitFirst and mostSignificantBitFirst. Would you explain what this bitOrder stuff is all about, please?  /Roger

[cid:image003.png@01D4C500.BE51F0E0]

Re: I don't understand bitOrder - please help!

Posted by "Beckerle, Mike" <mb...@tresys.com>.
Probably bit order should have been called bit numbering system.

It does nothing for whole bytes.

It is only about which bits are considered to occupy which index positions.

So given byte with value 128, base 2 that is 80 hex or 10000000. So is the "first" bit a 1 or a zero?

Least significant bit first or LSBF, the first bit is the rightmost zero. Most significant bit first, MSBF, the first bit is the 1 on the left.

Many format standards describe the bits numbering from right to left.





Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Costello, Roger L. <co...@mitre.org>
Sent: Friday, February 15, 2019 7:33:29 AM
To: users@daffodil.apache.org
Subject: I don't understand bitOrder - please help!

Hello DFDL community,

I’ve read the portions of the specification that discuss bitOrder. I’m lost.

I ran some tests to get a feel for the difference between leastSignificantBitFirst and mostSignificantBitFirst. See below. Based on my tests, it appears there is no difference between leastSignificantBitFirst and mostSignificantBitFirst. Would you explain what this bitOrder stuff is all about, please?  /Roger

[cid:image003.png@01D4C500.BE51F0E0]

Re: [EXT] Re: I don't understand bitOrder - please help!

Posted by Steve Lawrence <sl...@apache.org>.
That's correct. As a minimal example, let's imagine we had one byte of
data like so, with bits labels A-H:

 Label: ABCDEFGH
  Bits: 01011001

Imagine we had an element like so:

  <xs:element name="bit3" type="xs:int" dfdl:length="3" ... />

So an integer with length 3 bits.

With bitOrder = MSBF, we would read the 3 most significant bits first.
So bits A-C and a value of 2 (010). If there was a following element,
the next bit read would be bit D.

With bitOrdre = LSBF, we would read the 3 least significant bits first.
So bits F-H and a value of 1 (001). If there was a following element,
the next bit read would be bit E.



On 2/15/19 8:33 AM, David Winant wrote:
> Roger,
> 
> "Most significant" is implied as leftmost because that is the way we write 
> numbers.  It means the bit associated with the highest power of 2, 2^7 in the 
> case of a byte.
> 
> What the bitOrder controls is whether the "first" bit is read from the right or 
> read from the left.
> 
> David
> 
> On Fri, Feb 15, 2019 at 8:13 AM Costello, Roger L. <costello@mitre.org 
> <ma...@mitre.org>> wrote:
> 
>     Hi Mike,____
> 
>     __ __
> 
>       * Least significant bit first or LSBF, the first bit is the rightmost
>         zero.____
> 
>     __ __
> 
>     So the most significant bit is the leftmost one.____
> 
>     __ __
> 
>       * Most significant bit first, MSBF, the first bit is the 1 on the left.____
> 
>     __ __
> 
>     So the least significant bit is the rightmost zero.____
> 
>     __ __
> 
>     Aren’t they saying the same thing: The most significant bit is the leftmost
>     one and the least significant bit if the rightmost zero. What’s the
>     value/benefit/use-case of specifying bitOrder? ____
> 
>     __ __
> 
>     /Roger____
> 
>     __ __
> 
>     *From:* Beckerle, Mike <mbeckerle@tresys.com <ma...@tresys.com>>
>     *Sent:* Friday, February 15, 2019 8:02 AM
>     *To:* users@daffodil.apache.org <ma...@daffodil.apache.org>
>     *Subject:* [EXT] Re: I don't understand bitOrder - please help!____
> 
>     __ __
> 
>     Probably bit order should have been called bit numbering system. ____
> 
>     It does nothing for whole bytes.____
> 
>     It is only about which bits are considered to occupy which index positions. ____
> 
>     So given byte with value 128, base 2 that is 80 hex or 10000000. So is the
>     "first" bit a 1 or a zero?____
> 
>     Least significant bit first or LSBF, the first bit is the rightmost zero.
>     Most significant bit first, MSBF, the first bit is the 1 on the left. ____
> 
>     Many format standards describe the bits numbering from right to left.
> 
> 
> 
> 
>     ____
> 
>     Get Outlook for Android <https://aka.ms/ghei36>____
> 
>     __ __
> 
>     --------------------------------------------------------------------------------
> 
>     *From:*Costello, Roger L. <costello@mitre.org <ma...@mitre.org>>
>     *Sent:* Friday, February 15, 2019 7:33:29 AM
>     *To:* users@daffodil.apache.org <ma...@daffodil.apache.org>
>     *Subject:* I don't understand bitOrder - please help! ____
> 
>     ____
> 
>     Hello DFDL community,____
> 
>     ____
> 
>     I’ve read the portions of the specification that discuss bitOrder. I’m lost.____
> 
>     ____
> 
>     I ran some tests to get a feel for the difference between
>     leastSignificantBitFirst and mostSignificantBitFirst. See below. Based on my
>     tests, it appears there is no difference between leastSignificantBitFirst
>     and mostSignificantBitFirst. Would you explain what this bitOrder stuff is
>     all about, please?  /Roger____
> 
>     ____
> 
>     ____
> 
> 
> 
> -- 
> 
> David Winant |*Trident Systems Incorporated
> *Sr. Software Engineer, Integrated Systems Engineering Group
> 10201 Fairfax Boulevard 
> <https://maps.google.com/?q=10201+Fairfax+Boulevard+%7C+Suite+300+%7C+Fairfax,+VA+22030&entry=gmail&source=g>  | 
> Suite 300 
> <https://maps.google.com/?q=10201+Fairfax+Boulevard+%7C+Suite+300+%7C+Fairfax,+VA+22030&entry=gmail&source=g>  | 
> Fairfax, VA 22030 
> <https://maps.google.com/?q=10201+Fairfax+Boulevard+%7C+Suite+300+%7C+Fairfax,+VA+22030&entry=gmail&source=g> 
> 
> d: 703.267.6014 | c: 304.237.4960 | f: 703.359.6226
> e: david.winant@tridsys.com <ma...@tridsys.com>  | www.tridsys.com 
> <http://www.tridsys.com/>
> 
> **
> 
> 143x59-trident-logo-web-small
> 
> /Notice: The information contained in this email message is considered 
> confidential and proprietary to the sender and is intended solely for review and 
> use by the named recipient.  Any unauthorized review, use or distribution is 
> strictly prohibited. If you have received this message in error, please advise 
> the sender by reply email and delete the message./
> 


Re: [EXT] Re: I don't understand bitOrder - please help!

Posted by David Winant <da...@tridsys.com>.
Roger,

"Most significant" is implied as leftmost because that is the way we write
numbers.  It means the bit associated with the highest power of 2, 2^7 in
the case of a byte.

What the bitOrder controls is whether the "first" bit is read from the
right or read from the left.

David

On Fri, Feb 15, 2019 at 8:13 AM Costello, Roger L. <co...@mitre.org>
wrote:

> Hi Mike,
>
>
>
>    - Least significant bit first or LSBF, the first bit is the rightmost
>    zero.
>
>
>
> So the most significant bit is the leftmost one.
>
>
>
>    - Most significant bit first, MSBF, the first bit is the 1 on the left.
>
>
>
> So the least significant bit is the rightmost zero.
>
>
>
> Aren’t they saying the same thing: The most significant bit is the
> leftmost one and the least significant bit if the rightmost zero. What’s
> the value/benefit/use-case of specifying bitOrder?
>
>
>
> /Roger
>
>
>
> *From:* Beckerle, Mike <mb...@tresys.com>
> *Sent:* Friday, February 15, 2019 8:02 AM
> *To:* users@daffodil.apache.org
> *Subject:* [EXT] Re: I don't understand bitOrder - please help!
>
>
>
> Probably bit order should have been called bit numbering system.
>
> It does nothing for whole bytes.
>
> It is only about which bits are considered to occupy which index
> positions.
>
> So given byte with value 128, base 2 that is 80 hex or 10000000. So is the
> "first" bit a 1 or a zero?
>
> Least significant bit first or LSBF, the first bit is the rightmost zero.
> Most significant bit first, MSBF, the first bit is the 1 on the left.
>
> Many format standards describe the bits numbering from right to left.
>
>
>
>
> Get Outlook for Android <https://aka.ms/ghei36>
>
>
> ------------------------------
>
> *From:* Costello, Roger L. <co...@mitre.org>
> *Sent:* Friday, February 15, 2019 7:33:29 AM
> *To:* users@daffodil.apache.org
> *Subject:* I don't understand bitOrder - please help!
>
>
>
> Hello DFDL community,
>
>
>
> I’ve read the portions of the specification that discuss bitOrder. I’m
> lost.
>
>
>
> I ran some tests to get a feel for the difference between
> leastSignificantBitFirst and mostSignificantBitFirst. See below. Based on
> my tests, it appears there is no difference between
> leastSignificantBitFirst and mostSignificantBitFirst. Would you explain
> what this bitOrder stuff is all about, please?  /Roger
>
>
>
>

-- 

David Winant |
*   Trident Systems Incorporated *Sr. Software Engineer, Integrated Systems
Engineering Group
10201 Fairfax Boulevard
<https://maps.google.com/?q=10201+Fairfax+Boulevard+%7C+Suite+300+%7C+Fairfax,+VA+22030&entry=gmail&source=g>
  |  Suite 300
<https://maps.google.com/?q=10201+Fairfax+Boulevard+%7C+Suite+300+%7C+Fairfax,+VA+22030&entry=gmail&source=g>
  |  Fairfax, VA 22030
<https://maps.google.com/?q=10201+Fairfax+Boulevard+%7C+Suite+300+%7C+Fairfax,+VA+22030&entry=gmail&source=g>

d: 703.267.6014 | c: 304.237.4960 | f: 703.359.6226
e: david.winant@tridsys.com  |  www.tridsys.com

 [image: 143x59-trident-logo-web-small]

*Notice: The information contained in this email message is considered
confidential and proprietary to the sender and is intended solely for
review and use by the named recipient.  Any unauthorized review, use or
distribution is strictly prohibited. If you have received this message in
error, please advise the sender by reply email and delete the message.*

RE: [EXT] Re: I don't understand bitOrder - please help!

Posted by "Costello, Roger L." <co...@mitre.org>.
Hi Mike,


  *   Least significant bit first or LSBF, the first bit is the rightmost zero.

So the most significant bit is the leftmost one.


  *   Most significant bit first, MSBF, the first bit is the 1 on the left.

So the least significant bit is the rightmost zero.

Aren't they saying the same thing: The most significant bit is the leftmost one and the least significant bit if the rightmost zero. What's the value/benefit/use-case of specifying bitOrder?

/Roger

From: Beckerle, Mike <mb...@tresys.com>
Sent: Friday, February 15, 2019 8:02 AM
To: users@daffodil.apache.org
Subject: [EXT] Re: I don't understand bitOrder - please help!

Probably bit order should have been called bit numbering system.
It does nothing for whole bytes.
It is only about which bits are considered to occupy which index positions.
So given byte with value 128, base 2 that is 80 hex or 10000000. So is the "first" bit a 1 or a zero?
Least significant bit first or LSBF, the first bit is the rightmost zero. Most significant bit first, MSBF, the first bit is the 1 on the left.
Many format standards describe the bits numbering from right to left.




Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Costello, Roger L. <co...@mitre.org>>
Sent: Friday, February 15, 2019 7:33:29 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: I don't understand bitOrder - please help!

Hello DFDL community,

I've read the portions of the specification that discuss bitOrder. I'm lost.

I ran some tests to get a feel for the difference between leastSignificantBitFirst and mostSignificantBitFirst. See below. Based on my tests, it appears there is no difference between leastSignificantBitFirst and mostSignificantBitFirst. Would you explain what this bitOrder stuff is all about, please?  /Roger

[cid:image001.png@01D4C506.539F6E20]