1

I have an application which measures TX/RX rates of a device in bits-per-seconds. I want to display the rates in Kilo-bits-per-second. What is the correct formula?

  1. rx_in_k = rx / 1000
  2. rx_in_k = rx / 1024

Thanks,

Elad Weiss
  • 3,662
  • 3
  • 22
  • 50

2 Answers2

5

If you really care to distinguish between powers of two and powers of ten, you should read this: https://en.wikipedia.org/wiki/Binary_prefix. Using powers of two interchangeably with metric powers of ten was a given in the early days of computers (and is still used by many systems), but as time goes on and we begin to use larger and larger units, the error between the two continues to grow. You should be using kilo, mega, giga, etc. for powers of ten, and kibi, mebi, gibi, etc. for powers of two in order to be unambiguous. For example:

|------------|-----------|------------|
|    Bytes   | SI Units  |  IEC Units |
|------------|-----------|------------|
|      1000  | 1.0    KB | 0.976  KiB |
|      1024  | 1.024  KB | 1.0    KiB |
|    1000000 | 1.0    MB | 0.9537 MiB |
|    1048576 | 1.0486 MB | 1.0    MiB |
| 1000000000 | 1.0    GB | 0.9313 GiB |
| 1073741824 | 1.0737 GB | 1.0    GiB |
|------------|-----------|------------|

See also: Converting bytes to megabytes.

James
  • 3,551
  • 1
  • 28
  • 38
1

I think this is what you'r looking for

The kilobit is a multiple of the unit bit for digital information or computer storage.

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

The kibibit is a multiple of the bit, a unit of digital information storage, using the standard binary prefix kibi, which has the symbol Ki, meaning 2^10

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

ponury-kostek
  • 7,824
  • 4
  • 23
  • 31