What is the difference between little endian and big endian format? These two formatting styles are used for storing instructions in computer systems (embedded systems). Instructions in computer systems are stored in the form of their opcodes.
Little endian Format
In little endian format, low byte is stored at the lowest address of memory location and high byte is stored at high address of memory location.
Big endian Format
In contrast to the little endian format, here low byte is stored at high address of memory location and high byte is stored at low address of memory location.
What is the difference between RAM and ROM?
Both are the memories for storing the data or program in computer systems. Whenever you write a code that instructions go to the ROM while the variables that you use in your program go to the RAM locations. RAM is also known as program data memory in terms of embedded systems. Usually RAM is composed of registers which are of two types: General Purpose Registers (GPRs) and Special Function Registers (SFRs).
SFRs are fixed in almost all families of PIC microcontrollers and their size is of 128 bytes. In PIC18 series, the maximum RAM size is 4k. So rest of the memory is dedicated for scratchpads and data storage. The program data memory is divided into banks and each bank is of 256 bytes. That’s why there are total 16 (4096/256=16) banks available.
One bank is always present in all families of PIC18 and that is called the Access Bank. It is also the Bank0 in which 128 bytes are for SFRs and 128 bytes are for GPRs.
Example of little endian and big endian
Here I am giving an example of PIC microcontroller where the memory is byte addressable and each instruction code consists of opcode and its operand as shown below
For the above example code, the instructions are stored according to little endian format as follows:
Majority of the computer systems follow the little endian format but there are some other families like freescale (Motorola) follows the big endian format.
Also read here