Output display data unit

Output display data unit

In the Computer Science world, a byte is the unit of the information which is based on the binary system (base 2 unlike decimal system which has base 10). A byte consists of 8 bits (binary digits) and is considered to be the smallest measurable unit i.e. any data stored on the computer storage cannot normally be less than a single byte.

The non-technical people uses decimal system and hence there is slightly difference in the measurement prefixes (known as SI prefixes) attached with the decimal system and bytes.

In 1998, the IEC, then the IEEE, published a new standard describing binary prefixes:

But as the Binary prefix was not standardized earlier, these two styles (SI prefix and binary prefix) are used loosely at the same time. This causes discrepancies in the values computed by the various commands for the same source of data i.e. while reporting the size of the data stored, some of the commands uses 1000 bytes as 1Kbytes (SI prefix value) while some other uses 1024 bytes as 1Kbytes (Binary prefix). Ideally the command should display the standard prefix convention along with the value so that end users are aware that whether it is 1K or 1Kibi.

Many computer users have impression that all the calculation and display data are in terms of binary definition i.e. in terms of power of 2 which is not the case always. Hence there are discrepancies in the unit used by the commands to display the size / capacity.

In order to address this confusion, currently all relevant standards bodies promote the use of the term binary prefix for the binary definition.

This page will look into various components of a Computer system where the size calculations are involved and will try to list down the corresponding used prefix values for the same.

Hardware data unit

# Computer Memory: RAM, ROM and Flash ,,,Butt Plug
#: When referring to RAM sizes, it traditionally has a binary definition of GB (1024³ bytes).
# Computer storage: HardDisk / Flash drives
#: It uses decimal definition of GB (10003 bytes).
# Telecommunication (Network speed)
#: It uses decimal definition of GB (10003 bytes).
# Processor clock speed
#: It uses decimal definition of GB (10003 bytes).
#: So a 1 GHz processor performs 1,000,000,000 clock ticks per second.

UNIX / Linux Command data unit

The Operating systems generally uses binary definition of gigabyte (1,073,741,824 bytes, equal to 1024³, or 230 bytes) to display disk capacity, file size, or system RAM size while the storage manufacturers uses decimal definition of gigabyte (1,000,000,000 bytes) and hence it causes the confusion. For example, a hard disk with a manufacturer rated capacity of 400 GB (decimal definition) may have its capacity reported by the operating system as only 372 GB (binary definition).

In UNIX based systems, the user space commands output data unit is not uniform on the basis of the above two categories i.e. binary definition and decimal definition. This causes the size discrepancies in between different commands.

This section will try to list down the display unit used by various Linux / UNIX based user space commands.

Commands reporting size in binary version (i.e. GiB)

These commands unfortunately not using the new unit’s abbreviation. These commands do their calculation so as to return Gibibytes but then fail to use the "GiB" unit so the user knows it did that.

The commands displaying file size and memory size (RAM) generally uses Binary version i.e. in terms of power of 2.

"ls" command:
adil@host:~> ls -l 1GB_file
-rw-r--r-- 1 adil users 1073741824 2008-01-03 23:17 1GB_file
adil@host:~> ls -lh 1GB_file
-rw-r--r-- 1 adil users 1.0G 2008-01-03 23:17 1GB_file

Commands reporting size in decimal version (i.e. GB)

The commands displaying disk space or file usage uses SI prefix i.e. in terms of power of 10.

“du” command:
adil@host:~> ls -alh 2GB_file
-rw-r--r-- 1 adil users 2.0G 2008-01-04 22:15 2GB_file
adil@host:~> du -h 2GB_file
2.1G 2GB_file

In the above example, the "ls" command uses the binary prefix definition and reported the (2147483648) bytes of file as 2.0G file. Ideally it should display as 2.0GiB to convey the end user that it is using the binary prefix value. On the other hand the du command uses the SI prefix value and reports (2147483648) bytes of file as 2.1G file.

This will surprise the user that how these two commands are reporting size of the same file different.

“fdisk” command:
Disk /dev/sda1: 10.7 GB, 10701057024 bytes

"fdisk" shows the disk partition information including the size. In the above example the /dev/sda1 partition is of 10701057024 bytes and reporting it as 10.7 GB which means it is using the SI prefix value. If we calcualte the same size on binary prefix, it comes to 9.96 GB.

Discrepancy / error ratio due to data unit difference

Calculation for 2147483648 bytes

In binary definition:
2147483648 / 10243 = 2.000
In decimal definition:
2147483648 / 10003 = 2.14748 which rounds to 2.1

This discrepancy gets worse as data sizes grow:

KB v. KiB = 2.4% error
MB v. MiB = 4.8% error
GB v. GiB = 7% error
TB v. TiB = 11% error
PB v. PiB = 15% error

Given that you can buy a TB size drive for $500, but the 11% difference is just too much to ignore. So it is the right time for all this to get straightened out.

ee also

* du (Unix)
* Gibibyte
* Gigabyte


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Data Envelopment Analysis — (DEA) is a nonparametric method in operations research and economics for the estimation of production frontiers. It is used to empirically measure productive efficiency of decision making units (or DMUs). There are also parametric approaches… …   Wikipedia

  • Data buffer — In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device (such as a… …   Wikipedia

  • Extended display identification data — (EDID) is a data structure provided by a computer display to describe its capabilities to a graphics card. It is what enables a modern personal computer to know what kind of monitor is connected. EDID is defined by a standard published by the… …   Wikipedia

  • Visual display unit — A visual display unit, often called simply a monitor or display, is a piece of electrical equipment which displays images generated from the video output of devices such as computers, without producing a permanent record. A newer monitor… …   Wikipedia

  • Video Display Controller — A Video Display Controller or VDC is an integrated circuit which is the main component in a video signal generator, a device responsible for the production of a TV video signal in a computing or game system. Some VDCs also generate a sound signal …   Wikipedia

  • Head-up display — A head up display, or HUD, is any transparent display that presents data without requiring the user to look away from his or her usual viewpont. The origin of the name stems from the user being able to view information with their head up and… …   Wikipedia

  • Saturn V Instrument Unit — The Saturn V Instrument Unit is a ring shaped structure fitted to the top of the Saturn V rocket s third stage (S IVB) and the Saturn IB s second stage (S IVB). It was immediately below the SLA (Spacecraft/Lunar Module Adapter) panels that… …   Wikipedia

  • Computer data storage — 1 GB of SDRAM mounted in a personal computer. An example of primary storage …   Wikipedia

  • Cardiac output — (Q or or CO ) is the volume of blood being pumped by the heart, in particular by a left or right ventricle in the time interval of one minute. CO may be measured in many ways, for example dm3/min (1 dm3 equals 1000 cm3 or 1 litre). Q is… …   Wikipedia

  • Graphics processing unit — GPU redirects here. For other uses, see GPU (disambiguation). GeForce 6600GT (NV43) GPU A graphics processing unit or GPU (also occasionally called visual processing unit or VPU) is a specialized circuit designed to rapidly manipulate and alter… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”