Octet (computer science)
Octet vs. Byte vs. character
Since an octet always consists of 8 bits, it can represent 2 8 = 256 different states. The term is often used synonymously with byte . The term is often used in data transmission standards ( IETF , ITU-T ).
The unit of measure derived from bit for specifying data volumes is the byte , whereby 1 byte was defined here as 8 bits. However, the more precise term octet is often used, especially in standards or in EDI (which often includes stop bits , etc.). According to the international standard IEC 60027-2, Chapter 3.8.2, a byte is an octet of bits, i.e. it contains exactly 8 bits.
The octet should not be confused with a character , since a multi-byte character can consist of several octets.
Main memory addressing
In computers, individual octets can often be addressed in the main memory , but addressing of individual bits, half octets ( nibbles ), double octets (16 bits) and larger groups is also possible. Today, 32- and 64-bit computers are common that can address 32 or 64 bits (four or eight octets) together.
The basis for today's standard, that a byte consists of eight bits, and that such a byte is the smallest unit of main memory addressing, was laid by the company IBM with the S / 360 architecture on April 7, 1964.
One octet can represent 2 8 = 256 different values that can be interpreted differently. You can z. B. save:
- an unsigned integer value in the range 0 to 255
- a signed integer value, depending on the coding of the negative numbers in the range
- from −127 to +127 or
- from −128 to +127
- one or more characters or part of a character.
All of these data types are just different interpretations of the same bit pattern. For example, an octet with the integer value 65 corresponds to the character "A" in ASCII coding. In addition to the widespread ASCII, there are also proprietary character encodings , such as EBCDIC , which is used on IBM mainframes .
Representation in different control value systems
Often the values of octets are given in hexadecimal notation, e.g. B. for the decimal value "65" as "41 16 ", "0x41", "$ 41" or "41h"; the last three spellings should indicate that it is a hexadecimal value. Two hexadecimal digits are required to fully represent an octet .
An octet can be divided into two semi-octets , quad bits or quartet of 4 bits each. In hexadecimal notation, each semi-octet corresponds to a hexadecimal place.
Sometimes the value of an octet is also given as a binary number. Example for the binary notation of the octet with the decimal value 65:
Wertigkeit 128 64 32 16 8 4 2 1 Bitnummer 7 6 5 4 3 2 1 0 Binärzahl 0 1 0 0 0 0 0 1
Calculating the decimal value:
The bit with the highest significance ( most significant bit , MSB ) is usually on the left and the bit with the lowest ( least significant bit , LSB ) is on the right. The counting of the bit positions normally starts on the right with 0, i.e. H. for example, “the third bit” is “bit 2” and is third from the right.
In some cases, a triple of 3 bits (traditionally a triad) is also called an octet, which is related to the fact that eight different values can be represented with 3 bits, i.e. one octal digit. This designation was z. As for the three permission bits (read, write, execute) in Unix -like file systems (see also chmod ). In more recent descriptions of chmod, however, the term is no longer used to avoid confusion with an 8-bit octet.
- Wilhelm G. Spruth, Paul Herrmann, Udo Kebschull (2004): Introduction to z / os and OS / 390 , p. 7
- Reinhold Paul: Guide to computer science (= electrical engineering and electronics for computer scientists - basic areas of electronics), Volume 2. BG Teubner Stuttgart / Springer, 2013, ISBN 3322966526 , ISBN 9783322966520 (accessed on August 3, 2015).
- Gert Böhme, Werner Born, B. Wagner, G. Schwarze : Jürgen Reichenbach (Ed.): Programming of process computers (= series automation technology), Volume 79. VEB Verlag Technik Berlin, reprint: Springer Verlag, July 2nd 2013, ISBN 978-3-663-00808-8 , doi : 10.1007 / 978-3-663-02721-8 , 9/3/4185.