Difference between revisions of "byte"

From SEGGER Wiki
Jump to: navigation, search
m
m
 
Line 1: Line 1:
 
[[Category:Knowledge Base]]
 
[[Category:Knowledge Base]]
A byte consists of 8-bits. A byte is in many systems the basic unit of data that can be accessed or transferred.
+
A byte consists of 8-[[bit]]s. A byte in most systems is the basic unit of data that can be accessed or transferred
  +
to memory.
In some literature a byte is called Octet.
 
  +
In some literature, such as most [[RFC]]s, a byte is called ''octet''.
Consisting of 8 bits, a byte can represent 2⁸ = 256 different values, ranging from 0 ... 255.
 
  +
With 8 bits, a byte can represent 2⁸ = 256 different values, ranging from 0 ... 255.
 
The value of a byte can be conveniently shown in hex, with values ranging from 0 ... FF.
 
The value of a byte can be conveniently shown in hex, with values ranging from 0 ... FF.
  +
== History ==
  +
The term byte was used very early in computing, starting probably in the early sixties.
  +
At the time, a byte was not necessarily 8 bits. Systems with 6 or 9-bit "bytes" where not uncommon.
  +
However, since the 1970s, the term byte is used to denote 8-bits and is used for CPUs, peripheral units,
  +
communication.
 
== Unit symbol ==
 
== Unit symbol ==
 
The unit symbol for byte is uppercase letter B, in contrast to the unit symbol for bit, which is lowercase b.
 
The unit symbol for byte is uppercase letter B, in contrast to the unit symbol for bit, which is lowercase b.

Latest revision as of 02:45, 8 July 2019

A byte consists of 8-bits. A byte in most systems is the basic unit of data that can be accessed or transferred to memory. In some literature, such as most RFCs, a byte is called octet. With 8 bits, a byte can represent 2⁸ = 256 different values, ranging from 0 ... 255. The value of a byte can be conveniently shown in hex, with values ranging from 0 ... FF.

History

The term byte was used very early in computing, starting probably in the early sixties. At the time, a byte was not necessarily 8 bits. Systems with 6 or 9-bit "bytes" where not uncommon. However, since the 1970s, the term byte is used to denote 8-bits and is used for CPUs, peripheral units, communication.

Unit symbol

The unit symbol for byte is uppercase letter B, in contrast to the unit symbol for bit, which is lowercase b.

Unit multiples

2^10 = 1024 is very close to 1000. In computers, multiples of powers of 2 are "natural" values, so used a lot.

Decimal multiples

As in physics, the standard SI (or metric) prefixes k, M, G are used to indicate 10^3, 10^6 and 10^9, so

1kB = 1000 Bytes
1MB = 1000'000 Bytes
1GB = 1000'000'000 Bytes
1TB = 1000'000'000 Bytes

Disk manufacturers tend to use the decimal multiples, which yield slightly bigger numbers than the binary multiples.

Binary multiples

The difference between the binary multiples and the decimal equivalents is not very big (2.4%) for k, but it goes up for the larger ones. Unfortunately, despite standardization efforts there is no clear standard for the binary prefixes. The following are used most commonly, leaving room for interpretation for M and G:

1KB = 1024 Bytes
1MB = 1024^2 = 1'048'576 Bytes
1GB = 1024^3 = 1'073'741'824 Bytes

A way to eliminate all confusion (that stems from the ambiguous M and G) is to use the dedicated binary prefixes:

1KiB = 1024 Bytes
1MiB = 1024^2 = 1'048'576 Bytes
1GiB = 1024^3 = 1'073'741'824 Bytes

More information

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