Copyright: This is an original post by the blogger and may not be reproduced without the blogger's permission. https://blog.csdn.net/huyuyang6688/article/details/45267563
The representation of various numerical values in a computer is called machine number, which uses binary numbers to represent data, and the positive and negative signs of the data are also represented by 0 and 1, respectively. To facilitate arithmetic, machine numbers with symbols can be encoded using original code, inverse code, complementary code, shift code, and other encoding methods.
Note: The following rules are all based on machine character length is 8 (i.e., 8 binary bits are used to represent the data) to give an example.
⊙ positive numbers: as follows ① first write the data to be represented, ② write 0 in the sign bit (first bit), ③ fill in with 0 if there is an empty space, e.g. X = 22 = 10110B, then [X] originally = 00010110.