the basic hardware system of computer is composed of 5 parts, such as arithmetic, controller, memory, input device and output device. Computer composition principle is the computer's underlying content of learning, learn it, to solve this problem in the future fundamentally very easy to understand, however, in the study of this piece of land encountered a lot about the calculation of the system, processing data back and forth analysis, are quite good. Very interesting. The main calculation of the language inside only 0, 1, sketched out so colorful world, really is too wonderful, let us learn these basic content from there is still an angle to understand the computer. At the same time thinking about the crystallization of human wisdom, the ingenious algorithm, although the introduction of a lot of content is in order to better serve our human life, work, we can combine life to understand it, use it, believe that our impact is not simple is 0, 1, but a lot of other human thinking changes, Create.
Knowledge Overview 1:
host=li_shehe&albumid=224979094&photoid=8813210796 ">
Knowledge Probability 2
easy to mix and error points
representation and coding of numbers in computers--easy to mix and error points
The information in the computer has not only data. There are also characters, commands, and data with large and small, positive and negative points. How a computer uses "0" or "1". To represent this information?
1. Representation of a number in a computer
In the computer, there are only digital 1 and 2 different states, for a number of positive, negative, two different states, the sign of the convention positive numbers with 0, negative sign with 1, the sign bit on the leftmost number. For example: n1=+1011,n2=-1011. Because the MCS-51 is a 8-bit microcontroller. That is, the information is processed in 8-bit units, and each storage unit can only store-a 8-bit binary number, called a byte, it is assumed that a byte (that is, 8-bit binary number) to represent the above two symbols, they can be represented in a single-chip microcomputer: 00001011 and 10001011, The highest level is the symbol value, and the remaining bits are the numeric digits.
A maximum of 0 indicates a positive number, and a maximum bit of 1 indicates a negative number.
Such a computer is used to denote the number of forms called the number of machines. The shouting truth value of the arithmetic value corresponding to the number of the machine.
It is important to note that machine numbers and truth-oriented objects are different. Machine number for computer, truth-oriented user, machine number is different from truth.
But the truth can be represented by the number of machines.
The number of machines is the basic method of representing numbers in a computer, and the number of machines usually has three forms of original code, inverse code and complement.
(1) Original Code representation method
When a 8-bit binary number is used to represent the original code of the number, the highest digit is the symbol bit, and the remaining 7 bits are the numeric digits.
For example: The truth value of +120 and 120 of the original code form
[+120] Original =01111000
[-120] Hara =11111000
For zero, it can be thought that it is positive zero, can also feel that it is negative 0, so the original code of Zero has two representations:
[+0] Original =00000000
[-0] Hara =10000000
The 8-bit binary number source indicates a range of: 11111111~01111111. That is -127~+127.
(2) Anti-code representation method
In the inverse Code representation method, the inverse code of the positive number is the same as the original code. The inverse of a negative number is determined by its corresponding original code except for the sign bit. The rest of you are given a bitwise counter. Like what:
[+120] Anti-=[+120] original =01111000
[-120] anti-=10000111
There are two representations of zero anti-code, namely:
[+0] Anti-=00000000
[-0] anti-=11111111
The 8-bit binary number counter indicates a range of: 10000000~01111111, or -127~+127.
(3) Complement expression method
The concept of complement: first, take the clock to the time as an example. If today's standard time is 5 points, and a table is already 7 points, in order to calibrate the time, can be used in two ways: one is to turn the clock back 2, that is, 7-2=5. One is to dial the hour hand forward 10. That is, 7+10=12 (own active loss) +5, can be aligned to 5 points. Visible, minus 2 and plus 10 are equivalent, we put (+10) is called (-2) to 12 of the complement. 12 is modulo, when the value is greater than modulo 12 o'clock can discard 12.
In a binary digital system with a word length of 8 bits. Model for 28=256, first look at the following example:
01000000 64 01000000 64
+11110110 +246-00001010-10
1 00110110 1 00l10110 54
Thus. In the case of a word length of 8 bits (64-10) is the same as the result (64+246), so (-10) and 246 complement each other.
In the complement notation, the complement of positive numbers is the same as the original code. The complement of a negative number by its corresponding original code in addition to the symbol bit, the rest of you bitwise negation and the last plus one get. Like what:
[+120] complement =[+120] Original =01111000
Now let's take a look at (-10) How the complement 11110110 is calculated.
A positive complement representation method is the same as the original code
The complement method of negative numbers:
1) using anti-code to complement: Anti-code plus 1.
Such as:
[-10] Hara =100010l0
[-10] anti-=11110101
[-10] complement =11110110
2) Use the original code to complement (direct seeking method): Find the original code in the value of the rightmost "1", the "1" and the "1" to the right of you to remain unchanged. and the "1" to the left of you to reverse the position. But the sign bit does not change.
Such as:
[-10] Hara =100010l0
[-10] complement =11110110
By using the complement representation number, the subtraction operation can be converted into an addition operation. In the complement notation, 0 of the complement has only one representation, i.e. [+0] complement =[-0] complement = 00000000. For a eight-bit binary number, the range of the number that the complement can represent is -128~+127.
"Example 1-10" known x=+1010b,y=-1010b, write out their original code, anti-code and complement form.
[+1010B] Original =00001010b [ -1010b] Original =10001010b
[+1010B] Anti-=00001010b [ -1010b] anti-=11110101b
[+1010B] Complement =00001010b [ -1010b] complement =11110110b
These are very easy, mainly test our careful degree, these two days to learn to study the soft test is relaxed. But not lightly. Self-examination is the side of the more than the memory of the knowledge points, and soft test depends on the understanding of the problem, analysis, understanding. Understanding of the problem we should learn from the root, understand, we should be traced.
For the future study is the same, ask more why? Often can receive many other unexpected to persuade oneself of knowledge, that kind of feeling is in the mind very comfortable, very cool, also exciting.
The road of Soft Test (III.)---composition principle