# Why is 2^32 in a 32-bit system = 4GiB and not 4Gib?

I was watching this video 32-Bit vs 64-Bit - The Advantage and at 1:19 (timestamp) the narrator mentioned the 4GB memory allocation for the 32-bit system. I later found out it should've been 4GiB but am still confused about the bit vs byte part. After all, it's a 32-"bit" and not 32-"byte" system.

## 1 Answer

"32-bit" describes the size of many of the units of data that the processor can use. In this context, it refers to the size of memory addresses. A 32-bit address can address $$2^{32}$$ distinct objects; in a byte addressable system, that means it can address $$2^{32}$$ distinct bytes.

We don't give addresses to individual bits in memory, but rather groups of bits. In a byte addressable system those are bytes (ie, octets of 8 bits); you can also have a word-addressable system where you can only address groups of, say, 32 bits. In a system with 32-bit addresses addressing 32-bit words, you'd be able to use $$32 * 2^{32}$$ bits, or 17GB! But nowadays most consumer hardware in phones/computers are byte addressable.

Concretely, in byte-addressable memory, the first 8 bits are referred to as byte 0, the next 8 bits are referred to as byte 1, and the last 8 bits are referred to as byte 4294967295. There is no pointer to individual bit 26; you instead need to read/write the entire byte that contains it (byte with address 3 contains the 27th bit)

• Isn't 32 * 2^32 = 2^37 ~ 128GB? Also, is there 24-bit allocation in byte-addressable memory (last para)? Thanks for the answer! – Anjishnu Jun 27 '19 at 5:45
• You made the wrong assumption that a pointer addressed 1 bit. That was explained, but now you assume it addresses 32 bytes. That’s nonsense. It addresses ONE byte (on a typical modern system). – gnasher729 Jun 27 '19 at 11:53
• That was quite silly of me. But the line "In a system with 32-bit addresses addressing 32-bit words, you'd be able to use 32∗(2^32) bits, or 17GB" is yet unclear. Would appreciate any clarification. – Anjishnu Jun 27 '19 at 20:00
• @Anjishnu, what is unclear? In such a system, you can address 2^32 different words, and each word has 32 bits, for a grand total of 32*2^32 bits. – Curtis F Jun 27 '19 at 23:45