There are tons methods to person decimal figure into the corresponding positional notation. Only one legendary recipe will be discussed here:

Converting quantitative to binary:

The rules are as follows:

*You should initiation from the left most binary digit

*If the quantitative numeral is quits or greater than the point appeal (corresponding 2^number), past stand the bit 1 and transmit the inconsistency to the subsequent whole number on the right

*If the quantitative number is little than the stand efficacy , then stand the bit 0 and headfirst the figure as it is to the next digit on the right

Example:

Suppose you got the decimal numeral 170:

- 170 is greater than 128(2^7) , so the departed most bit is 1 , get the distinction 170-128=42

-forward 42 to the close digit

-42 is smaller number than 64( 2^6), so lay 0 and headfirst the digit as it is (42) to the side by side step

-42 is greater than 32(2^5), so role 1 and pass on the variance which is 42-32=10

-10 is smaller amount than 16(2^4), so leave 0 and send on the 10 as it is

-10 is greater than 8(2^3) so topographic point 1 and transfer the variance which is 10-8=2

-2 is smaller quantity than 4( 2^2) so lay 0 and anterior the 2 as it is

-2 is same 2( 2^1) so situate a 1 and pass on the variance which is 2-2=0

-0 is smaller quantity than 1(2^0) so stand a zilch and you're done

so the quantitative number 170 is equivalent to the binary figure 10101010

NOTE THE FOLLOWING:

*The apt most forte plus is 2^0

*Whenever you get a 0 difference, all the next digits will be o's as nil will be smaller number than 2^whichever number

*Only numbers from 0-255 can be represented by 8 digits binary .Numbers greater than 255 will be painted by much bits. For example: 256 is delineate by 9 digits: 100000000. In overall 2^n -1 gives you the large number that can be diagrammatical by n digits. So in 8 digits binary, max. figure is 2^8 -1= 255. In 9 digits binary, max.number is 2^9-1=511. So the breadth for 9 digits is from 256-511. Starting from 512 ,10 digits will be obligatory.And so on............

Converting positional representation system to decimal:

An model active this was just now shown in the earlier stake.

00010110 = (1 x 24 = 16) (0 x 23 = 0) (1 x 22 = 4) (1 x 21 = 2) (0 x 20 = 0) = 22 (16 0 4 2 0)

This case in point shows that the binary number 00010110 is same to the quantitative amount 22.

In generic , all the 0 bits will add up to nothing , so honourable handle them and add the 1's. Here is another example:

10101010= (1*27=128) (1*25 =32) (1*23 = 8) (1* 21 = 2) = 170

( we've earlier seen that 170 is = 10101010).

Cisco website

Cisco Academy Program

    全站熱搜

    mitbic 發表在 痞客邦 留言(0) 人氣()