Home  >  Article  >  What is used internally by computers to count

What is used internally by computers to count

藏色散人
藏色散人Original
2021-01-07 11:53:07181772browse

The computer uses binary numbers to count internally. The base of this value is 2, using "two to one"; the computer internally counts and stores data all in binary; although the computer uses binary numbers internally for calculations, Storage, but what is output to the user is often not binary 0 and 1 codes.

What is used internally by computers to count

#The operating environment of this article: Dell G3 computer, Windows 7 system.

Different from common decimal numbers, binary numbers are widely used in computing technology. The base of this kind of value is 2, and it adopts "two to one". You can compare it with the decimal number "one to ten" for analogy.

There are nine numbers in decimal system, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Binary has only two numbers, 0 and 1.

The decimal single digits start from 0 plus 1 and add to 9. Add 1 to advance one digit and become "10".

In binary, add 1 from 0 to 1, then add 1, and the single digit is full. If you move forward one digit, it becomes "10".

Add 1 to become "11". When adding 1, the ones digit is advanced by 1 to the tens digit, and the tens digit is also advanced by 1 to the previous hundreds digit, so we get "100" and so on. Binary counting table.

This is probably the basic difference between binary and decimal. Similar to this, we also have octal, hexadecimal and so on. However, the computer's internal counting and storage of data all use binary.

Why not use decimal? In short, the reason why computers can recognize and store data is because it is easier for computers to recognize two states - the "on" and "off" states of each component correspond to 0 and 1, which is easy to use electronically Implementation, such as early transistors and later diodes. In this way, 01 can be combined into a string of symbolic codes, and the operation method also corresponds to binary operation. For computers, it's simple, fast and convenient.

Although the computer uses binary numbers for calculation and storage, the output to the user is often not binary 0 and 1 codes that are difficult to understand. From this point of view, computers can be regarded as a clear representative of "doing one thing secretly and another overtly"!

For more related knowledge, please visit PHP Chinese website!

The above is the detailed content of What is used internally by computers to count. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn