1.1 Computer Basics - Binary

Binary

    Computer data different from the data of life of people, people living in decimal number, and the computer used in all binary number, comprising only two numbers 0,1, every binary one, 1 + 1 = 10. A 1 or a 0 per each called a 'bit (bits).
The following look at the conversion calculation between decimal and binary data.


Decimal data into binary data: Use divided by 2 to get the remainder of the way

Method: decimal modulo 2 addition method, i.e., decimal number 2 addition, and the remainder is the number of weights on the bits, the quotient obtained by continuing addition to 2, so step down operation continues until the quotient is zero so far.

For example: the decimal number 150 is converted to a binary number: follows:

 

Binary to decimal data: using the coding method 8421

Methods are: the right to expand by a binary number, that was adding decimal numbers.

 

Guess you like

Origin www.cnblogs.com/huaxiansheng/p/12453100.html