TORIma Academy Logo TORIma Academy
Binary number
Technology

Binary number

TORIma Academy — Number Theory

Binary number

Binary number

A binary number is a number expressed in the base-2 numeral system or binary numeral system , a method for representing numbers that uses only two symbols for…

A binary number is defined as a numerical value represented within the base-2 numeral system, also known as the binary numeral system. This system employs only two distinct symbols, typically 0 (zero) and 1 (one), to denote natural numbers. Furthermore, the term binary number can also describe a rational number possessing a finite representation in the binary numeral system, specifically, an integer divided by a power of two.

A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically §67§ (zero) and §89§ (one). A binary number may also refer to a rational number that has a finite representation in the binary numeral system, that is, the quotient of an integer by a power of two.

The base-2 numeral system functions as a positional notation characterized by a radix of 2. Each individual digit within this system is termed a 'bit' or 'binary digit'. Its widespread adoption across nearly all contemporary computers and computer-based devices stems from its direct and efficient implementation in digital electronic circuitry via logic gates. This preference over alternative human communication techniques is attributed to the inherent simplicity of its language and its robust noise immunity during physical implementation.

History

While the modern binary number system underwent significant study in Europe during the 16th and 17th centuries by scholars such as Thomas Harriot and Gottfried Leibniz, analogous systems predating this period have been identified across various ancient cultures, including those of Egypt, China, Europe, and India.

Egypt

Ancient Egyptian scribes employed two distinct fractional systems: Egyptian fractions, which bear no relation to the binary system, and Horus-Eye fractions. The latter system, named for the disputed belief among some mathematics historians that its symbols could be arranged to depict the Eye of Horus, constitutes a binary numbering system specifically for fractional measurements of commodities like grain or liquids. Within this system, a fraction of a hekat was represented as a sum of binary fractions, specifically 1/2, 1/4, 1/8, 1/16, 1/32, and 1/64. Evidence of early forms of this system appears in Fifth Dynasty Egyptian documents, dating to approximately 2400 BC, with its fully developed hieroglyphic form emerging around 1200 BC during the Nineteenth Dynasty.

Furthermore, the ancient Egyptian method of multiplication exhibits a close relationship with binary numbers. This technique involves multiplying a number by a second through a series of operations where an initial value (the first number) is either doubled or has the first number added to it. The specific sequence of these operations is dictated by the binary representation of the second number. This method is exemplified in historical texts such as the Rhind Mathematical Papyrus, which is dated to approximately 1650 BC.

China

Originating in China, the I Ching dates back to the 9th century BC. Its binary notation serves as a framework for interpreting its quaternary divination methodology.

This system is founded upon the Taoist principle of yin and yang duality. Eight trigrams (Bagua) and a collection of 64 hexagrams ('sixty-four' gua), which are analogous to three-bit and six-bit binary numerals respectively, were employed in ancient China from at least the Zhou dynasty period.

Shao Yong (1011–1077), a scholar during the Song dynasty, reordered the hexagrams into a configuration that bears a resemblance to modern binary numbers, despite his arrangement not being intended for mathematical application. When examining Shao Yong's square, if the least significant bit is positioned at the top of individual hexagrams, and rows are read either from bottom right to top left (with solid lines representing 0 and broken lines representing 1) or from top left to bottom right (with solid lines representing 1 and broken lines representing 0), the hexagrams can be interpreted as a sequential progression from 0 to 63.

Classical antiquity

The Etruscans practiced divination by segmenting the outer edge of sacrificial livers into sixteen distinct parts. Each segment was inscribed with the name of a deity and its corresponding celestial region. Subsequently, each liver region yielded a binary reading, which was then synthesized to form a conclusive binary interpretation for divinatory purposes.

At the ancient Greek oracle of Dodona, divination involved drawing question tablets and 'yes' or 'no' pellets from separate jars. The outcomes were then combined to formulate a final prophecy.

India

The Indian scholar Pingala (circa 2nd century BC) devised a binary system specifically for the description of prosody. He characterized metrical patterns using short and long syllables, with the latter being equivalent in duration to two short syllables. These were designated as laghu (light) and guru (heavy) syllables, respectively.

Pingala's Hindu classic, titled Chandaḥśāstra (8.23), details a matrix construction method for assigning a unique value to each metrical pattern. "Chandaḥśāstra" translates literally as science of meters in Sanskrit. The binary representations within Pingala's system advance rightward, contrasting with the leftward progression of modern positional binary notation. In Pingala's system, numeration commences with one, rather than zero. Four short syllables, "0000," constitute the initial pattern, corresponding to the value of one. Numerical values are derived by incrementing the sum of place values by one.

