English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Suppose if a bit sequence is given in binary format. I need to represent it in Little-Endian format. How could I do this?
plz, mention some simple examples (if possible).
if a bit seq. is: 1011 0110 0011 1010.
how would be its Little-Endian representation??

2007-02-04 06:37:38 · 1 answers · asked by Ishtiaque A 1 in Computers & Internet Programming & Design

1 answers

a bit is just 1 or 0 in Little_Endian and Big_Endian

Endian is a difference in byte order.

To convert your example it would be (assuming it was originally big-endian):

0011 1010 1011 0110.

A byte is 8 bits, so just group the bitstream into groups of 8 and then reverse the order of the groups.


Example 1:
a Nibble: 0101 same in little and Big Endian

Example 2:
a byte: 0101 1111 same in little and big Endian

Example 3:
a 2 byte integer (the number 1):
Big Endian - 0000 0000 0000 0001
Little endian- 0000 0001 0000 0000

2007-02-04 07:05:40 · answer #1 · answered by Vegan 7 · 0 0

fedest.com, questions and answers