The basic number value stored in computer’s memory has 8 bit – 1 byte. This allows us to store number from 0 to 255 (00000000 – 11111111) because there are no combinations of 1 and 0 left in those 8 bits. But all systems works with largers numbers with different size. 1 byte, 2 byte, 4 byte or even 8 byte numbers. This get us an opportunity to use larger or smaller variabels due to what they will be used.
|1||0 – 255||Store states 0 or 1|
|2||0 – 65535||Simple stopwatch|
|4||0 – 4294967295||Youtube views count|
|8||0 – 18446744073709551615||Something big|
The reason why we cannot use the largest variables all the time is that we don’t have memory with infinity size. For example PC or smartphone has 4GB or RAM memory but small microcontroller chip can only have 1kB what is 4 milion times smaller! Programming these devices with small RAM needs to think about size of data we want to store and then use appropriate variable size.