machintosh bit order
Author Message
machintosh bit order

Let's say I have a byte ( 8 bit unsigned integer )

I ask a machintosh programmer the following question:

What does bit position 7 represent ?

A. Most significant bit.
B. Least significant bit.

What would his answer be ?

( RFC:  791 and STD:  5 are a bit confusing when it comes to bit
order, see the drawings )
--
Skybuck presents free software for windows 95 and up:
Network Info, UDP Speed Test and UDP Multicast Test
http://www.*-*-*.com/ ~skybuck

Sun, 04 Apr 2004 00:27:12 GMT
machintosh bit order

Quote:

>Let's say I have a byte ( 8 bit unsigned integer )

>I ask a machintosh programmer the following question:

>What does bit position 7 represent ?

>A. Most significant bit.
>B. Least significant bit.
>What would his answer be ?

Depends upon the machine's architecture.
Could be either.  Try researching the Mac
hardware --- discussions of specific systems
are off topic here.

-Mike

Sun, 04 Apr 2004 01:22:55 GMT
machintosh bit order

Quote:

> Let's say I have a byte ( 8 bit unsigned integer )

> I ask a machintosh programmer the following question:

> What does bit position 7 represent ?

> A. Most significant bit.
> B. Least significant bit.

> What would his answer be ?

It depends where you started counting. If you call the least
significant bit zero, then 7 is the most significant bit. If you call
the most significant bit zero, then 7 is the least significant bit.
Either numbering scheme makes sense. What does this have to do with
Machinstoshes?

DS

Sun, 04 Apr 2004 01:23:08 GMT
machintosh bit order

Quote:

> Let's say I have a byte ( 8 bit unsigned integer )

> I ask a machintosh programmer the following question:

> What does bit position 7 represent ?

> A. Most significant bit.
> B. Least significant bit.

> What would his answer be ?

This is off topic here, take it to:
comp.sys.mac.programmer
or  comp.sys.mac.programmer.misc

Quote:
> ( RFC:  791 and STD:  5 are a bit confusing when it comes to bit
> order, see the drawings )

--
Clark S. Cox III

Sun, 04 Apr 2004 01:32:45 GMT
machintosh bit order

Quote:

> Let's say I have a byte ( 8 bit unsigned integer )

> I ask a machintosh programmer the following question:

> What does bit position 7 represent ?

> A. Most significant bit.
> B. Least significant bit.

> What would his answer be ?

Normally `bit 7' is the bit with value 2**7 == 1<<7 == 128, which
would be the MSB.
--
"When I have to rely on inadequacy, I prefer it to be my own."
--Richard Heathfield

Sun, 04 Apr 2004 01:37:14 GMT
machintosh bit order

Quote:
>Let's say I have a byte ( 8 bit unsigned integer )

>I ask a machintosh programmer the following question:

>What does bit position 7 represent ?

C does not number bits.
The only bit numbering that makes sense numbers them 1, 2, 4, 8, 16,
32, 64, 128, 256, ...

The machine languages of some CPUs do not number the bits,
either (even though the DOCUMENTATION that comes with the CPU
probably does).  For that, you need an instruction which accepts a
bit number in a register.

Quote:

>A. Most significant bit.
>B. Least significant bit.

>What would his answer be ?

"What the heck you talking about?" is the most
appropriate answer I can think of.

Quote:
>( RFC:  791 and STD:  5 are a bit confusing when it comes to bit
>order, see the drawings )

Gordon L. Burditt

Sun, 04 Apr 2004 02:33:31 GMT
machintosh bit order

Quote:

>> Let's say I have a byte ( 8 bit unsigned integer )

>> I ask a machintosh programmer the following question:

>> What does bit position 7 represent ?

>> A. Most significant bit.
>> B. Least significant bit.

>> What would his answer be ?
>Normally `bit 7' is the bit with value 2**7 == 1<<7 == 128,
>which would be the MSB.

To be consistent with big-endian addressing, where the most significant
byte has the lower address, big-endian bit numbering would give the MSB
the lower address, and so it would be bit 0.  This is the numbering
that IBM uses for their big-endian machines.  I believe that some other
companies do, too, but I don't know about Apple.

Most programmers don't worry about bit numbering, so I couldn't say
what one would say if you asked.  Why don't you ask one?

-- glen

Sun, 04 Apr 2004 02:40:29 GMT
machintosh bit order

Quote:

> >> Let's say I have a byte ( 8 bit unsigned integer )

> >> I ask a machintosh programmer the following question:

> >> What does bit position 7 represent ?

> >> A. Most significant bit.
> >> B. Least significant bit.

> >> What would his answer be ?

> >Normally `bit 7' is the bit with value 2**7 == 1<<7 == 128,
> >which would be the MSB.

> To be consistent with big-endian addressing, where the most significant
> byte has the lower address, big-endian bit numbering would give the MSB
> the lower address, and so it would be bit 0.

On normal, modern computers, bits do not have addresses.  C (and
Java) does not require that bits be individually addressable.
Therefore, it does not really make sense to consider from a
software point of view that bits have any order other than that
imposed by their values or by the language.  The C (and Java)
`left-shift' << and `right-shift' >> operators also view bits as
being arranged left-to-right from MSB to LSB.

Why would you want to number bits any other way?

Quote:
> This is the numbering that IBM uses for their big-endian
> machines.  I believe that some other companies do, too, but I

I wouldn't know about IBM or Apple, but the mathematical
interpretation makes the most sense from an abstract or C or Java
language point of view.  (If the OP didn't want these points of
view why did he post to C and Java groups?)

