Here's a little treat for paying attention to this thread.
Memorize this chart...

        1       8
        2       4
        3       C
        4       2
        5       A
        6       6
        7       E
        8       1
        9       9
        A       5
        B       D
        C       3
        D       B
        E       7
        F       F

And here's why...

        Let's take 2 for example. In binary, it is written B'0010'. On
systems that reverse the order of the bits (for reasons that will be
explained later), it is written B'0100', which could be read as 4 in
decimal, depending on how you read it.

        The problem with this is that we would still need a point of
reference for how to read the binary digits so that we can compute their
hexadecimal equivalents.  Can you think of any other areas in life where
this could also be a problem?  How about written language?  In some parts of
the world, people read right to left instead of left to right, like how you
are reading this now.  This ambiguity wasn't saved, unfortunately, from
computers.  The single most important thing to understand a computer
protocol is first knowing its bit-wise orientation.  The second most
important thing to understand a protocol is knowing its byte-wise
orientation.

        If you haven't guessed already, there are systems that not only
reverse the order of bits, but reverse the order of the bytes as well.  This
is why 4 and 2 are palindromatic.  If I align 4 and 2 as we as English
readers would align them, they would simply be x'42' (in binary this would
be B'0100 0010').  But there are computer systems that align these digits in
reverse, placing the highest order (most significant), that is to say, the
digit that represents the greatest change in value, last.  They come up with
x'24' as the same representation of binary digits.  They believe, what is
written last, is in fact what we would call the 10s column in decimal.  It
would be like writing 17 (seventeen) and having someone else read 71
(seventy-one).  However, those same systems that reverse the order of the
bytes reverse the order of the bits as well.  If I would reverse the order
of the bits in x'2' (in binary, B'0010') it would be read as x'4' (in
binary, B'0100').  So, If we read them in on a computer that reverses the
order of the digits _and_ reverses the order of the bytes, we would read
them in as x'42', exactly how we read them on a system that doesn't, hence,
a palindrome.  If I would write a low level device driver that reads in SAPs
and dishes them out to the corresponding protocol stack, I wouldn't need to
know what the value of a particular SAP would be on a system that reverses
the order of bits and bytes if I pick 2 values that are always going to be
read the same.  There are other palindromatic sequences that can be found in
the chart above.  There are even single digit palindromes.  Exercise 1: What
are they, and how many are there in total?

        The chart above helps you to immediately know how a digit would be
computed in hexadecimal if read on a computer that reverses bits and bytes.

This would be useful for computing how a Ethernet multicast address differs
from a token ring multicast address.  Exercise 2: how is an Ethernet address
of 0100.5E00.0001 (IP 224.0.0.1) read in on a token ring machine?  Is the IP
address still read the same?

WAYNE BAETY, MCSE, A1C, USAF
Network Systems Trainer


-----Original Message-----
From: Carroll Kong [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, November 20, 2001 8:52 AM
To: [EMAIL PROTECTED]
Subject: RE: Spanning Tree Protocol [7:26538]

This is a computer architecture topic and it has been a while for 
me, so please feel free to correct me.  Basically, it is how multibyte 
values are stored in a particular computer architecture.  For instance, in 
big endian, the "last byte, has the most significant byte", and in little 
endian the "last byte, has the least significant byte".

         Given that a byte is 8 bits.
         Given an integer 64932  (2 bytes)
         This converts to

1111 1101   1010 0100
in binary.

In a little endian architecture, the data would be stored like
1111 1101   1010 0100

         One machine would store this value from "left to right" and the 
other would store it from "right to left".  In a big endian architecture, 
the data would be stored like

1010 0100   1111 1101

         Needless to say, this has caused much pain in the world.  It is 
purely a big religious war as to "which is better".  Also, one might 
quickly add "well if this is true, wouldn't all socket programming be 
borked?!?"  No.  They force you to convert back to "network form" vs "host 
form".  I believe network form is big endian, but not that it 
matters.  Everyone converts it to this form in C (or any other language) 
before it hits the network, so there is still cross OS
compatibility.

Now, looking at 42, it seems to be this in binary....

alone it is 101010, but in a byte, it would look liks

0010 1010

Maybe I got something mixed up?  Maybe with a 7 bit byte then it is
010 1010

At 10:05 AM 11/19/01 -0500, Matthew Tayler wrote:
>Ok dumb question of the day, what do you mean by Big Endian & Little Endian
>please ?
>
>Priscilla Oppenheimer wrote:
> >
> > At 10:12 PM 11/16/01, Kane, Christopher A. wrote:
> > >Someone was a Douglas Adams fan?
> >
> > Of course! Also another cool thing about 42 is that it's a
> > palindrome (the
> > same backwards and forwards in binary) and avoided the Little
> > Endian/ Big
> > Endian wars!
> >
> > Priscilla
> >


-Carroll Kong




Message Posted at:
http://www.groupstudy.com/form/read.php?f=7&i=29000&t=26538
--------------------------------------------------
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html
Report misconduct and Nondisclosure violations to [EMAIL PROTECTED]

Reply via email to