Question

Prepare a short written lecture that describes Big Endian, Little Endian and the advantages and disadvantages of each approach.

Prepare a short written lecture that describes Big Endian, Little Endian and the advantages and disadvantages of each approach.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

Little Endian and Big Endian are two ways of storing multi-byte data-types ( int, float, etc) in computers.

Big Endian:

In Big Endian, the MSB (Most Significant Byte) of the data is placed at the byte with the lowest address. The left-most byte is the MSB that carries the greatest numerical value.

Little Endian:

In Little Endian, the LSB (Least Significant Byte) of the data is placed at the byte with the lowest address. The LSB is the right-most bit in a string, it is called that because it has the least effect on the value of the binary number.

These concept can better understand with the help of following diagram:

Advantages of Big Endian:

  • Easier for (most) human to read when examining memory values. This sometimes also applies to serializing/deserializing values when communicating with networks.
  • Easier sign checking (by checking the byte at offset 0)
  • Easier comparison: useful in arbitrary-precision math, as numbers are compared from the most significant digit. But this is less important, because it’s not a common operation
  • No need for endianness conversion when sending/receiving data to/from the network. This is less useful because network adapters can already swap bytes and copy them to memory in the correct order without the help of the CPU, and most modern CPUs have the ability to swap bytes themselves.

Big-Endian disadvantages:

1) Reading a value of the wrong word size will result in an incorrect value; when done on little-endian architecture, it can sometimes yield a correct result.

2) Most big-endian architectures (non-Intel) do not allow words to be written on non-word address boundaries (odd addresses). Intel allows odd address reads and writes (they get broken into 2 separate operations) which makes it easier for programmers, but more difficult for hardware designers.

Advantages of Little Endian:

  • Easier parity checking (by checking the byte at offset 0 we can see that it’s odd or even)
  • Easier for some people to read: Arabic, Hebrew and many other languages write from right to left so they read numbers in little-endian order. Some languages also read number values in little-endian order (like 134 as 4 units, 3 tens and 1 hundred), so it’s easier to know how big the current digit is. That means the thousand separator is less useful to them, as we immediately know how big the current digit is
  • Natural in computation
    • Mathematics operations mostly work from least to most significant digit, so it's much easier to work in little-endian
    • This is extremely useful in Arbitrary-precision arithmetic (or any operations that are longer than the architecture's natural word size like doing 64-bit maths on 32-bit computers) because it would be much more painful to read the digits backwards and do operations
    • It’s also useful in situations like in case a computer with limited memory bandwidth (like some 32-bit ARM microcontrollers with 16-bit bus, or the Intel 8088 with 16-bit register but 8-bit data bus).
  • Always reads as the same value if reading in the size less than or equal to the written value.
    • For example 20 = 0x14 if writing as a 64-bit value into memory at address A will be 14 00 00 00 00 00 00 00, and will always be read as 20 regardless of using 8, 16, 32, 64-bit reads (or actually any reads with length <= 64 at the address A like 24, 48 or 40 bits). This can be extended to arbitrarily longer types.

Disadvantages of Little Endian:

Major performance disadvantage for little-endian machines since you have to keep reversing the byte order when working with large graphical elements.

Please give thumbsup, if you like it. Thanks.

Add a comment
Know the answer?
Add Answer to:
Prepare a short written lecture that describes Big Endian, Little Endian and the advantages and disadvantages of each approach.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT