Memory
Table
Memory size prefixes:
| SI | IEC | ||||
|---|---|---|---|---|---|
| k | kilo | Ki | kibi | ||
| M | mega | Mi | mebi | ||
| G | giga | Gi | gibi | ||
| T | tera | Ti | tebi | ||
| P | peta | Pi | pebi | ||
| E | exa | Ei | exbi |
- SI: Système International
- IEC: International Electrotechnical Commission
Since we work in binary, it makes more sense to use IEC units
-
Memory sizes should be reported with IEC prefixes
- E.g
- E.g
-
Hard disk drive sizes should be reported with SI prefixes
- E.g
- E.g
-
Data sizes:
- Word size = 32 bits (default)
- Half word = 16 bits
- byte = 8 bits
- You can't operate on individual bits, smallest you can worth with is usually a byte
Multi-Byte Ordering (Endianness)
Example
x86 uses little endian, ARM is bi-endian.
Alignment
Definition
A memory access is "naturally aligned" if the address is a multiple of the data size
E.g word-size data should be stored at addresses that are multiples of 4
ARM recommends naturally aligned memory accesses