0
\$\begingroup\$

TM4C123 has 256 kiBytes of flash ROM as shown in the memory map. The range of memory addresses for the ROM is 0x0000.0000 to 0x0003.FFFF (a 32bit address), totaled to 3x16x16x16x16 = 196,608 number of addresses. The memory is byte addressable so that block of memory addresses adds up to 196,608 bytes instead. Why does the manufacturer claim it has 256 kiB and not 196kB ROM memory size?

Even if the range of addresses can't sum up to an exact 256k, wouldn't 0x0000.0000 - 0.0004.FFFF (4x16x16x16x16 = 262k) give a size closer to 256k than 0x0003.FFFF's 196k?

memory map

\$\endgroup\$
2
  • 3
    \$\begingroup\$ It starts at 0, so 4 X 16 x ... not 3 x. See also "fencepost error" \$\endgroup\$
    – user16324
    Commented Jul 24, 2020 at 10:04
  • 1
    \$\begingroup\$ It has 00000000 up to 0000FFFF, then it has 00010000 up to 0001FFFF, then it has 00020000 up to 0002FFFF, then it has 00030000 up to 0003FFFF. 4 lots of 0000 up to FFFF. \$\endgroup\$ Commented Jul 24, 2020 at 10:56

1 Answer 1

3
\$\begingroup\$

You have an off by one error in your calculations and also kilobyte is not 1000 bytes but 1024. The device really has 256 kilobytes of memory. 2^18 is 262144 bytes and 262144 / 1024 is exactly 256 kilobytes. A kilobyte is 2^10 = 1024 bytes.

\$\endgroup\$
1
  • \$\begingroup\$ Well, according to international engineering standards, 2^10 bytes is a kibibyte and not a kilobyte. You can say I'm being pedantic, but flash drive manufacturers lost a lot of money in lawsuits over the matter. \$\endgroup\$ Commented Jul 24, 2020 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.