Difference between revisions of "SEGGER standard for units of Memory size"

From SEGGER Wiki
Jump to: navigation, search
m
Line 1: Line 1:
In computing, the logical size of a memory is usually a power of two.
+
In computing, the size of a memory is usually a power of two.
The same is true in most Embedded Systems, which is memory sizes such as the size of Flash memory or RAM
+
The same is true in most Embedded Systems, where memory sizes such as the size of Flash memory or RAM
 
are usually given in units of 2^10 = 1024 bytes or 2^20 = 1048576 bytes.
 
are usually given in units of 2^10 = 1024 bytes or 2^20 = 1048576 bytes.
These have historically been call kB and MB.
+
These have historically been called kB and MB.
 
Unfortunately, this conflicts with the SI-System, where the k-prefix stands for 1000 (10^3) and the M-prefix represents 1000000 (10^6).
 
Unfortunately, this conflicts with the SI-System, where the k-prefix stands for 1000 (10^3) and the M-prefix represents 1000000 (10^6).
  +
In order to avoid confusion, we decided to use KB for 1024 bytes and document our conventions.
   
  +
This article describes the units used by SEGGER for memory sizes and transmission speeds,
 
  +
used in programs, manuals and on the web.
 
 
This article describes the units used by SEGGER for sizes and speeds, in manuals and on the web.
 
   
 
__TOC__
 
__TOC__

Revision as of 10:16, 5 August 2021

In computing, the size of a memory is usually a power of two. The same is true in most Embedded Systems, where memory sizes such as the size of Flash memory or RAM are usually given in units of 2^10 = 1024 bytes or 2^20 = 1048576 bytes. These have historically been called kB and MB. Unfortunately, this conflicts with the SI-System, where the k-prefix stands for 1000 (10^3) and the M-prefix represents 1000000 (10^6). In order to avoid confusion, we decided to use KB for 1024 bytes and document our conventions.

This article describes the units used by SEGGER for memory sizes and transmission speeds, used in programs, manuals and on the web.

Bytes and Bits

  • b stands for bit
  • B stands for Byte (8 bits)

Prefixes

SEGGER has adopted the following convention on prefixes:

  • k = 1000 (10^3)
  • K = 1024 (2^10)
  • M = 1000000 (10^6)
  • Mi = 1048576 (2^20)

These are being used in all SEGGER products and documents. However, this is a process that will take some time, and older programs and documents will not be updated.

Units of memory size

Typically binary: Powers of 2 Rarely metric: Powers of 10

KB

The unit KB represents 1024 bytes.

MiB

The unit MiB represents 1'048'576 bytes

kB

The unit kB represents 1000 bytes

MB

The unit MB represents 1'000'000 bytes

Units of Throughput (speed)

  • All combinations of the above can be used. Which one is used depends on the context.
  • Typically, communication speeds are typically given in metric values, such 100 Mb/s
  • Typically, memory related transfer speeds are often specified as binary-based values, such as 500 KB/s

Examples:
kB/s = 1000 bytes per second
KB/s = 1024 bytes per second
MB/s = 1'000'000 bytes per second
MiB/s = 1'048'576 bytes per second
Mb/sec = 1'000'000 bits per second