West Africa

Ifá, a West African divination system, gained prominence among the Yoruba people of the Old Oyo Empire. While bearing resemblances to the I Ching, Ifá employs up to 256 binary signs, significantly more than the I Ching's 64. This quantity results from squaring 16, which also corresponds to the total permutations within an 8-bit sequence. Within Ifá divination, these permutations represent the potential outcomes, known as Odú. The determination of these Odú involves an Ọpẹlẹ chain, comprising eight seeds. Each seed can assume one of two states (open or closed), thereby generating all conceivable combinations. Ifá originated among the Yoruba people in 15th-century West Africa. In 2008, UNESCO recognized Ifá by including it in its list of "Masterpieces of the Oral and Intangible Heritage of Humanity."

Other cultures

Prior to 1450, inhabitants of Mangareva Island in French Polynesia employed a hybrid binary-decimal numeral system. Across Africa and Asia, slit drums producing binary tones serve to encode messages. Binary combinatorial sets, analogous to the I Ching, have also been integrated into traditional African divination systems, including Ifá, and into medieval Western geomancy. A significant proportion of Indigenous Australian languages utilize a base-2 system.

Western predecessors to Leibniz

During the late 13th century, Ramon Llull aspired to encompass all wisdom across every domain of contemporary human knowledge. To achieve this, he devised a universal method, or "Ars generalis," founded on binary combinations of fundamental principles or categories, leading to his recognition as a precursor to computing science and artificial intelligence.

In 1605, Francis Bacon proposed a system where alphabetic characters could be converted into binary digit sequences, subsequently encoded as barely perceptible font variations within any arbitrary text. Significantly for the overarching theory of binary encoding, Bacon asserted that this methodology was applicable to any objects whatsoever, "provided those objects be capable of a twofold difference only; as by Bells, by Trumpets, by Lights and Torches, by the report of Muskets, and any instruments of like nature."

In 1617, John Napier detailed a system he termed "location arithmetic," which facilitated binary calculations through a non-positional representation utilizing letters. Thomas Harriot explored various positional numbering systems, including binary, but his findings remained unpublished during his lifetime, later discovered within his papers. The initial European publication of this system may have been by Juan Caramuel y Lobkowitz in 1700.

Leibniz

Leibniz authored over a hundred manuscripts concerning binary, with the majority remaining unpublished. Prior to his inaugural dedicated work in 1679, many manuscripts reveal his preliminary explorations of binary concepts, encompassing numerical tables and rudimentary calculations, frequently annotated in the margins of non-mathematical texts.

In his first recognized work on binary, “On the Binary Progression", published in 1679, Leibniz presented methods for converting between decimal and binary, alongside algorithms for fundamental arithmetic operations like addition, subtraction, multiplication, and division using binary numbers. Furthermore, he devised a form of binary algebra for computing the square of a six-digit number and for extracting square roots.

His most renowned contribution is found in his article Explication de l'Arithmétique Binaire, published in 1703. The complete title of Leibniz's article translates into English as the "Explanation of Binary Arithmetic, which uses only the characters 1 and 0, with some remarks on its usefulness, and on the light it throws on the ancient Chinese figures of Fu Xi". Leibniz's system, akin to the modern binary numeral system, employs the digits 0 and 1. An illustration of Leibniz's binary numeral system is provided below:

The binary representation 0001 corresponds to the numerical value 20.
The binary representation 0010 corresponds to the numerical value 21.
The binary representation 0100 corresponds to the numerical value 22.
The binary representation 1000 corresponds to the numerical value 23.

In 1700, during his correspondence with the Jesuit priest Joachim Bouvet, an expert on the I Ching from his missionary work in China, Leibniz elucidated his binary notation. Subsequently, Bouvet's 1701 letters revealed the I Ching as an independent, parallel development of binary notation. Both Leibniz and Bouvet interpreted this correspondence as substantiating significant Chinese achievements in the philosophical mathematics that Leibniz held in high regard. Regarding this independent discovery, Leibniz remarked in his "Explanation Of Binary Arithmetic" that "this restitution of their meaning, after such a great interval of time, will seem all the more curious."

This relationship formed a core tenet of Leibniz's universal language concept, or characteristica universalis, an influential idea that later informed the development of modern symbolic logic by successors like Gottlob Frege and George Boole. Leibniz's initial exposure to the I Ching occurred through his interactions with the French Jesuit Joachim Bouvet, who had served as a missionary in China starting in 1685. He interpreted the I Ching hexagrams as corroborating the universal applicability of his Christian religious convictions. Binary numerals held a pivotal position within Leibniz's theological framework, as he posited that they symbolized the Christian theological concept of creatio ex nihilo, or creation from nothingness.

