
1.2STARLASERPRINTER4 SOFTWARE
1.2.1Binaryand hexadecimalarithmetic
1fyou already know what hexadecimalnumbers are, you can skip this sectionand go aheadto read aboutASCII.
The decimalnumber systemwith which we’re all familiaris a positional counting system. There’s the “ones” position, the “tens” position, the “hundreds”positionandsoon. Eachhigherpositionis worthten timesmore thanthe positionto the rightof it, sincethedecimalsystemusesthe baseof ten. Moreover,we need ten symbolsto showthe actualvaluesthat maybe in each position.
Thebinarysystemis positionaltoo.There’sthe“ones”position,the “twos” position,the“fours”position,the“eights”positionandsoon. In binaryeach positionisworthonlytwicethatofthepositionto its right.Andweonlyneed twosymbols- O(zero)and 1(one)- to showthevaluesthatmaybe in any position.So in binary we get numbersthat look like 1O1Oor 10001100.
The hexadecimalsystemis madeof
We need sixteen different symbols to show all the possible values one hexadecimal digit could have. We can use our decimal system’s ten symbols,but we’vehad to borrowa few more from our alphabetto get all thesymbolsweneed.Inhexadecimal,therefore,youcanhavea numberthat lookslike 2C7C, or even FACE.
Here’showthedecimal,binaryandhexadecimalnumbersystemscompare:
Decimal | Binary | Hexadecimal Decimal | Binary | Hexadecimal | |
o |
| o | 8 | 1000 | 8 |
1 | Ooo1 | 1 | 9 | 1001 | 9 |
2 | 0010 | 2 | 10 | 1010 | A |
3 | 0011 | 3 | 11 | 1o11 | B |
4 | 0100 | 4 | 12 | 11(X) | c |
5 | 0101 | 5 | 13 | 1101 | D |
6 | 0110 | 6 | 14 | 1110 | E |
7 | 0111 | 7 | 15 | 1111 | F |
5