runcode
runcode

Reputation: 3643

Why are 32 bits equal to 4 gigabytes but not 4 gigabits?

Let’s say we have a 32-bit address, so each bit can be either 1 or 0.

So the total number of combinations is equal to 232.

So we can represent 232 addresses (without unit).

But why do people say a 32-bit address can represent 232 byte addresses (why “byte” addresses)?

I already read Why does a 32-bit OS support 4 GB of RAM?

Won’t it become 232 * 8 bits addresses? Why can people simply add “byte” at the end?

Upvotes: 2

Views: 1037

Answers (2)

DanC
DanC

Reputation: 8805

Each address points to a byte. In memory, it is not the single bits that are addressed but instead bytes.

So, 32bits will give you an addressable space of 2^32 items, each item being a full byte. Yes, it could have been made so that each address points to a specific bit, but no, they made each address point to a byte.

Upvotes: 0

Kyle Lutz
Kyle Lutz

Reputation: 8036

Because memory is byte-addressable rather than bit-addressable.

The address 0x100 refers to a single byte and the address 0x101 refers the following byte.

Upvotes: 7

Related Questions