[A concept that] is challenging to convey to non-Christians is the creation ex nihilo through God's omnipotent power. Furthermore, it can be asserted that no other phenomenon better illustrates and demonstrates this power than the genesis of numbers, particularly as depicted here through the straightforward and unembellished representation of One and Zero, or Nothing.

Subsequent Advancements

In 1854, the British mathematician George Boole introduced a seminal paper outlining an algebraic system of logic, subsequently termed Boolean algebra. This logical calculus later proved fundamental in the development of digital electronic circuitry.

In 1937, Claude Shannon completed his master's thesis at MIT, which pioneered the implementation of Boolean algebra and binary arithmetic through electronic relays and switches. This thesis, titled A Symbolic Analysis of Relay and Switching Circuits, fundamentally established the principles of practical digital circuit design.

In November 1937, George Stibitz, then affiliated with Bell Labs, finished constructing a relay-based computer he named the "Model K" (derived from "Kitchen," its assembly location), which performed calculations using binary addition. Bell Labs subsequently sanctioned a comprehensive research program in late 1938, with Stibitz leading the initiative. Their "Complex Number Computer," finalized on January 8, 1940, possessed the capability to compute complex numbers. During a demonstration at the American Mathematical Society conference at Dartmouth College on September 11, 1940, Stibitz successfully transmitted remote commands to the Complex Number Calculator via telephone lines using a teletype. This marked the inaugural instance of a computing machine being operated remotely over a telephone line. Notable attendees who observed this demonstration included John von Neumann, John Mauchly, and Norbert Wiener, the latter of whom documented the event in his memoirs.

The Z1 computer, conceived and constructed by Konrad Zuse between 1935 and 1938, incorporated Boolean logic and binary floating-point numbers.

Data Representation

Any numerical value can be expressed as a sequence of bits (binary digits), which themselves can be physically manifested by any mechanism capable of assuming two distinct, mutually exclusive states. The subsequent rows of symbols can each be interpreted as representing the binary numeric value of 667:

The specific numerical value conveyed in each instance is contingent upon the assignment given to each symbol. Historically, early computing systems employed switches, punched holes, and punched paper tapes to denote binary values. Contemporary computers, however, typically represent these numeric values using two distinct voltage levels, while magnetic disks utilize differing magnetic polarities. It is important to note that a "positive," "yes," or "on" state does not inherently equate to the numerical value of one, as this mapping is determined by the specific architectural design.

Adhering to the standard practice of representing numerical values with Arabic numerals, binary numbers are typically expressed using the symbols 0 and §23§. When rendered in text, binary numerals frequently incorporate subscripts, prefixes, or suffixes to denote their base or radix. The subsequent notations are considered equivalent:

When articulated, binary numerals are typically recited digit by digit to differentiate them from decimal numerals. For instance, the binary numeral 100 is pronounced as one zero zero, rather than one hundred, to explicitly convey its binary characteristic and ensure accuracy. Given that the binary numeral 100 signifies the value four, referring to it as one hundred would be ambiguous, as this term denotes a distinct numerical quantity. An alternative is to vocalize the binary numeral 100 as "four" (its correct value), though this approach does not explicitly indicate its binary representation.

Binary Counting Methodology

The process of counting in binary parallels that of any other numerical system. Starting with a single digit, the count advances sequentially through each symbol in ascending order. Prior to delving into binary counting, a concise review of the more conventional decimal counting system serves as a valuable comparative framework.

Decimal Counting System

Decimal counting employs the ten symbols ranging from 0 to 9. The counting process initiates with the incremental replacement of the least significant digit, which is the rightmost digit, frequently termed the first digit. Upon depletion of the available symbols for this position, the least significant digit is reset to §67§, and the adjacent digit of greater significance (located one position to the left) is incremented, a process known as overflow. Subsequently, the incremental substitution of the low-order digit recommences. This systematic procedure of resetting and overflowing is applied successively to each digit of increasing significance. The counting sequence unfolds as follows:

000, 001, 002, ... 007, 008, 009, (the rightmost digit is reset to zero, and the digit immediately to its left is incremented)
010, 011, 012, ...
...
090, 091, 092, ... 097, 098, 099, (the two rightmost digits are reset to zero, and the subsequent digit is incremented)
100, 101, 102, ...

Binary Counting Procedure

Binary counting adheres to an identical procedural framework, wherein incremental substitution commences with the least significant binary digit, or bit (the rightmost position, also designated as the first bit). The key distinction is the exclusive availability of the two symbols, §45§ and §67§. Consequently, once a binary bit attains the value of 1, a subsequent increment resets it to 0 while simultaneously triggering an increment of the adjacent bit to its left:

