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.

<strong>number</strong> and write <strong>the</strong> powers of 16 above <strong>the</strong> digits. Note that it is easier <strong>to</strong> write 16 and 1 than<br />

161 and 160, so that's what we'll do from here on:<br />

16 1<br />

A 5<br />

Multiply each digit of <strong>the</strong> <strong>number</strong> by <strong>the</strong> power of 16 above it. Remember <strong>to</strong> convert each digit<br />

A through F <strong>to</strong> its <strong>decimal</strong> equivalent before multiplication. The digit A is 10, and 10 times 16 is<br />

160. Of course, 5 times 1 is 5. Sum <strong>the</strong> results:<br />

A * 16 = 10 * 16 = 160<br />

5 * 1 = 5<br />

-----<br />

165<br />

Notice that <strong>the</strong> final result requires three digits in <strong>decimal</strong> but only two in hex. That's<br />

beca<strong>use</strong> each digit in hex represents one of 16 different values, while in <strong>decimal</strong> each digit<br />

represents only 10 values.<br />

Here's ano<strong>the</strong>r example. Let's convert 1CE from hexa<strong>decimal</strong> <strong>to</strong> <strong>decimal</strong>. First we write<br />

out <strong>the</strong> <strong>number</strong> and write <strong>the</strong> powers of 16 above <strong>the</strong> digits:<br />

256 16 1<br />

1 C E<br />

Multiply each digit of <strong>the</strong> <strong>number</strong> by <strong>the</strong> power of 16 above it. Remember <strong>to</strong> convert each digit<br />

A through F <strong>to</strong> its <strong>decimal</strong> equivalent before multiplication, so that C becomes 12 and E becomes<br />

14. Sum <strong>the</strong> results:<br />

1 * 256 = 256<br />

C * 16 = 12 * 16 = 192<br />

E * 1 = 14 * 1 = 14<br />

------<br />

462<br />

Hexa<strong>decimal</strong> Arithmetic<br />

Hexa<strong>decimal</strong> arithmetic has many more facts that <strong>decimal</strong>. For each operation (addition,<br />

subtraction or multiplication), <strong>the</strong>re are 16*16 facts, but we won't show those here. Some<br />

hexa<strong>decimal</strong> arithmetic may look quite funny, as you add "letters"; for example<br />

A + 1 = B<br />

C + 2 = D<br />

F - 1 = E<br />

F - 5 = A<br />

Some hexa<strong>decimal</strong> arithmetic is just like base 10; that can be misleading, beca<strong>use</strong> <strong>the</strong><br />

arithmetic gets tricky when it produces results that violate our <strong>decimal</strong> experience; for example,<br />

2 + 5 = 7

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

Saved successfully!

Ooh no, something went wrong!