Binary

[èr jìn zhì]
Counting method
open 2 entries with the same name
Collection
zero Useful+1
zero
synonym Binary digit (A number system widely used in computing technology) Generally refers to binary (counting method)
Binary: mathematics and digital circuit The numeration system with radix 2 in is a binary system with radix 2 representing the system. In this system, two different symbols 0 (representing zero) and 1 (representing one) are usually used to represent [1] The discoverer is Leibniz number electronic circuit Medium, Logic gate The implementation of computer And computer dependent devices. Each number is called a Bit (Abbreviation of Bit, Binary digit) [2]
Chinese name
Binary
Foreign name
binary system
Category
algorithm
Properties
Counting method

Counting system

Announce
edit

Base

At base b Location counting system (where b It's a positive Natural number , called base ), b The basic symbols (or numbers) correspond to the minimum of 0 b Natural number. To generate other numbers, the position of the symbol in the number is used. The sign of the last bit multiplies its own value by the value of the left bit b Generally speaking, if b Is the base b The number in the base system is expressed as
And write down the numbers in order a zero a one a two a three ... a k These numbers are from 0 to b -Natural number of 1 [3]
Generally speaking, b Numbers in the base system have the following forms:
number
and
Is the corresponding number proportion [3]

Binary Count

German mathematicians from the 17th century to the 18th century Leibniz , the first proposal in the world Binary notation People. Use binary notation, only use 0 and 1 symbols, no other symbols [4]
Binary data is also used Counting method , which Position power It's based on 2 power For example, binary data 110.11 enters 1 every 2, and the order of weight is 2 ², 2 ¹, 2 º
With n bits integer , m bit decimal The binary data of is expressed by weighted coefficient expansion, which can be written as [5]
Binary data can generally be written as:
[Example]: Write binary data 111.01 as weighted coefficient Form of.
Solution:
Binary and hexadecimal octal number system Same, two power Come to carry.

operation

Announce
edit

addition

There are four cases of binary addition: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (0 carry is 1) [5]

multiplication

There are four cases of binary multiplication: 0 × 0=0, 1 × 0=0, 0 × 1=0, 1 × 1=1 [5]

subtraction

There are four cases of binary subtraction: 0 - 0=0, 1 - 0=1, 1 - 1=0, 10 - 1=1 [5]

division

There are two cases of binary division (divisor can only be 1): 0 ÷ 1=0, 1 ÷ 1=1 [5]

example

The arithmetic operation of two binary numbers 1001 and 0101 can be expressed as:
Binary

Decimal conversion

Announce
edit

Convert binary to decimal

Method: "Sum by weight expansion". The specific step of this method is to first write the binary number into the weighted coefficient expansion, and then sum according to the decimal addition rules [6]
[Example]:
Rule: the number in the single digit is 0, the number in the ten digit is 1, The number of decimal digits is - 1, the number of percentile digits is - 2, Decreasing in sequence.

Convert decimal to binary

It is necessary to convert a decimal number into a binary number integer Part and decimal parts are converted separately and then combined together [7]
The integer part adopts the method of "divide by 2 and take remainder, reverse order". Specifically, divide decimal integers by 2 to get a merchant and remainder Then remove the quotient by 2, and a quotient and a remainder will be obtained. Do this until the quotient is less than 1. Then take the remainder obtained first as the low significant bit of the binary number, and the remainder obtained later as the high significant bit of the binary number, and arrange them in sequence [7] Example: 125.
Integer part
The decimal part shall be rounded by multiplying by 2. That is, multiply the decimal fraction by 2 and get the integer of the result (must be 0 or 1), then repeat the previous step with the remaining decimal fraction until the remaining decimal fraction is 0, and finally arrange the integer parts obtained each time from left to right in order to get the corresponding binary decimal. For example, the process of converting decimal decimal 0.8125 to binary decimal is as follows [7] :
Fractional part
Fractional part, HD

Universal decimal conversion

Different Base The essence of conversion is to determine the number at different weight positions. transformation positive integer There is a simple algorithm for the decimal system of, that is, by using the target radix for long division; Remainder gives the "number" starting from the lowest order [3] For example, 1020304 goes from decimal to decimal:
Convert decimal to hexadecimal
For another example, 10110111 goes from binary to binary:
Binary to pentadecimal

Computer adopts binary reason

Announce
edit
first, Binary counting system Only two Digital 0 and 1, so any element with two different stable states can be used to represent a bit of a number. In fact, there are many components with two obvious stable states. For example, Neon lamp "On" and "off" of; "On" and "Off" of the switch; "High" and "Low", "Positive" and "Negative" of voltage; "Holes" and "no holes" on the paper tape; "With signal" and "without signal" in the circuit; magnetic material The South Pole and the North Pole, etc. It is easy to use these different states to represent numbers. Not only that, but more importantly, the two completely different states are not only different in quantity, but also in quality. In this way, the anti-interference ability and reliability of the machine can be greatly improved. It is much more difficult to find a simple and reliable device that can represent more than two states [8]
Secondly, binary counting system Four arithmetic operations The rules are very simple. In addition, the four operations can finally be reduced to addition and displacement In this way, the circuit of the calculator in the electronic computer becomes very simple. Moreover, the line is simplified and the speed can be increased. This is also ten Carry counting system Incomparable [8]
Third, the use of binary representations in electronic computers can save equipment. It can be proved theoretically that the ternary system saves the most equipment, followed by the binary system. However, most electronic computers still use binary system because binary system has advantages that other systems, including ternary system, do not have. In addition, since only two symbols "0" and "1" are used in binary Boolean algebra To analyze and synthesize the logic circuits in the machine. This provides a very useful tool for designing electronic computer circuits [8]
Fourth, the binary symbols "1" and "0" exactly correspond to "true" and "false" in logic operation, which is convenient for computer logic operation.