Basic base record (personal note 3)

base record

1. Basic system record:
1. Decimal: 0-9 //The most commonly used in reality

2. Binary: 0-1 //Everything in the computer is represented in binary

Example: 0b1010 , 0B11101  //Two binary numbers, indicating that 0b or 0B (zero B) should be added in front of the binary number

3. Octal: 0-7

Example: 071, 067, 0112 //Three octal numbers, indicating that 0 (zero) should be added in front of the octal number

4. Hexadecimal: 0-F //hexadecimal number (1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)

Example: 0x1890, 0XAABB //Two hexadecimal numbers, indicating that 0x should be added in front of the hexadecimal number to have 0X (zero X)

Description: The above 0B, 0, and 0X are the symbols represented by hexadecimal, representing binary, octal, and hexadecimal respectively, and are not case-sensitive

5. System conversion:

--Decimal to binary: keep dividing by two and taking the remainder

Example: 65-->1000001

--Binary to decimal: the number of digits is raised and squared

Example: 110-->6 //Zero times two to the zeroth power plus one times two to the power plus one times two to the power

--Binary to octal: divided into three groups from right to left, each group of binary corresponds to the decimal number spelled bit by bit

Example: 10100101001001001-- > 10,100,101,001,001,001-->0245111

--Binary to hexadecimal: four digits are grouped from right to left, and each group of binary corresponding decimal numbers is spelled bit by bit

Example: 10100101001001001 --> 1, 0100, 1010, 0100, 1001 --> 0X14A49

-- Octal to binary and hexadecimal: reverse according to the above rules


2. Basic understanding of computer memory

*-* A binary bit in a computer is a bit, and eight bits form a byte

*-* 1024 bytes are 1k-->1024k is 1M-->1024M is 1G-->1024G is 1T-->1024T is 1P


3. Representation of negative numbers in memory
 //is the representation of a positive number bitwise inversion plus one

Example: byte a=3 byte occupies one byte, write out the memory representation of -3

3: 00000011 //The memory representation of byte type 3

      11111100 //Bitwise negation

                  +1 //add one

——————————————————

      11111101 //-3 representation in memory

 //It can be seen that the sign bit of positive numbers is 0, and the sign bit of negative numbers is 1

         





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325524772&siteId=291194637