0000,
0001, (the rightmost bit resets, and the subsequent bit is incremented)
0010, 0011, (the two rightmost bits reset, and the subsequent bit is incremented)
0100, 0101, 0110, 0111, (the three rightmost bits reset, and the subsequent bit is incremented)
1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111 ...

Within the binary system, each bit corresponds to an ascending power of 2; specifically, the rightmost bit denotes 20, the next signifies 2§23§, followed by 2§45§, and so forth. The numerical value of a binary number is derived by summing the powers of 2 associated with each "1" bit. For instance, the binary number 100101 is translated into its decimal equivalent through the following calculation:

1001012 = [ ( §23§ ) × 25 ] + [ ( §67§ ) × 2§89§ ] + [ ( §1011§ ) × 2§1213§ ] + [ ( §1415§ ) × 2§1617§ ] + [ ( §1819§ ) × 2§2021§ ] + [ ( §2223§ ) × 2§2425§ ]
1001012 = [ §23§ × 32 ] + [ §45§ × 16 ] + [ §67§ × 8 ] + [ §89§ × 4 ] + [ §1011§ × 2 ] + [ §1213§ × 1 ]
1001012 = 3710

Binary Arithmetic Operations

Binary arithmetic operates similarly to arithmetic in other positional numeral systems. Fundamental operations such as addition, subtraction, multiplication, and division are applicable to binary numerals.

Addition

Addition represents the most straightforward arithmetic operation in the binary system. The process of summing two single-digit binary numbers is comparatively simple, employing a carrying mechanism.

0 + 0 → 0
0 + 1 → 1
1 + 0 → 1
1 + 1 → 0, with a carry of 1 (as 1 + 1 equals 2, which is equivalent to 0 + (1 × 21)).

When two "1" digits are summed, the result is a "0" digit, and a "1" is carried over to the subsequent column. This process mirrors decimal addition, where summing certain single-digit numbers results in an increment to the left-hand digit if the sum equals or surpasses the radix value (10).

5 + 5 → 0, with a carry of 1 (because 5 + 5 equals 10, which is 0 + (1 × 101)).
7 + 9 → 6, with a carry of 1 (given that 7 + 9 equals 16, which is 6 + (1 × 101)).

This operation is termed carrying. Should an addition result exceed the maximum value representable by a single digit, the surplus quantity, divided by the radix (e.g., 10/10), is "carried" to the left and added to the subsequent positional value. This method is valid because each successive position to the left possesses a weight greater by a factor equivalent to the radix. The carrying principle functions identically in binary arithmetic.

1 1 1 1 1 (carried digits)
    0 1 1 0 1
+   1 0 1 1 1
-------------
= 1 0 0 1 0 0 = 36

This illustration demonstrates the addition of two numerals: 01101§45§ (equivalent to 1310) and 10111§89§ (equivalent to 2310). The uppermost row indicates the carry bits employed during the calculation. Commencing from the rightmost column, the sum of 1 + 1 yields 10§1213§. Consequently, the '1' is carried to the left, and '0' is recorded at the base of the rightmost column. Progressing to the second column from the right, the sum of 1 + 0 + 1 again results in 10§1415§; the '1' is carried, and '0' is placed at the bottom. For the third column, 1 + 1 + 1 equals 11§1617§, necessitating a '1' carry and a '1' written in the bottom row. Continuing this procedure ultimately produces the final sum of 100100§1819§ (equivalent to 36§2021§).

For computational systems performing binary addition, the principle that `x xor y = (x + y) mod 2` for any two bits `x` and `y` facilitates highly efficient calculations.

Long Carry Method

The "long carry method," also known as the "Brookhouse Method of Binary Addition," offers a simplification for numerous binary addition challenges. This technique proves especially advantageous when one of the operands comprises an extended sequence of ones. Its foundation rests on the principle that, within the binary system, adding 1 to a contiguous series of n ones (where n denotes any integer length) yields a result consisting of a '1' followed by a string of n zeros. This logical progression parallels the decimal system, where adding 1 to a sequence of n nines produces a '1' followed by a string of n zeros.

Binary                        Decimal
    1 1 1 1 1     likewise        9 9 9 9 9
 +          1                  +          1
  ———————————                   ———————————
  1 0 0 0 0 0                   1 0 0 0 0 0

Such extended sequences are frequently encountered in the binary system. Consequently, large binary numbers can be efficiently summed in two straightforward steps, minimizing the need for numerous carry operations. The subsequent example illustrates the addition of two numerals: 1 1 1 0 1 1 1 1 1 02 (equivalent to 95810) and 1 0 1 0 1 1 0 0 1 1§67§ (equivalent to 69110), demonstrating both the traditional carry method (on the left) and the long carry method (on the right).

