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 |
char *p="name"; printf(p);
Who is the main contributor in designing the c language after dennis ritchie?
array contains zeros and ones as elements.we need to bring zeros one side and one other side in single parse. ex:a[]={0,0,1,0,1,1,0,0} o/p={0,0,0,0,0,1,1,1}
implement NAND gate logic in C code without using any bitwise operatior.
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
write c program without semicolon
11 Answers MindTech, TCS, Wipro,
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a<b,printb.find the sum digits of that number & then print.if a==b multiply 10 with a & add 20 with b store in c and then print
Write a program to reverse a linked list in c.
int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15
What is bin sh c?
What is a global variable in c?
Explain how do you use a pointer to a function?