1.2 STARLASERPRINTER4 SOFTWARE
1.2.1 Binaryand hexadecimalarithmetic
1fyou already know what hexadecimalnumbersare, you can skip this
sectionand go aheadto read aboutASCII.
The decimalnumbersystemwithwhich we’reall familiaris a positional
counting system. There’s the “ones” position,the “tens” position, the
“hundreds”positionandsoon. Eachhigherpositionisworthtentimesmore
thanthepositionto therightof it,sincethedecimalsystemusesthe baseof
ten.Moreover,we needten symbolsto showthe actualvaluesthatmaybe
in eachposition.
Thebinarysystemispositionaltoo.There’sthe“ones”position,the“twos”
position,the“fours”position,the“eights”positionandsoon. Inbinaryeach
positionisworthonlytwicethatofthepositiontoitsright.Andweonlyneed
twosymbols- O(zero)and1(one)- toshowthevaluesthatmaybe in any
position.So in binarywegetnumbersthatlooklike 1O1Oor 10001100.
Thehexadecimalsystemis madeofbase-sixteennumbers.Hexadecimalis
positionalliketheothercountingsystems.Andeachhigherpositionisworth
sixteentimesasmuchas the positionto itsright.
We need sixteen differentsymbolsto show all the possiblevalues one
hexadecimaldigit could have. We can use our decimal system’s ten
symbols,but we’vehadto borrowa fewmorefrom ouralphabetto getall
thesymbolsweneed.Inhexadecimal,therefore,youcanhaveanumberthat
lookslike 2C7C,or evenFACE.
Here’showthedecimal,binaryandhexadecimalnumbersystemscompare:
Decimal
o
1
2
3
4
5
6
7
Binary
Ooo1
0010
0011
0100
0101
0110
0111
Hexadecimal
o
1
2
3
4
5
6
7
Decimal
8
9
10
11
12
13
14
15
Binary
1000
1001
1010
1o11
11(X)
1101
1110
1111
Hexadecimal
8
9
A
B
c
D
E
F
5