Traditional Carry Method                       Long Carry Method
                                vs.
  1 1 1   1 1 1 1 1      (carried digits)   1 ←     1 ←            carry the 1 until it is one digit past the "string" below
    1 1 1 0 1 1 1 1 1 0                       1 1 1 0 1 1 1 1 1 0  cross out the "string",
+   1 0 1 0 1 1 0 0 1 1                   +   1 0 §67§ 0 1 1 0 0 §89§ 1  and cross out the digit that was added to it
———————————————————————                    ——————————————————————
= 1 1 0 0 1 1 1 0 0 0 1                     1 1 0 0 1 1 1 0 0 0 1

The uppermost row illustrates the carry bits employed. Rather than the conventional carry from one column to the subsequent, the lowest-ordered "1" positioned above a corresponding "1" in the place value below it can be summed, and a "1" may be carried one digit beyond the sequence's termination. The numbers that have been utilized must be marked as processed, as their addition has already occurred. Other extended sequences can be similarly canceled using this identical methodology. Subsequently, any remaining digits are simply added in the standard fashion. Employing this procedure yields the final result of 1 1 0 0 1 1 1 0 0 0 1§1213§ (1649§1415§). In this straightforward example involving small numerical values, the traditional carry method necessitated eight carry operations, whereas the long carry method required only two, thereby demonstrating a significant reduction in computational effort.

Addition Table

The binary addition table exhibits similarities to, but is distinct from, the truth table of the logical disjunction operation {\displaystyle \lor } . This divergence arises because §2324§ §2829§ = §3233§ {\displaystyle 1\lor 1=1} , whereas in binary addition, §4849§ + §5253§ = §5657§ {\displaystyle 1+1=10} .

Subtraction

Binary subtraction operates on a largely analogous principle:

0 − 0 → 0
0 − 1 → 1, borrow 1
1 − 0 → 1
1 − 1 → 0

Subtracting a "1" digit from a "0" digit results in the digit "1", necessitating a subtraction of "1" from the subsequent column. This operation is termed borrowing. The underlying principle mirrors that of carrying. When a subtraction yields a result less than 0, which is the minimum possible digit value, the procedure involves "borrowing" the deficit, divided by the radix (i.e., 10/10), from the left, subsequently subtracting it from the next positional value.

*   * * *   (starred columns are borrowed from)
  1 1 0 1 1 1 0
−     1 0 1 1 1
----------------
= 1 0 1 0 1 1 1
  *             (starred columns are borrowed from)
  1 0 1 1 1 1 1
–   1 0 1 0 1 1
----------------
= 0 1 1 0 1 0 0

The subtraction of a positive number is functionally equivalent to adding a negative number of the same absolute magnitude. Computers employ signed number representations, most commonly two's complement notation, to manage negative numbers. Such representations obviate the requirement for a distinct "subtract" operation. Utilizing two's complement notation, subtraction can be concisely expressed by the following formula:

A − B = A + not B + 1

Multiplication

Binary multiplication parallels its decimal counterpart. Two numbers, A and B, can be multiplied through the generation of partial products: for each digit within B, the product of that digit with A is computed and recorded on a new line, shifted leftward such that its rightmost digit aligns with the corresponding digit in B that was used. The summation of all these partial products yields the final outcome.

Given that binary employs only two digits, each partial multiplication can result in only two potential outcomes:

For instance, the binary numbers 1011 and 1010 are multiplied as demonstrated below:

1 0 1 1   (A)
         × 1 0 1 0   (B)
         ---------
           0 0 0 0   ← corresponds to the rightmost 'zero' in B
   +     1 0 1 1     ← corresponds to the next 'one' in B
   +   0 0 0 0
   + 1 0 1 1
   ---------------
   = 1 1 0 1 1 1 0

Binary numbers can also be multiplied when they include bits positioned after a binary point:

The following example demonstrates binary multiplication, where A (5.625 in decimal) is multiplied by B (6.25 in decimal). The process involves generating partial products, such as 1.01101 corresponding to a 'one' in B and 00.0000 corresponding to a 'zero' in B, which are then summed to yield the final product. The result of this operation is 100011.00101, which equates to 35.15625 in decimal.

Multiplication Table

The binary multiplication table corresponds precisely to the truth table for the logical conjunction operation, represented symbolically as {\displaystyle \land } .

Division

Binary long division is analogous to its decimal system counterpart.

