12.07.2015 Views

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix 1Decim<strong>al</strong>, Hex, andBinaryWe are assuming that you have read the discussion of binary and hexadecim<strong>al</strong>in Chapter 2, and that you have a reasonable grasp of that materi<strong>al</strong>.In this section we will delve deeper into the structure of the three systemsof numeration in order to give you the background needed to understandthe techniques needed to transform the numbers used by your Apple II.For instance, why is the decim<strong>al</strong> fo rm of an address found from the hexform by taking 256 times the decim<strong>al</strong> v<strong>al</strong>ue of the hi-byte plus the decim<strong>al</strong>v<strong>al</strong>ue of the lo-byte? And how can anybody say that 384©© is equ iv<strong>al</strong>ent to-271 36??! All of this will be explained ... and more. But fi rst we are going toacquire some background which sounds, and is, distressingly like the NewMath.Positions, EveryoneWhen you were just a young sprout, your teachers probably explained toyou the significance of a digit's position within a number. Five does not<strong>al</strong>ways mean five; the five in 56 indicates fifty, but more precisely, fiv<strong>et</strong>ens. In 567, the 5 represents five hundreds, and in 5,678 it represents fiv<strong>et</strong>housands. The position of the digit within the number is significant. Fromright to left, you have the unit's place, the ten's place, hundred's place,and so forth. So 5,678 can be written as(5 x 1©3) + (6 x 1©2) + (7 x 1©1) + (8 x 1©0)which is(5 x 1 ©©©) + (6 x 1 ©©) + (7 x 1 ©) + (8 x 1)Many of us unfo rtunates spent hours of our young lives writing numbersthat way, c<strong>al</strong>led "expanded fo rm," for no apparent reason.There is little or no use in writing decim<strong>al</strong> numbers in that fo rm, but yourfourth grade teacher (Miss Whitherstare, or whoever) did you an inadvertentfavor by making you learn it, fo r expanded form is one way to convertnumbers from other outlandish bases, like binary and hex, to decim<strong>al</strong>. Toconvert a long hex number, like $89AB, to decim<strong>al</strong>, write it as(8 x 163) + (9 x 162) + (A x 161) + (B x 16°)165

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

Saved successfully!

Ooh no, something went wrong!