c programs

how will you find if a machine is a big endian or little endian?kindly explain about these endians?

Replies

  • Special
    Special
    Re: c programmes

    In computing, endianness is the ordering of individually addressable sub-units (words, bytes, or even bits) within a longer data word stored in external memory. The most typical cases are the ordering of bytes within a 16-, 32-, or 64-bit word, where endianness is often simply referred to as byte order.
    The usual contrast is between most versus least significant byte first, called big-endian and little-endian respectively. Mixed forms are also possible; the ordering of bytes within a 16-bit word may be different from the ordering of 16-bit words within a 32-bit word, for instance; although rare, such cases are sometimes collectively referred to as mixed-endian or middle-endian.

    Endianness may be seen as a low-level attribute of a particular representation format.
  • Morningdot Hablu
    Morningdot Hablu
    Re: c programmes

    endianness->It refers to the way no of bytes of information is stored in memory of byte addressable system.
    ....our computer architecture theory provide three way to do this.

    1>Little endian(also known as intel format): It provide a way to store bytes of information where we store least significant byte first followed by it most significant byte.
    ....like i give you an example where you have to store 19045(100101001100101) by using Little endian technique.

    01001010 01100101
    2>Big endian(also known as motorola format): It provide you a way to store bits of information where we store most significant byte first followed by it's least significant byte.
    so now write above number in little indian format.

    01100101 01001010
    But this is the binary representation of the number 19044.so you need to know the endian nature of the machine which read and wrote your data.
    If the endian nature of the machines are different then you need a software which swap your bytes of information in order to understand bytes of information in right sequence order.

    Most of our UNIX machines are big endian. Whereas most PCs are little endian machines.
    In the networking where you have to send most significant byte first uses big endian concept.....Same like when you have to call somewhere suppose India so at first you have to dial +91 then others in sequence.

    I forgot, i read somewhere in java complete reference that sockets API which defines a set of functions to convert 16- and 32-bit integers to and from network byte order.
    I will search for that if i find i will send you......why not you write a program in order to convert big endian to little endian. Just start it, it's not a vary hard work.

You are reading an archived discussion.

Related Posts

hello.i am a newbie hare.i have applied for kvpy this year.and i want urgent help in this regard in making the project.pls guide me.
Besides 'study', which is pretty much the '80' part of the '80-20 principle' as it applies to the question, what would you advise doing while in college to prepare for...
Can anyone pls explain me what is JVM(Java virtual machine)? What are JSR and their significance?
I'm sure lot of Computer Science enthusiasts and mobile application developers will find the following information useful - Four part introduction to Samsung BADA OS - Part 1: https://media.wiley.com/assets/2249/08/introduction_to_bada_part_1.pdf Part...
hello friends.. i m i last year.. i need some latest seminar topics in instrumentation engineering.. can u plzzz suggest any topic....