Re: Pointing to high and low bytes of something
From: Eric Sosman (Eric.Sosman_at_sun.com)
Date: 11/19/03
- Next message: Sheldon Simms: "Re: value bits"
- Previous message: Dan Pop: "Re: Header include order"
- In reply to: Dan Pop: "Re: Pointing to high and low bytes of something"
- Next in thread: Chris Torek: "Re: Pointing to high and low bytes of something"
- Reply: Chris Torek: "Re: Pointing to high and low bytes of something"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 19 Nov 2003 14:05:20 -0500
Dan Pop wrote:
>
> In <3FBB8E9B.83756527@sun.com> Eric Sosman <Eric.Sosman@sun.com> writes:
>
> >Dan Pop wrote:
> >>
> >> Your observation about LSB and MSB is theoretically correct, but C
> >> implementations on 8-bit bytes machines are supposed to use the
> >> underlying hardware bit order, which never assigns the bits randomly.
> >> The only known variation is the byte order, but not the order of bits
> >> inside a byte.
> >
> ><pet-peeve>
> >
> > Unless the machine is able to address objects smaller
> >than a byte, "the order of bits inside a byte" is undetectable
> >and need not even be meaningful at all.
>
> When you map a wider object by an array of bytes, it helps a lot if the
> order of bits inside the byte is consistent with the order of bits inside
> the wider object. Both hardware designers and C implementors seem to
> agree on this point.
<topicality degree="straying">
I think you've missed the thrust of the argument, or
perhaps the argument's thrust went wide of you. I'm saying
that (1) bit order is not detectable by any C construct I
can imagine, (2) bit order is not detectable by any CPU
instruction on a machine that lacks bit-level addressing,
(3) by Occam's Razor, that which is undetectable is better
omitted from discussion.
I offered two fanciful examples of situations where bit
order could not really be said to exist at all. For a real-
life example, consider the signals that travel between a pair
of modems. Early modems used two easily-distinguished tones
to transmit individual bits: BEEP for zero and BOOP for one,
as it were. Later, it was found that higher speeds could be
obtained by associating the bits with the transitions between
the tones rather than with the tones themselves. Modern
modems go even further: they use a whole palette of tones
(BEEP, BOOP, BRAAP, BZZZ, ...) and encode a whole bunch of
bits in each transition.
The question: What is the "bit order" of the N bits
encoded by one single BZZZ-to-BEEP transition in this scheme?
Note that all N bits leave the transmitter encoded in one
single event and arrive at the receiver the same way: they
are simultaneous and indivisible -- and I say the entire
idea of "bit order" in such a situation is meaningless.
</topicality>
-- Eric.Sosman@sun.com
- Next message: Sheldon Simms: "Re: value bits"
- Previous message: Dan Pop: "Re: Header include order"
- In reply to: Dan Pop: "Re: Pointing to high and low bytes of something"
- Next in thread: Chris Torek: "Re: Pointing to high and low bytes of something"
- Reply: Chris Torek: "Re: Pointing to high and low bytes of something"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|