cmemorycapacity

Why 2 raised to 32 power results in a number in bytes instead of bits?


I just restart the C programming study. Now, I'm studying the memory storage capacity and the difference between bit and byte. I came across to this definition. There is a calculation to a 32 bits system. I'm very confused, because in this calculation 2^32 = 4294967296 bytes and it means about 4 Gigabyte. My question is: Why 2 raised to 32 power results in a number in bytes instead of bits ?

Thanks for helping me.


Solution

  • We say that memory is byte-addressable, you can think like byte is the smallest unit of memory so you are not reading by bits but bytes. The reason might be that the smallest data type is 1 byte, even boolean type in c/c++ is 1 byte.