What is the difference between big endian form and little
endian form? write a code to convert big endian form to
little endian and vice versa..
Answers were Sorted based on User's Feedback
Answer / peter
Little endian has least significant digit at far left.
Big endian has most significant digit at far left.
Is This Answer Correct ? | 28 Yes | 8 No |
Answer / raj
Little Endian ->LSB at lower address
Big Endian -> MSB at lower address
e.g:
if the value is 0x0A0B0C0D then
in case of LE storage will be
Address 1000 0D
Address 1001 0C
Address 1002 0B
Address 1003 0A
in case of BE storage will be
Address 1000 0A
Address 1001 0B
Address 1002 0C
Address 1003 0D
Marco to convert(this will convert from LE to BE or BE to
LE--> one for all :) )
#define CON(NUM) (NUM&0x000000FF)<<24|(NUM&0x0000FF00)<<8
|NUM&0x00FF0000)>>8 |(NUM&0xFF000000)>>24
Is This Answer Correct ? | 17 Yes | 3 No |
Answer / amit
the endianness of a bus determines whether the MSB is put
into the lowest address
(big-endian) or in the highest address (little-endian).
Is This Answer Correct ? | 13 Yes | 5 No |
Answer / vivek
in little endien lsb is at lower addess and in big endien
msb at lower address
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vish
Small correction in above macro.
'(' was missing in second line.
#define CON(NUM) (NUM&0x000000FF)<<24|(NUM&0x0000FF00)<<8
|(NUM&0x00FF0000)>>8 |(NUM&0xFF000000)>>24
Is This Answer Correct ? | 2 Yes | 3 No |
main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail
What is difference between array and structure in c?
What is FIFO?
x=2,y=6,z=6 x=y==z; printf(%d",x)
13 Answers Bharat, Cisco, HCL, TCS,
What is 'bus error'?
What are bit fields? What is their use?
What are the string functions? List some string functions available in c.
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
What is the purpose of the statement: strcat (S2, S1)?
What is the use of pointers in C?
0 Answers Impetus, Motorola, Tavant Technologies, Virtusa,
WAP to accept rollno,course name & marks of a student & display grade if total marks is above 200?
WHAT IS INT?