Binary data (Part integer) CPU in

1. Expresses its reasons for computer information with a binary number

A computer memory is internal CPU and an IC, which has a plurality of pins. All pins of the IC, a DC voltage of 0V or 5V only two states. In other words, a pin of the IC, can only represent two states. The characteristics of the IC, the computer determines the information data can only be treated with a binary number. The smallest unit of computer processing of information - the bits, the equivalent of one bit in.

For information represented by a binary number, the computer does not distinguish it is the value, text, or some picture mode, but to process the information according to the instructions on the computer writing programs you sent.

2. What is the binary number (slightly)

3. The relationship between shift operations and multiplication and division

It refers to the shift operation of each digit of a binary value for about shifting operation. There are two kinds of shift left and right.

Shift operation of the digital high or low overflow discards it.

4. The "complement" to facilitate computer processing of

4.1 Representation of negative numbers:

In doing subtraction computer, it is actually doing internal adder. By adding to implement subtraction. For this reason, when the negative numbers on the use of the complement of "binary". "Is a positive complement to represent negative numbers.

In order to obtain complement, we need to value each digit binary number of all negated, then the result plus one. The principle is: "the value of the binary number Negated result of adding 1, and the original values ​​are added, the result is 0"

One thing to note: When the calculation result is negative, the value of the calculation results are expressed in terms of the number of complement. This operation example 3-5, 8-bit binary number 00000011 is 3, and 5 = 00000101 negated complement plus 1, i.e. 11,111,011. So in fact, 3-5 operation, the operation result is 11111110 11111011 00000011 +, the highest bit becomes 1. This means that the result is a negative number. So by solving complement complement number, it shows the absolute value of the value. Thus the complement 11111110, adding 1 to the inverted 00000010. This is a decimal number 2. Therefore, representation is 11111110 -2. We get the correct result 3-5.

The difference between the logical and arithmetic shift right of the right

Arithmetic right shift: the binary value as a signed operation when, after the shift to be filled before the values ​​of the sign bit (0 or 1) which is displaced in the highest bit arithmetic right shift.

Only displacement must distinguish between logical and arithmetic shift only when the right. When left, regardless of when the graphics mode (logical shift left), or multiplication (logical shift right), need only fill in the vacated 0 to low.

The following describes the following way sign extension. Example 8-bit binary number, sign extension refers to binary values ​​remain unchanged under the premise converts it into 16-bit and 32-bit. When you convert this 01111111 positive 8-bit binary number into a 16-bit binary number, it is easy to come to this 0000000001111111 correct results, but this value using 11111111 as complement to represent, and how to deal with the squatters? In fact it is expressed as 1111111111111111 on it. In other words, regardless of the positive or negative indicated by complement, they are simply the value of the sign bit (0 or 1) can be used to fill high. This is the sign extension method.

6. logic operation

Logical operation means operation on 0 and 1 binary number of each digit is processed separately, including logic NOT (the NOT operation), a logical product (AND operation), the logical OR (OR operation) and exclusive OR (XOR operation) of tetrakis species.

For logic operations, we need a grasp of the whole:

Logical NOT: all bits are negated operation

Logic and: is the part becomes 0 (reset to 0) of the operation

Or logic: 1 is a partially changed (reset to 1) operation

Logical XOR: is a part of inversion (the same take 0, 1 take different) operating

Guess you like

Origin www.cnblogs.com/mylearning-log/p/10936452.html