Representation and processing of information
First, information storage
①3: Unsigned code, complement code, floating-point number encoding.
② binary, octal, hexadecimal conversion
③: The word length is W, the virtual address range is 0~2^w-1, and the program accesses up to 2^w bytes.
Data size: (short, long) int, char, long long, float, double
④ Addressing and byte order:
Small End method: least significant byte in front of the way (most Intel compatible machines)
Big-endian: The most significant byte in the front-most way (most IBM and Sun Microsystems)
Two-terminal method: One can be set.
⑤ string (ASCII code)
⑥ Boolean algebra: With &, or |, non-, XOR, or ^
Bit-level operations
⑦ logical Operations:&& and | | (Non-zero is true,0 to false)
⑧ shift Operations:<<, >>
Java: << , >> , <<< , >>>
Second, integer representation
①char, short, int, long
range of values:
In a typical range of values, the range of values is asymmetric-the range of negative numbers is 1 larger than the range of integers.
The C language standard defines that each data type must be able to represent the smallest range of values in which the range of positive and negative values is symmetric.
② unsigned number, signed number of complement code
③ truncation Number: for unsigned numbers, it is equivalent to the K power of MoD 2, and for signed numbers, it is first truncated by unsigned number and then converted to signed number.
Three, integer arithmetic
The integer operation is more precise, but it is easy to overflow when the signed number operation, resulting in an error in the computed value.
integer addition: Forming a commutative group (abelian group ... ), modulo operations
Easy overflow, but satisfies the binding law, the Exchange law, the distribution law, can carry on the optimization computation
Four, floating point number
Floating-point arithmetic does not overflow, but the result of calculation is a approximate range, not very accurate, different calculation process will have different calculated values.
① binary decimals: Weight 2^ (-W) (W is the number to the right of the decimal point)
②ieee floating point representation: symbol, MANTISSA, order code
Normalized values, non-normalized values, special values
③ floating-Point arithmetic: addition: does not have the binding law, satisfies the monotonicity
Floating-point numbers for ④c languages: float, double
Problems encountered:
There are some areas where the overflow is not clear.
Do not know abelian group is the Exchange group, forgotten the concept of exchange group and nature, through Baidu re-familiar with the previous knowledge.
The operator is not familiar with the formula, do not know whether the need for memory, hope that in the future with the cooked can be written down.
Information Security System Design basics 4th Week study notes