In the subsequent illustration, the divisor is 1012 (equivalent to 5 in decimal), and the dividend is 110112 (equivalent to 27 in decimal). The methodology mirrors that of decimal long division. Initially, the divisor 101§45§ is observed to divide into the first three digits of the dividend, 110§67§, exactly once, leading to a '1' being placed on the quotient line. This partial quotient is then multiplied by the divisor and subtracted from the initial three digits of the dividend. Subsequently, the next digit (a '1') is appended to form a new three-digit sequence for the next iteration.

The initial step of the division is depicted as follows:
1
___________
1 0 1 ) 1 1 0 1 1
− 1 0 1
-----
0 0 1

This iterative procedure continues with the newly generated sequence until all digits of the dividend have been processed.

The complete long division process is illustrated below:
1 0 1
___________
1 0 1 ) 1 1 0 1 1
− 1 0 1
-----
1 1 1
− 1 0 1
-----
0 1 0

Consequently, dividing 110112 by 101§45§ yields a quotient of 101§67§, which is presented on the top line, and a remainder of 10§89§, indicated on the bottom line. In the decimal system, this operation is equivalent to dividing 27 by 5, resulting in a quotient of 5 and a remainder of 2.

Beyond standard long division, alternative procedures can be formulated that permit over-subtraction from the partial remainder during each iteration. This approach leads to alternative methodologies that, while less systematic, offer increased flexibility.

Square Root

The iterative process for calculating a binary square root, digit by digit, is fundamentally similar to its decimal counterpart but significantly simplified by the binary system's characteristics. Initially, the digits are grouped into pairs, with a leading zero appended if required to ensure an even total number of digits. At each subsequent step, the current partial root is considered, augmented by the digits '01'. If this augmented value can be subtracted from the current remainder, the subtraction is performed. Subsequently, the remainder is extended by incorporating the next pair of digits from the original number. If a subtraction occurred, the next digit of the root is '1'; otherwise, it is '0'.

The process of binary square root calculation is illustrated through a series of steps: Initially, with an accumulated answer of 0, extending it by '01' yields '001'. As '001' can be subtracted from the initial pair '10', the first digit of the quotient is determined to be '1'. Subsequently, with an answer of '1', extending it by '01' results in '101'. Since '101' is subtractable from the current remainder '110', the next digit of the quotient is '1'. Progressing, an answer of '11', when extended by '01', forms '1101'. This value is too large to be subtracted from the current remainder '110', thus the subsequent digit of the quotient is '0'. Finally, with an answer of '110', extending it by '01' produces '11001'. This value is subtractable from the remainder '11001', establishing the next digit of the quotient as '1'. The calculation concludes at this point.

In binary arithmetic, a fraction's binary expansion terminates exclusively when its denominator is a power of two. Consequently, fractions such as 1/10, whose denominator (10) possesses prime factors other than 2 (specifically, 5), lack a finite binary representation. This characteristic leads to inaccuracies in binary floating-point arithmetic, where, for instance, 10 × 1/10 may not precisely equal 1. As an illustrative example, the binary expansion of 1/3 is represented as .010101..., which signifies that

§89§ §1011§ = §1617§ × §2223§ §2829§ + §3435§ × §4041§ §4647§ + §5253§ × §5859§ §6465§ + §7071§ × §7677§ §8283§ + . {\displaystyle {\frac {1}{3}}=0\times 2^{-1}+1\times 2^{-2}+0\times 2^{-3}+1\times 2^{-4}+\cdots .}

Consequently, an exact value for 1/3 cannot be achieved through a finite summation of inverse powers of two, as the zeros and ones in its binary representation alternate indefinitely.

Bitwise Operations

Although not directly pertaining to the numerical interpretation of binary symbols, sequences of bits can be manipulated using Boolean logical operators. When a string of binary symbols undergoes such manipulation, it is termed a bitwise operation. The logical operators AND, OR, and XOR can be applied to corresponding bits within two input binary numerals. The logical NOT operation, conversely, can be performed on individual bits of a single input binary numeral. These operations are sometimes employed as computational optimizations or arithmetic shortcuts, offering various other benefits in computation. For instance, an arithmetic left shift of a binary number is functionally equivalent to multiplication by a positive, integral power of two.

Conversion to and from Other Numeral Systems

Decimal to Binary

The conversion of a base-10 integer to its binary (base-2) equivalent involves a systematic division process. The initial step requires dividing the decimal number by two; the resulting remainder constitutes the least significant bit (LSB) of the binary representation. Subsequently, the quotient from this division is again divided by two, yielding a new remainder that serves as the next least significant bit. This iterative procedure continues until a quotient of one is obtained. The complete binary value is then formed by concatenating the sequence of remainders, including the final quotient of one, as each remainder generated by division by two will inherently be either zero or one. For instance, the decimal number (357)10 translates to (101100101)2 in binary.