--
"A lesson for us all: Even in trivia there are traps."
--Eric Sosman

Sun, 04 Apr 2004 02:45:16 GMT
machintosh bit order

Quote:

> Let's say I have a byte ( 8 bit unsigned integer )

> I ask a machintosh programmer the following question:

> What does bit position 7 represent ?

> A. Most significant bit.
> B. Least significant bit.

> What would his answer be ?

I donno, but the correct answer is the MSB.  Pretty much by definition.

--

|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL  |
|_____________________________________________|_______________________|

Opinions expressed herein are my own and may not represent those of my employer.

Sun, 04 Apr 2004 03:00:02 GMT
machintosh bit order

Quote:
> To be consistent with big-endian addressing, where the most significant
> byte has the lower address, big-endian bit numbering would give the MSB
> the lower address, and so it would be bit 0.  This is the numbering
> that IBM uses for their big-endian machines.  I believe that some other
> companies do, too, but I don't know about Apple.

AFAIK the term "big-endian" doesn't apply to bits, only to collections of
bits. The individual bits in a byte (as an example) are always ordered
higher-number, higher-significance. To change this would break the most
basic kind of code commonly used in bit manipulation. I've never seen an
exception to this rule, there might be one, but it's not likely.

--
Paul Lutus
www.arachnoid.com

Sun, 04 Apr 2004 03:08:44 GMT
machintosh bit order

Quote:

>> Let's say I have a byte ( 8 bit unsigned integer )

>> I ask a machintosh programmer the following question:

>> What does bit position 7 represent ?

>> A. Most significant bit.
>> B. Least significant bit.

>> What would his answer be ?

>I donno,

You're correct. You _don't_ know.

Quote:
> but the correct answer is the MSB.  Pretty much by definition.

No. The correct answer is whatever the answer is. It varies, platform to

IBM (for instance) says that the MSB is bit position 0, while Zilog (for
instance) says that the LSB is bit position 0.
In IBM's mainframe documentation, bit position 7 can sit at bit value 2^8, or
2^24 or 2^40, depending on the size of the memory reference.

So, the answer by definition, is that bit position 7 is where ever the macintosh
programmer says it is.

Lew Pitcher
IT Consultant, Development Services
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')

Sun, 04 Apr 2004 03:18:19 GMT
machintosh bit order

on comp.lang.c:

Quote:

>> To be consistent with big-endian addressing, where the most significant
>> byte has the lower address, big-endian bit numbering would give the MSB
>> the lower address, and so it would be bit 0.  This is the numbering
>> that IBM uses for their big-endian machines.  I believe that some other
>> companies do, too, but I don't know about Apple.
> AFAIK the term "big-endian" doesn't apply to bits, only to collections of
> bits. The individual bits in a byte (as an example) are always ordered
> higher-number, higher-significance. To change this would break the most
> basic kind of code commonly used in bit manipulation. I've never seen an
> exception to this rule, there might be one, but it's not likely.

Of course endianness ("big-endian" or "little-endian") does not apply
to bits. How do you go about changing the order of a single bit?

--

| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste       W++ B OP+                     |
\----------------------------------------- Finland rules! ------------/
"It's not survival of the fattest, it's survival of the fittest."
- Ludvig von Drake

Sun, 04 Apr 2004 03:27:35 GMT
machintosh bit order

Quote:

> on comp.lang.c:

> >> To be consistent with big-endian addressing, where the most significant
> >> byte has the lower address, big-endian bit numbering would give the MSB
> >> the lower address, and so it would be bit 0.  This is the numbering
> >> that IBM uses for their big-endian machines.  I believe that some other
> >> companies do, too, but I don't know about Apple.

> > AFAIK the term "big-endian" doesn't apply to bits, only to collections
of
> > bits. The individual bits in a byte (as an example) are always ordered
> > higher-number, higher-significance. To change this would break the most
> > basic kind of code commonly used in bit manipulation. I've never seen an
> > exception to this rule, there might be one, but it's not likely.

> Of course endianness ("big-endian" or "little-endian") does not apply
> to bits. How do you go about changing the order of a single bit?

Did you read the message to which I replied? It should be really easy,
because it is a small distance above these words. Your reply could equally
well (or poorly) apply to bytes, except it doesn't. If there were any
possibility for misinterpretation in the first line of my message, I expand
and explain in the next.

In any case, I may be wrong. The OP is saying that an IBM machine actually
has bits ordered in the opposite of the "logical" order. I find this hard to
believe, but that is an opinion, not evidence.

--
Paul Lutus
www.arachnoid.com

Sun, 04 Apr 2004 03:45:40 GMT
machintosh bit order

Quote:

> IBM (for instance) says that the MSB is bit position 0,...

Nah, IBM's wrong.  ;-)

--

|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL  |
|_____________________________________________|_______________________|

Opinions expressed herein are my own and may not represent those of my employer.

Sun, 04 Apr 2004 04:24:25 GMT
machintosh bit order

Quote:

> > Let's say I have a byte ( 8 bit unsigned integer )

> > I ask a machintosh programmer the following question:

> > What does bit position 7 represent ?

> > A. Most significant bit.
> > B. Least significant bit.

> > What would his answer be ?

> Normally `bit 7' is the bit with value 2**7 == 1<<7 == 128, which
> would be the MSB.

Not necessarily.  On big endian machines where the lowest address
is the most significant portion of multi-unit quantities, it makes
sense to have 0 the most significant bit.  Then addressing is
simply concatenating fields.

--

Available for consulting/temporary embedded and systems.