In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the basic concept and binary concept of computer software". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn "what are the basic concepts and binary concepts of computer software?"
Chapter I computer Foundation
This part mainly introduces the computer-related knowledge, focusing on the basic knowledge related to software programming.
In fact, for programming, the more the foundation of the computer, the better, but due to the limitations of time and energy, everyone's understanding is actually very limited. Here are the basic knowledge commonly used in programming. Please actively correct and supplement the omissions.
The essential structure of the computer is to digitize all the contents. In fact, software programming also uses the same logic to digitize all kinds of states that need to be saved.
1.1 basic concepts of computer software
The concept of software
As we all know, computers are divided into hardware and software. in fact, what can be seen and touched is hardware, such as hard disk and motherboard, and even software that can not be touched.
According to the professional point of view, software is a sequence of instructions, so how to understand it? To give a basic example, for example, when you sign up for the school, the school will give you a list, which will generally write where to pay the fee first, then get the certificate, physical examination and so on. Anyway, there are at least more than 10 items. If each operation is regarded as an instruction, this is the essence of the software.
Or according to Feng. Neumann's computer system, the computer is to accept input, processing, feedback results, in fact, the same is true of the software, providing an interface to accept the user's input, processing according to logic, and feedback the results to the user, whether it is ordinary software or games.
Why is the computer binary?
It is well known that today's computers store and operate data in binary, so why binary instead of the common decimal system?
The reason is simple, because today's computer is an electronic computer, there are only two states inside, so a new binary form is created based on these two states. This greatly simplifies the structure of the electronic computer, and the binary system of mathematics can be realized with the presence or absence of current, light and magnetism. Mathematically, 0 and 1 represent these two states, respectively.
Of course, with the development of science, the computer is no longer an electronic computer, so the binary system may disappear.
Computer storage unit
Since the computer is an electronic computer, the smallest unit of storage is a binary bit. English is bit, abbreviated to b. A person has only two values, 0 or 1. Because the unit of bit is too small, another concept is designed-byte, English is byte, abbreviated to B. Specifies that 1 byte is 8 bits, that is, 1B=8b. For example, the 8-bit and 16-bit computers that we come into contact with refer to the smallest unit of data processed by CPU at a time.
The larger units are KB, MB, GB and TB, and the binary between them is 2 to the 10th power, that is, 1024, that is, 1KB of 1024B, 1MB of 1024KB. Here is a simple practical problem. When you buy a hard disk, such as 160GB, the manufacturer uses 1000 instead of 1024, so after formatting 160x1000x1000x1000, there will be only (160x1000x1000x1000) / 1024GB 1024 = 149GB.
The things about Java programming-- the concept of binary
Java, Java training, Java Basics, Java Learning, Java tutorials
The concept of base 1.2
Because it is not possible to create a symbol for each value, you need to combine a compound value with a basic number, so you have the concept of a base.
In fact, all the bases are man-made and are used to count conveniently. Now the most commonly used system is the decimal system, of course, other bases are also in use. For example, the idiom "half a kilo and eight taels" reflects the ancient concept that one jin equals sixteen taels, that is, hexadecimal counting.
The systems commonly used in computer programming are binary, octal, decimal and hexadecimal, and decimal is the most important form of expression. In programming, the value you write defaults to decimal.
For binary, there are two most basic concepts: cardinality and operational rules.
A cardinality refers to a basic number that is composed of a base, that is, a number that can no longer be split. For example, decimal is 0-9, binary is 0 and 1, octal is 0-7, and hexadecimal is 0-9 (uppercase and lowercase). Or you can simply remember it this way, assuming that it is in the n base, the cardinality is the number of [0magnetic nmur1], the cardinality is the same as the progressive value, the decimal system has ten cardinals, and so on.
L operation rules are carry or borrowing rules, which are similar to the concept of median weight in general computer books. for example, for decimal systems, the rule is "ten into one, borrow one to ten", that is, the low number is ten into the high, and the one borrowed from the high position is equivalent to the low ten. The same is true of other binary systems, that is, "full binary into one, borrow one when binary", and the same is true of octal and hexadecimal.
Mathematically indicates that a number is decimal, usually in the following format: [numeric] binary number, for example, [10] 2 represents a binary value 10. 1.2.1 binary is the form of data representation inside the computer, so you must be familiar with binary when learning computer programming. Familiarity with binary has the following uses: l it is easier to understand the way computers store data. many conversions within the computer, such as strong conversion between data types, can be used to interpret the value of the final result in binary.
1.2.1 binary
The operation speed of binary system is much higher than that of decimal system. For example, to find the n-power of 2, the efficiency achieved by shift is more efficient than the mathematical method.
L use binary values for data storage to store values in binary form, one is more resource-saving, you can use binary bits to store information, such as common hardware control information, are provided in binary form.
As mentioned earlier, binary contains two cardinals 0 and 1, and the operation rule is "full binary into one, borrow one when two". Here is a brief introduction to the counting method of binary.
For example, if the 0-9 of the decimal system is expressed in binary, the order is as follows: 0grade1, 10, 11, 100, 101, 110, 111, 111, 1000, 100, 1, 1, 000, 100, 1, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 1, 1, 10, 1, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1,
Here are some basic results of binary operations:
Addition operation
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10
Subtraction
0-0 = 0
0-1 =-1
1-0 = 1
1-1 = 0
Multiplication
0 × 0 = 0
0 × 1 = 0
1 × 0 = 0
1 × 1 = 1 l
Division
0 / 0 is meaningless
0 / 1 = 0
1 / 0 is meaningless.
1 / 1 = 1
Here are some consistent expressions: 110111 = 1101 these basic operational structures are generally not directly used in actual development, but the understanding of binary concepts can be deepened through these contents.
1.2.2 conversion between binary and decimal
Because the data inside the computer is expressed in binary, and the decimal system is the most commonly used system in daily life, it is often necessary to convert between them. Here's how to convert it.
1.2.2.1 convert decimal to binary
There are three ways to convert decimal integers to binary, namely, division binary remainder, calculator conversion and empirical method. Finally, the conversion method of decimal is briefly introduced.
1. The method of dividing two to take the remainder is the most basic and general method in conversion. The rule is: use decimal and 2 to remove, take the quotient and the remainder obtained each time, and continue to divide the quotient from 2 until the quotient is zero, the remainder obtained for the first time is the low bit of binary, and the remainder obtained for the last time is the high bit of binary. The number composed of the remainder is the converted binary value. For example, the calculation steps for converting decimal 13 to binary are as follows:
Quotient remainder
13 / 2 = 6 1
6 / 2 = 3 0
3 / 2 = 1 1
1 / 2 = 0 1
The final result of the calculation is 1101. two。
Computer conversion
The calculator in the Windows operating system can also easily realize the conversion between binary systems. Open the calculator in the attachment submenu in the program menu, select "Scientific" from the view menu of the open calculator, enter the decimal number you want to convert, such as 13, and then the "binary" on the west side of the number display box on the interface. The converted value is displayed directly in the calculator.
Empirical method
After you are familiar with the binary system, the calculation of the corresponding decimal numbers can be realized by some basic mathematical transformations. Before using the empirical method, you must memorize the decimal values corresponding to the 0-10 power of 2. The order is as follows: 1, 2, 2, 4, 4, 8, 16, 3, 6, 64, 128, 128, 256, 256, 512, 1024 can greatly improve the conversion speed when converting some special numbers, such as the number 65. It can be converted like this: the binary form corresponding to 65 = 64 + 1 64 is 1000000 1 and the binary form corresponding to 65 is 1000001. This is only suitable for converting some special numbers, and the adaptability is not as extensive as the method of dividing two to take the remainder.
The general method of decimal decimal conversion is multiplying binary integer, the rule is: multiply the decimal part by two first, then get the integer part of the operation result, and then multiply the decimal part of the result by two again until the decimal part is zero, then take the integer part obtained for the first time as the high place of the binary decimal, and the subsequent integer part as the position is the binary decimal. It should be noted that some decimal decimals can not be accurately expressed in binary, so the conversion can meet a certain precision, which is why the computer's floating-point operation is not accurate.
For example, the steps to convert 0.25 to a binary decimal are as follows: if the integer part 0.25 × 2 = 0.50 × 2 = 1.01, 0.25 to the binary decimal is 0.01. If a decimal number has both integer and decimal parts, it can be converted separately.
1.2.2.2 convert binary to decimal
The method used to convert binary to decimal is the addition of digital multiplying weights. Let's first take the decimal system as an example to illustrate this method, for example, the value of the decimal number 345, the bit weight of 5 is 1, the bit weight of 4 is 10, the bit weight of 3 is 100, then the following expression holds: 345 5 × 1 + 4 × 10 + 3 × 100, this is the principle of digital multiplying weight addition.
In fact, the bit weight of decimal integers is very regular, from right to left, the bit weight of the nth bit is ten (1) square, for example, the bit is 10 (1-1), the ten bit is 10 (2-1), and so on. Then the bit weight law of the binary integer is the same as this, that is, the bit weight of the nth bit from right to left is two (nmur1).
For example, the expression for converting a binary integer 0 to decimal is: [1011] 2 = 1 × 20 + 1 × 21 + 0 × 22 + 1 × 23 = 1 + 2 + 0 + 8x11, but the same method is used for binary decimals, except that the bit weight rule of the binary decimal is that the place weight of the first decimal place after the decimal point is the-1 power of 2, and the second place is the-2 power of 2, and so on.
For example, the expression for converting a binary decimal to a decimal is [0.1101] 2 × 1 × 2-1 + 1 × 2-2 + 0 × 2-3 + 1 × 2-4 = 0.1101 + 0 + 0 + 0.0625 + 0.8125. If the binary contains integers and decimals, convert them separately.
1.2.3 conversion between binary and octal and hexadecimal
Although binary is the internal data expression of the computer, the number is relatively long because the binary base is too small. In order to simplify the writing of numbers, octal and hexadecimal are created. Octal and hexadecimal are the simplification of binary, so the conversion from binary to octal and hexadecimal is very simple.
The method of converting binary integers to octal is "three digits together", that is, starting from the right, every three binary digits are converted to one octal digit, and so on, because the binary three digits can express an interval of 000-111, which coincides with 0-7. For example, if the binary 10111 is converted to octal, the last three digits are converted to 7, and the previous number 10 is converted to 2, the octal number obtained after conversion is 27. The method of converting binary integers to hexadecimal is "four digits together". For example, if 10111 is converted to hexadecimal, 0111 is converted to 7, and 1 is converted to 1, then the converted hexadecimal number is 17. 7. The method of converting binary decimal to octal is also "three digits together", but the conversion starts from the high position of the decimal, that is, the left side of the decimal. For example, if 0.10111 is converted to octal and converted from 101to 5110 to 6, the resulting octal decimal is 0. 56. It should be noted that if the decimal is less than three digits at last, it must be converted after the subsequent zero filling.
The method of converting binary decimal to hexadecimal is also "four digits together", but the conversion starts from the high position of the decimal. For example, if binary decimal 0.10111 is converted to hexadecimal decimal, and 1011 is converted to bPower1000 to 8, then the converted hexadecimal is 0.b8. If a binary number contains integers and decimals, it is converted separately.
Thank you for your reading. the above is the content of "what is the basic concept and binary concept of computer software". After the study of this article, I believe you have a deeper understanding of what the basic concept and binary concept of computer software is, and the specific use still needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.