How to calculate binary?
A:
Binary system is a very old carry system. Because modern is used in electronic computers, its value doubles.
In real life and counters, if the "device" representing numbers has only two states, such as the "on" and "off" of electric lights and the "on" and "off" of switches. One state indicates the number 0, and the other state indicates that the numbers 1, 1 and 1 should be equal to 2. Because there is no number 2, we can only go up by one digit, that is, we adopt the principle of "all binary ones", which is exactly the same as the principle of "all decimal ones" in decimal system.
1+ 1= 10, 10+ 1= 1 1, 1 1+ 1= 100, 100+ 1= 10 1,
10 1+ 1= 1 10, 1 10+ 1= 1 1 1, 1 1 1+ 1+= 1000,……,
It can be seen that binary 10 means two, 100 means four, 1000 means eight, and 10000 means sixteen.
Binary system is also a "value system". The same number 1 represents different values with different digits. Such as 1 1 1, counting from right to left, the first 1 is one, the second1is two, the third1is four and the fourth/kloc-. Explain the meaning of this binary number with the familiar decimal system, which has the following relationship.
(111) (binary) =1× 24+1× 23+1× 22+1× 2
A binary integer, starting from the first bit on the right, and the counting unit of each bit is 1, 2, 22, 23, …, 2n, ….
The main reason why computers use binary is that binary has the following advantages:
(1) is easy to realize in technology. Binary digits 0 and 1 can be easily represented by bistable circuits.
(2) High reliability. Binary only uses 0 and 1, which is not easy to make mistakes in transmission and processing, and ensures the high reliability of the computer.
(3) The operation rules are simple. Compared with decimal numbers, the operation rules of binary numbers are much simpler, which not only simplifies the structure of operators, but also helps to improve the operation speed.
(4) Consistent with logical quantity. Binary numbers 0 and 1 correspond to logical quantities "true" and "false", so it is very natural to represent binary logic with binary numbers.
(5) The conversion between binary numbers and decimal numbers is quite easy. People can still use the customary decimal number when using the computer. The computer automatically converts it into binary number for storage and processing, and then automatically converts the binary number into decimal number when outputting the processing result, which brings great convenience to the work.
Q:
What is the relationship between barcode and binary?
A:
(written) in black and white
This forms a unique mark of data traceability.
The color of an object is mainly determined by the type of light it reflects. White objects can reflect various wavelengths of visible light, while black objects absorb various wavelengths of visible light. Therefore, when the light emitted by the light source in barcode scanner is reflected on the bar code, the reflected light shines on the photoelectric converter inside barcode scanner, and the photoelectric converter converts the reflected light signal into corresponding electrical signals according to the different intensities. According to different principles, scanners can be divided into three types: light pen, CCD and laser. The electrical signal is output to the amplification circuit of the barcode scanner to enhance the signal, and then sent to the shaping circuit to convert the analog signal into a digital signal. The widths of white bars and black bars are different, and the duration of corresponding electrical signals is also different. Then, the decoder determines the number of bars and spaces by measuring the number of pulse digital electrical signal 0, 1, and determines the width of bars and spaces by measuring the duration of 0, 1 signal. The data obtained at this time is still quite confusing. In order to know the information contained in bar code, it is necessary to convert bar code symbols into corresponding digital and character information according to the corresponding coding rules (such as EAN-8 code). Finally, the detailed information of the article is identified by the computer system, and the data is processed and managed.
Barcode and binary can only be said to have a little connection, but it is not binary.
There are two coding methods for bar codes. One is the width adjustment method, which means that the bar code has only two widths, narrow unit and wide unit. Narrow cells represent 0, and wide cells represent 1.
The second method is module assembly, in which several modules form one, and several empty modules form one. In this method, the vertical line represents 1 and the space represents 0.
Different combinations of 0 1 represent different numbers. There is no operational relationship between these binary numbers and decimal numbers, but there is a one-to-one correspondence.
Q:
Why do computers use binary information?
1, which is easy to realize in the circuit.
There are only two binary digits (0 and 1). As long as the circuit can identify low and high, it can represent "0" and "1".
2. Physical storage is the easiest.
(1) Basic principle: Binary is the easiest to store physically, and it is recorded by the orientation of the magnetic pole, the unevenness of the surface, the presence or absence of illumination, etc.
(2) The specific truth: For a write-once optical disc, the laser beam is converged into a small beam of 1-2 um, and the tellurium alloy film on the surface of the optical disc is melted by the action of heat, forming a small hole (pit) on the film, recording "1" and recording "0" in the original position indication.
3. It is convenient for addition, subtraction and counting coding.
4. It is convenient for logical judgment (yes or no).
The two digits of the binary correspond to "true", "false" or "yes" and "no" in logical propositions.
Note: Octal computers, originally used in early small computers, are no longer used, while hexadecimal is still worth studying.
Decimal binary hexadecimal decimal binary hexadecimal
0 0000 0 8 1000 8
1 000 1 1 9 100 1 9
2 00 10 2 10 10 10 A
3 00 1 1 3 1 1 10 1 1 B
4 0 100 4 12 1 100 C
5 0 10 1 5 13 1 10 1D
6 0 1 10 6 14 1 1 10 E
7 0 1 1 1 7 15 1 1 1 1 1 F