Advantages of the original code: simple and intuitive; For example, we use 8-bit binary to represent a number. The original code of+1 1 is 000010, and the original code of-1 1 is1.
Disadvantages: the original code can't directly participate in the operation, and it may make mistakes. For example, mathematically, 1+(- 1)=0, while in binary, 0000065438+1000001=10000010, which is converted into decimal. There is obviously a mistake.
Therefore, the symbol bits of the original code cannot directly participate in the operation, and must be separated from others, which increases the hardware overhead and complexity.
Specific definitions are divided into decimals and integers:
① Definition of decimal source code
[X] =
X 0≤X < 1
1- X - 1 < X ≤ 0
For example: x =+0.101,[x] original = 0101.
x =-0. 10 1 1[x]Original = 1 10 1。
② Definition of integer source code
[X] Original =
X 0≤X