Binary to Decimal Conversion

The process for converting a base-2 (binary) number to its base-10 (decimal) equivalent is essentially the inverse of the previously described algorithm. This method involves processing the binary digits sequentially, commencing from the most significant bit (MSB), which is the leftmost digit. Starting with an initial decimal value of zero, the current accumulated value is doubled, and the subsequent binary digit is then added to this doubled sum to generate the new accumulated value. This procedure can be effectively structured using a multi-column tabular format. As an illustration, consider the conversion of 100101011012 to its decimal representation:

The final decimal result obtained is 119710. The initial 'Prior Value' of zero serves as the starting decimal accumulator. Notably, this conversion technique is an implementation of Horner's method.

Fractional components of numbers are converted using analogous methodologies. These methods are fundamentally predicated on the principle that bit shifting operations are equivalent to multiplication by two (doubling) or division by two (halving).

For a fractional binary number, such as 0.110101101012, the first digit after the binary point represents §1011§§1213§{\textstyle {\frac {1}{2}}}, the second digit signifies (§3435§§3637§)§4445§=§5253§§5455§{\textstyle ({\frac {1}{2}})^{2}={\frac {1}{4}}}, and so forth. Consequently, if the first position after the binary point contains a '1', the number's value is at least §7475§§7677§{\textstyle {\frac {1}{2}}}, and conversely. Doubling this value would result in a number equal to or greater than 1. This observation leads to an algorithm: repeatedly double the fractional number to be converted, note whether the result is equal to or exceeds 1, and then discard the integer portion before the next iteration.

As an illustration, the decimal fraction (§1011§§1213§)§2021§{\textstyle ({\frac {1}{3}})_{10}} converts to binary as follows:

Consequently, the repeating decimal fraction 0.3... corresponds to the repeating binary fraction 0.01... .

Another example involves converting 0.110 to its binary representation:

This also results in a repeating binary fraction, specifically 0.00011... . It is often unexpected that certain terminating decimal fractions can possess non-terminating, repeating expansions when converted to binary. This phenomenon explains why many users are surprised to find that the sum of ten instances of 1/10 deviates from 1 in binary floating-point arithmetic. Indeed, only binary fractions expressible as an integer divided by a power of two can have terminating expansions; 1/10 does not fit this criterion.

The concluding conversion method addresses binary to decimal fractions. While repeating fractions present a unique challenge, the general approach involves shifting the binary fraction to obtain an integer, converting this integer using the previously described method, and subsequently dividing the result by the corresponding power of two in the decimal system. Consider the following example:

Initial structural placeholders are present: .

A common alternative for converting binary to decimal, particularly efficient for individuals proficient in hexadecimal, involves an indirect two-step process. This method entails first transforming a binary number ( x {\displaystyle x} ) into its hexadecimal equivalent ( x {\displaystyle x} ), and subsequently converting this hexadecimal representation ( x {\displaystyle x} ) into its decimal form ( x {\displaystyle x} ).

When dealing with exceptionally large numbers, the aforementioned straightforward conversion techniques prove inefficient due to the extensive number of multiplications or divisions involving operands of considerable magnitude. A more asymptotically effective approach employs a divide-and-conquer algorithm: for a given binary number, it is partitioned by 10k, with k selected to ensure an approximate equality between the quotient and the remainder. Subsequently, each resulting segment is converted to decimal and then concatenated. Conversely, to convert a decimal number, it can be segmented into two approximately equal parts, each independently converted to binary. The first converted segment is then multiplied by 10k and added to the second converted segment, where k represents the count of decimal digits in the original second, least-significant segment prior to conversion.

Hexadecimal System

The conversion between binary and hexadecimal representations is notably straightforward because the radix of the hexadecimal system (16) is a direct power of the binary system's radix (2). Specifically, since 16 equals 24, a single hexadecimal digit corresponds precisely to four binary digits, as illustrated in the accompanying table.

To transform a hexadecimal number into its binary equivalent, one simply replaces each hexadecimal digit with its corresponding four-bit binary sequence:

3A16 = 0011 10102
E716 = 1110 01112

To convert a binary number into its hexadecimal equivalent, the binary sequence must be segmented into groups of four bits. Should the total number of bits not be a multiple of four, leading 0 bits are appended to the left (a process known as padding) to complete the final group. For instance:

10100102 = 0101 0010 (after grouping with padding) = 5216
110111012 = 1101 1101 (after grouping) = DD16

