28.06.2014 Views

Number Systems Humans use the decimal number system to ...

Number Systems Humans use the decimal number system to ...

Number Systems Humans use the decimal number system to ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6<br />

Is <strong>the</strong>re a 4 contained in 6? Yes, so write 1 under 8 and subtract 4 from 6:<br />

6 64 32 16 8 4 2 1<br />

- 4 1 0 0 1 1<br />

-------<br />

2<br />

Is <strong>the</strong>re a 2 contained in 2? Yes, so write 1 under 2 and subtract 2 from 2:<br />

2 64 32 16 8 4 2 1<br />

- 2 1 0 0 1 1 1<br />

-------<br />

0<br />

This yields 0, so we are done. However, <strong>the</strong>re is a power of two with no <strong>number</strong> under it. Finish<br />

by writing a 0 under each of <strong>the</strong> remaining powers of 2:<br />

64 32 16 8 4 2 1<br />

1 0 0 1 1 1 0<br />

The <strong>number</strong> 78 in <strong>decimal</strong> is 1001110 in binary. We can check it by summing <strong>the</strong> <strong>number</strong>s with<br />

1's under <strong>the</strong>m: 64+8+4+2 = 78.<br />

Ano<strong>the</strong>r Method of Decimal <strong>to</strong> Binary Conversion<br />

Although <strong>the</strong> previous method is quite simple, <strong>the</strong>re is ano<strong>the</strong>r algorithm that some<br />

people prefer. This algorithm follows:<br />

1. divide <strong>the</strong> <strong>number</strong> by 2 and write down <strong>the</strong> remainder, which must be 0 or 1.<br />

2. divide <strong>the</strong> quotient by 2 and write down <strong>the</strong> remainder <strong>to</strong> <strong>the</strong> left of <strong>the</strong> previous<br />

remainder.<br />

3. repeat this process until <strong>the</strong> result of <strong>the</strong> division is 0.<br />

As an example, let's convert 19 from <strong>decimal</strong> <strong>to</strong> binary:<br />

2 | 19<br />

9 rem 1 1<br />

2 | 9<br />

4 rem 1 11<br />

2 | 4<br />

2 rem 0 011<br />

2 | 2<br />

1 rem 0 0011<br />

2 | 1<br />

0 rem 1 10011<br />

19 in <strong>decimal</strong> is 10011 in binary. To check <strong>the</strong> result, add up <strong>the</strong> positions: 16+2+1 = 19.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!