Skip to main content
JDirk.1
Associate III
January 9, 2021
Solved

Memory map 4GB or 4.096GB?

  • January 9, 2021
  • 6 replies
  • 4673 views

Hi all,

1)

in STM32F446xC/E it is written that the memory consists out of 8 Blocks each 512-Mbytes. This leads to 4.096-GB. In PM0214 its written: The processor has a fixed memory map that provides up to 4 GB of addressable memory. Now my question: How much does it have in total, 4.096GB or 4.000GB? Or does it mean 0.096GB are not addressable?

2)

Is it correct, that some Addresses only refer to 4 Bit areas? Otherwise I cant explain the 4.096GB knowing that the last Address is 0xFFFFFFFF. In the beginning i thought it might be 8 bits per address but that would result into 4,29....GB.

Or is there something i got completly wrong?

This topic has been closed for replies.
Best answer by Piranha

https://en.wikipedia.org/wiki/Binary_prefix

In real life the numbering base depends on the context where it's used. For network speeds typically base 10 is used. For storage and addressing typically base 2 is used. And historically even when base 2 is used with IEC (capital) prefix, rarely anyone uses the "i" letter.

P.S. HDD manufacturers like to "cheat" and use base 10 also for storage capacity.

6 replies

TDK
Super User
January 9, 2021

The 32-bit addressable space is 2^32 bytes, or 4.294967296 GB, using the most commonly used definition of GB of 1000000000 bytes. That's just the number of unique values for a uint32_t.

The chip doesn't have anywhere near this amount of memory onboard. Only some portions of that memory space are mapped to peripherals, memories, and other stuff.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JDirk.1
JDirk.1Author
Associate III
January 9, 2021

Thanks. Your explanation for 4.29... is clear to me, its understandable.

But how can a address range from 0x0000 0000 to 0xFFFF FFFF (4294967296 different addresses) lead to 8 x 512-Mbytes (4.096-GB)? Thats fully confusing. 4294967296 x 8 Bit = 4.29... Giga-Byte. So the screenshot attached saying each block is 512-Mbytes with the mentioned 0xFFFF FFFF, something is wrong on how i read and calculate ...

Piranha
PiranhaBest answer
Principal III
January 9, 2021

https://en.wikipedia.org/wiki/Binary_prefix

In real life the numbering base depends on the context where it's used. For network speeds typically base 10 is used. For storage and addressing typically base 2 is used. And historically even when base 2 is used with IEC (capital) prefix, rarely anyone uses the "i" letter.

P.S. HDD manufacturers like to "cheat" and use base 10 also for storage capacity.

JDirk.1
JDirk.1Author
Associate III
January 9, 2021

thanks!

TDK
Super User
January 9, 2021

> But how can a address range from 0x0000 0000 to 0xFFFF FFFF (4294967296 different addresses) lead to 8 x 512-Mbytes (4.096-GB)? 

You seem to be okay with calling 1 MB = 1024^2 bytes, so why do you object to calling 1 GB = 1024^3 bytes.

As @Piranha mentions, the context for these numbers is important.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JDirk.1
JDirk.1Author
Associate III
January 9, 2021

many thanks to both of you! The binary prefix issue can be really confusing, its the first time i heard about ...

let me summarize:

The "512-Mbyte" given in the datasheet are equal to 536,871-Mega bytes assuming 8 Bits are one byte and Mega stands for 10^6 according to my calculation. Each Address refers to a 8-Bit register. 2^32 = 4294967296 possible addresses multiplied with 8 Bit result into 4,29GB memory (or expressed as 4GB if i use this binary prefix method).

is that correct?

for me 8 Bits are ony byte

1kilobyte are 1.000bytes

1 megabyte are 1.000.000bytes

in the PDF 1 MB is 1048576bytes

JDirk.1
JDirk.1Author
Associate III
January 9, 2021

i think i got it ...