1. hexadecimal representation and conversion
Ii. machine code
When a computer performs operations on data, It encodes the symbol bit and value bit to indicate the corresponding number of methods, such as the original code, complement code, anti-code, and transfer code, the following table summarizes this.
2. Check the code
For various reasons, computers often encounter errors when processing information. To avoid such errors, add some check bits on each word to determine the wrong position in the word. You can use the following methods:
1. Check the error code
① Even verification code and odd Verification Code
An error is detected and cannot be located.
Example:
Assume that the first digit is the check bit, and the other 8 digits are the data bit. The list below shows that the value of the check bit is 0 or 1, which is determined by the number of 1 in the Data bit.
2. Error Correction Code
1. Arithmetic Operation
MoD 2 addition: bitwise addition without considering carry: 0 + 0 = + 1 = + 0 = + 1 = + 1 = 0, for example:
Modulo-two subtraction: bitwise subtraction without considering the bitwise; 0-0 =-1 =-0 =-1 = 0, for example:
The result of mod-2 Subtraction is the same as that of mod-2 addition. You can use mod-2 addition instead of mod-2 subtraction.
MoD 2 multiplication: calculates the sum of partial products by adding touch 2 without considering carry. For example:
Modulo Division:
② Cyclic Verification Code
A round robin code is a verification code that establishes encoding rules based on mod 2 operations. It can establish the agreed relationship between valid information and check bit through mod 2 operation, that is, the requirement:
Remove with a polynomial g (x). Generally, a quotient Q (x) and remainder R (x) are obtained ):
M (x) = Q (x) × G (x) + R (X)
M (x)-R (x) = Q (x) × G (x)
M (x) minus the remainder R (x) will be able to divide g (x. Therefore, we can imagine that M (x)-R (x) can be sent to the target component as a compiled verification code. When the verification code is not obtained from the target, the agreed polynomial g (x) can still be removed, if the remainder is 0, it indicates that the verification code is correct. If the remainder is not 0, it indicates that there is an error. Then, it is determined by the remainder to determine which digit has an error.
For example:Perform cyclic verification code for four-digit valid information 1010, and select the generated polynomial g (x) = 1011.
I. Let M (x) = 1010, move M (X) to the left to assemble the r remainder. Because g (x) = 1011 has four digits, r = 3. (The Division is four digits, and the remainder is three digits at most ).
M (x) x X3 = 1010000
Ii. Use the generated polynomial g (x) pairsM (x) x X3Modulo Division 2:
Iii. Apply the valid information to be compiled after the Left shift r = 3 digits to the remainder R (x) as the modulo 2 plus to form a cyclic verification code:
M (x) x X3+ R (x) = 1010000 + 011 = 1010011
③ Haiming Verification Code
The Haiming checksum is a multi-parity code that uses the information to be encoded in a logical form to detect and correct errors. All the transmitted tokens used in the Haiming code are composed of the original information and the added parity bit. Each such parity bit is programmed at a specific location where the code word is transmitted. When appropriate, the system can separate the wrong digit from the original information bit or the checkpoint.
The procedure is as follows:
I saw a blog and thought it was good. I posted it here first. Http://blog.csdn.net/tms_li/article/details/6258788