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.

2's. The third column starts with 0 and alternates 0,0,0,0, 1,1,1,1–that is, it alternates by 4's.<br />

Finally, <strong>the</strong> leftmost column starts at 0 and alternates by 8's: 8 zeroes followed by 8 ones. If you<br />

can remember that, you can easily reproduce <strong>the</strong> binary column and <strong>the</strong> entire chart.<br />

Binary <strong>to</strong> Hexa<strong>decimal</strong> Conversion<br />

Now that we've seen all three <strong>number</strong> <strong>system</strong>s, <strong>the</strong>re are two more conversions <strong>to</strong> learn--<br />

binary <strong>to</strong> hex and hex <strong>to</strong> binary--but <strong>the</strong>y will turn out <strong>to</strong> be quite easy with <strong>the</strong> revised chart.<br />

Here is <strong>the</strong> algorithm for converting from binary <strong>to</strong> hexa<strong>decimal</strong>:<br />

1. write down <strong>the</strong> binary <strong>number</strong><br />

2. divide it in<strong>to</strong> groups of 4 digits, starting at <strong>the</strong> RIGHT side<br />

3. look up each group of 4 digits in <strong>the</strong> chart above, and write <strong>the</strong> corresponding hex digit<br />

below <strong>the</strong> group of digits.<br />

Remember that long scary <strong>number</strong> we suggested you memorize? Let's convert it <strong>to</strong> hex:<br />

10101001010001111011110<br />

Divided in<strong>to</strong> groups of 4, it becomes <strong>the</strong> following:<br />

101 0100 1010 0011 1101 1110<br />

Note that <strong>the</strong> reason we start dividing in<strong>to</strong> groups on <strong>the</strong> right is so that if any group<br />

has fewer than 4 digits, that group will be <strong>the</strong> one on <strong>the</strong> left, where we can pad it with<br />

leading zeroes without changing <strong>the</strong> value of <strong>the</strong> <strong>number</strong>.<br />

Now, let's look each group of digits up in <strong>the</strong> chart:<br />

1110 is E, so we write E under 1110:<br />

101 0100 1010 0011 1101 1110<br />

E<br />

1101 is D and 0011 is 3:<br />

101 0100 1010 0011 1101 1110<br />

3 D E<br />

1010 is A and 0100 is 4:<br />

101 0100 1010 0011 1101 1110<br />

4 A 3 D E<br />

Finally, 101 is 5 (it's <strong>the</strong> same as 0101):<br />

101 0100 1010 0011 1101 1110<br />

5 4 A 3 D E<br />

The <strong>number</strong> in hex is 54A3DE. Can you memorize that in 10 seconds? You are a lot more likely<br />

<strong>to</strong> be able <strong>to</strong> memorize 6 hex symbols ra<strong>the</strong>r than 23 bits. That's why computer scientists <strong>use</strong>

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

Saved successfully!

Ooh no, something went wrong!