To convert a hexadecimal number to its decimal equivalent, one must multiply the decimal value of each hexadecimal digit by the corresponding power of 16 and then sum these products:

C0E716 = (12 × 163) + (0 × 16§45§) + (14 × 16§67§) + (7 × 16§89§) = (12 × 4096) + (0 × 256) + (14 × 16) + (7 × 1) = 49,38310

Octal System

Binary numbers can also be readily converted to the octal numeral system because octal employs a radix of 8, which is a power of two (specifically, 23). Consequently, precisely three binary digits are required to represent a single octal digit. The mapping between octal and binary numerals mirrors that for the initial eight hexadecimal digits presented in the preceding table. For instance, binary 000 corresponds to octal 0, binary 111 corresponds to octal 7, and so on.

The conversion process from octal to binary is analogous to that used for hexadecimal:

658 = 110 1012
178 = 001 1112

Conversely, for conversion from binary to octal:

1011002 = 101 1002 (after grouping) = 548
100112 = 010 0112 (after grouping with padding) = 238

Furthermore, for converting from octal to decimal:

658 = (6 × 8§23§) + (5 × 8§45§) = (6 × 8) + (5 × 1) = 5310
1278 = (1 × 82) + (2 × 8§45§) + (7 × 8§67§) = (1 × 64) + (2 × 8) + (7 × 1) = 8710

Representation of Real Numbers

Non-integer values are represented through the application of negative powers, delineated from the integer portion by a radix point (termed a decimal point within the decimal system). For instance, the binary number 11.012 signifies:

This equates to a decimal value of 3.25.

Dyadic rational numbers, expressed as p §1112§ a {\displaystyle {\frac {p}{2^{a}}}} , possess a terminating binary numeral, meaning their binary representation contains a finite number of terms following the radix point. Conversely, other rational numbers exhibit binary representations that, rather than terminating, recur, characterized by an indefinitely repeating finite sequence of digits. An example is provided below.

For example, §910§ §1213§ §1718§ §2021§ = §3132§ §3435§ §3940§ §4243§ = 0.01010101 01 ¯ §6869§ {\displaystyle {\frac {1_{10}}{3_{10}}}={\frac {1_{2}}{11_{2}}}=0.01010101{\overline {01}}\ldots \,_{2}} , and §8990§ §9293§ §9798§ §100101§ = 1100 §114115§ 10001 §122123§ = 0.1011010010110100 10110100 ¯ §148149§ {\displaystyle {\frac {12_{10}}{17_{10}}}={\frac {1100_{2}}{10001_{2}}}=0.1011010010110100{\overline {10110100}}\ldots \,_{2}} .

The characteristic of binary representations for rational numbers—being either terminating or recurring—is also observed in other radix-based numeral systems, such as decimal. A further commonality is the availability of alternative representations for any terminating form, predicated on the principle that 0.111111... constitutes the sum of the geometric series 2−1 + 2−2 + 2−3 + ..., which evaluates to 1.

Binary numerals that neither terminate nor exhibit a recurring pattern denote irrational numbers. Illustrative examples include:

  • The sequence 0.10100100010000100000100... displays a discernible pattern; however, this pattern is not of a fixed-length recurring nature, thereby classifying the number as irrational.
  • Furthermore, 1.0110101000001001111001100110011111110... represents §8 {\displaystyle {\sqrt {2}}} , which is the square root of 2, another irrational number. This representation lacks any discernible repeating pattern.

ASCII

  • ASCII
  • Balanced ternary
  • Bitwise operation
  • Binary code
  • Binary-coded decimal
  • Binary non positional code
  • Finger binary
  • Gray code
  • IEEE 754
  • Linear-feedback shift register
  • Offset binary
  • Quibinary
  • Reduction of summands
  • Redundant binary representation
  • Repeating decimal
  • Two's complement
  • Unicode

  • Conversion of Fractions at cut-the-knot
  • Sir Francis Bacon's biliteral cipher system preceded the development of the binary number system.
  • An analysis of binary's efficacy as a numerical base.
Çavkanî: Arşîva TORÎma Akademî

About this article

What is Binary number?

A short guide to Binary number, how it works, where it is used and its key concepts.

Topic tags

What is Binary number Binary number explained How Binary number works Binary number use cases Technology articles Technology in Kurdish

Common searches on this topic

  • What is Binary number?
  • How does Binary number work?
  • Where is Binary number used?
  • Why is Binary number important?

Category archive

Torima Akademi Neverok: Technology Archive

Dive into the Torima Akademi Neverok archive for in-depth articles on cutting-edge technology. From foundational concepts like Big O notation and Binary numbers to emerging trends such as 5G, Augmented Reality, and 3D

Home Back to Technology