Computer base 1 (binary conversion)

Encoded information (ASCII) is divided into seven and eight seven priorities were 128,256 exam it is seven of eight.

Space 32

'0' ~ '9'       48~57

'A' ~ 'Z'       65~90

'a' ~ 'z'       97~122

Number (10) + letters (52) + punctuation (33) = 95 (printable)

+33 (control code such as a space) = 128 (unprintable)

 

Hexadecimal conversion 

Binary, octal, hexadecimal, decimal conversion

Binary, octal, hexadecimal to decimal

Binary, octal and hexadecimal to decimal conversion is very easy, is "by adding the right." The so-called "rights", that "right place."

Such as:

55412 octal decimal turn

=2*80+1*81*4*82+5*83+5*84

 

10010 Binary Coded Decimal

=0*20+1*21+0*22+0*23+1*24

 

EA7 hex decimal turn

=7*160+10*161+14*162=3751

Converts a decimal to binary, octal, hexadecimal

Binary decimal converted to other more complex when the integer part and the fractional part of the algorithm is not the same,

A) the integer part

Decimal integer to integer using N-ary "In addition modulo N, reverses the order" process.

2) the fractional part of

Conversion into decimal decimal binary decimal using N 'N by rounding order "process.

 

Turn a decimal octal decimal some examples:

Binary and octal, hexadecimal conversion

In fact, the conversion between any band can use the method mentioned above, but sometimes too much trouble, it is generally different approaches for different band. To convert binary octal and hexadecimal when there is a very simple method, and vice versa.

1) conversion between binary and octal integer integer

As can be seen from the figure, the conversion 1110111100 octal binary integer result of 1674.

2) conversion between binary and hexadecimal integer integer

As can be seen from the figure, binary integer conversion 10110101011100 hexadecimal result of 2D5C.

Guess you like

Origin www.cnblogs.com/ssxblog/p/11260455.html