6. Assignment 3
WAP to convert Little Endian data to Big Endian.
Input: Read size ‘S’ (in bytes 2 or 4) and read ‘num’ as hexa
(based on ‘S’)
7. Assignment 3
WAP to convert Little Endian data to Big Endian.
Input: Read size ‘S’ (in bytes 2 or 4) and read ‘num’ as hexa
(based on ‘S’)
Output:
8. Assignment 3
WAP to convert Little Endian data to Big Endian.
Input: Read size ‘S’ (in bytes 2 or 4) and read ‘num’ as hexa
(based on ‘S’)
Output: Print ‘num’ in Big endian format.
10. Assignment 3
What is Endianness?
The order or sequence of bytes of a work of digital data in
computer memory.
11. Assignment 3
What is Endianness?
The order or sequence of bytes of a work of digital data in
computer memory.
There are two types:
12. Assignment 3
What is Endianness?
The order or sequence of bytes of a work of digital data in
computer memory.
There are two types:
1. Little endian
13. Assignment 3
What is Endianness?
The order or sequence of bytes of a work of digital data in
computer memory.
There are two types:
1. Little endian
2. Big endian
15. Assignment 3
What is Little Endian?
The most significant byte stored at the highest address.
16. Assignment 3
What is Little Endian?
The most significant byte stored at the highest address.
Example:
17. Assignment 3
What is Little Endian?
The most significant byte stored at the highest address.
Example:
num = 0x12345678;
18. Assignment 3
What is Little Endian?
The most significant byte stored at the highest address.
Example:
num = 0x12345678; 78 56 34 12
100 101 102 103
20. Assignment 3
What is Big Endian?
The most significant byte stored at the lowest address.
21. Assignment 3
What is Big Endian?
The most significant byte stored at the lowest address.
Example:
22. Assignment 3
What is Big Endian?
The most significant byte stored at the lowest address.
Example:
num = 0x12345678;
23. Assignment 3
What is Big Endian?
The most significant byte stored at the lowest address.
Example:
num = 0x12345678; 12 34 56 78
100 101 102 103