# Octal to binary

Source: Internet
Author: User

Bit, also known as bit

Byte 1B = 8B minimum unit of memory storage

Length: The number of binary digits that can be processed by a computer within the same time period.

The word length determines the computing precision of the computer. The longer the word length, the higher the computing precision of the computer. Therefore, high-performance computers have long characters,

For computers with poor performance, the word length is relatively shorter.
Secondly, the word length determines the direct addressing capability of commands. Generally, the font length of a machine is 1, 2, 4, or 8 times that of a byte. The word length of a microcomputer is 8-bit and 16-bit.

, 32-bit, 64-bit, for example, 286 machines are 16-bit machines, 386 and 486 are 32-bit machines, and the latest piII is a 64-bit high-end machine.
The word length also affects the operation speed of the machine. The longer the word length, the faster the operation speed.
Word: is the basic unit for processing data or information in a computer. A word consists of several bytes. It is usually a word that is grouped into a single digit.

Long.

An octal digit can be expressed by three binary numbers. A hexadecimal number can be expressed by four binary numbers,

The hexadecimal conversion is very simple (001/010/011/100/101/110/111) (0001/0010/0011/0100/0101/0110/0111/1000/

/1001/1010 A/1011b/1100c/1101d/1110e/1111f)

For example, convert (1010111.01101) 2 to the octal number.

1010111.01101 = 001 010 111. 011 010

Too many other users

1 2 7 3 2

So (1010111.011.1) 2 = (127.32) 8

Convert (327.5) 8 to binary

011 010 111. 101

So (327.5) 8 = (11010111.101) 2

Convert (110111101.011101) 2 to hexadecimal number

(110111101.011101) 2 = 0001 1011 1101. 0111 0100

Too many other users

1 B D 7 4

So (110111101.011101) 2 = (1bd. 74) 16

Convert (27.fc) 16 to binary

2. f c

0010 0111 1111 1100

So (27.fc) 16 = (100111.111111) 2

Binary representation

Original code: Each digit represents a symbol.

Negative code: positive number is the same as the original code. Negative number is the opposite of other digits except the symbol.

Complement: the positive number is the same as the original code. The negative number is obtained by the reverse code + 1 except the symbol.

The address bus width determines the physical address space that the CPU can access. Simply put, it means that the CPU can use a large amount of memory.

Eight-bit address bus: an eight-bit binary number can represent up to eight power data of 2, from 00000000 to 11111111, in decimal format: 0-255.

In this example, the maximum address that can be distinguished by an 8-bit address bus is from 0 to 255. We say his addressing capability is 256 bytes, that is, 256 bytes.

20 bits: 1 m

32-bit: 4G

The above is the physical memory that can be accessed by different address bus. Note: During computing, for example, the addressing capability of the 16-bit address bus is not a binary consisting of 16 cores.

The result of the number, but add 1, because there is a 00000000000000000
That is, the 16 power of 2, and the binary number of 16 1 is reduced by 1 to the 16 power of 2

Others:

Convert decimal to binary:
The result is 1 after 2 rounds.
Write the remainder and the last 1 in descending order as the result.
For example, 302
302/2 = 151 + 0
151/2 = 75 + 1
75/2 = 37 + 1
37/2 = 18 + 1
18/2 = 9 + 0
9/2 = 4 + 1
4/2 = 2 + 0
2/2 = 1 + 0
The binary value is 100101110.

Convert binary to decimal
Start from the last digit and column it as 0th, 1, 2...
The number (0 or 1) of the nth digit multiplied by the Npower of 2
Example: 01101011. Convert to decimal:
0th bits: 1 multiplied by 2 to the power of 0 = 1
1 to the power of 2 = 2
0 multiplied by the 2's power = 0
1 multiplied by the power of 2 = 8
0 multiplied by the power of 2 = 0
1 multiplied by the power of 2 = 32
1 multiplied by the power of 2 = 64
0 multiplied by the power of 2 = 0
Then: 1 + 2 + 0
+ 8 + 0 + 32 + 64 + 0 = 107.
Binary 01101011 = decimal 107.

1. Convert binary to decimal
The basic practice of converting a binary number to a decimal number is to write the binary number as the expansion type of the weighting coefficient, and then sum the values according to the decimal addition Rules.

. This method is called "adding weights.

Ii. Convert decimal number to binary number
When converting a decimal number to a binary number, because the integer and decimal number conversion methods are different, the integer and decimal part of the decimal number are first divided

After conversion, merge them.
1. convert a decimal integer to a binary integer
To convert a decimal integer to a binary integer, use the "Division 2 remainder, reverse order" method. The specific method is: remove the decimal integer with 2 to get

The quotient and the remainder. Then, remove the quotient with 2, and then get a quotient and the remainder until the quotient is zero, and then take the first remainder

The lower-level valid bits of the binary number, and the remainder obtained as the upper-level valid bits of the binary number are arranged in sequence.

2. Convert decimal to binary decimal
To convert decimal places into binary decimal places, use the "take 2 as an integer and arrange them in sequence" method. The specific method is to use 2 decimal places to obtain the product

The integer part of the product is taken out, and then 2 is used to multiply the remaining fractional part, and a product is obtained. Then, the integer part of the product is taken out until the product is in progress.

The decimal part of is zero or reaches the required precision.
Then, sort the retrieved integers in order. The first integer is used as the high valid bit of the binary decimal, And the last integer is used as the low valid bit.

Bit.

1. Binary and decimal conversion
(1) binary to decimal <br> method: "sum by right expansion"
Example:
(1011.01) 2 = (1x23 + 0x22 + 1x21 + 1x20 + 0x2-1 + 1X2-2) 10
= (8 + 0 + 2 + 1 + 0 + 0.25) 10
= (11.25) 10
(2) convert decimal to binary

· Convert a decimal integer to a binary number: "divide by 2 to return the remainder, and output in reverse order"
Example: (89) 10 = (1011001) 2
2 89
2 44 ...... 1
2 22 ...... 0
2 11 ...... 0
2 5 ...... 1
2 2 ...... 1
2 1 ...... 0
0 ...... 1
· Decimal to binary: "multiply by 2 to get an integer and output it in sequence"
Example:
(0.625) 10 = (0.101) 2
0.625
X 2
1.25
X 2
0.5
X 2
1.0
2. Conversion between octal and binary
For example, convert 37.416 of octal to binary:
37. 4 1 6
011 111. 100 001 110
That is, (37.416) 8 = (11111.10000111) 2
For example, convert binary 10110.0011 to octal:
0 1 0 1 1 0. 0 0 1 0 0

That is, (10110.011) 2 = (26.14) 8
3. hexadecimal and binary conversion <br> for example, convert hexadecimal number 5df. 9 to binary:
5 d F. 9
0101 1101 1111.1001
That is: (5df. 9) 16 = (10111011111.1001) 2

For example, convert binary 1100001.111 to hexadecimal:
0110 0001. 1110
6. e
That is, (1100001.111) 2 = (61.e) 16

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.