You are on page 1of 2

Introduction to Number Systems

Number Systems

Four number system Decimal (10) Binary (2) Octal (8) Hexadecimal (16)
Binary numeral system

Humans use the decimal number system to per orm arithmetic operations! "omputers use the binary system to represent numbers internally# $hich contains only t$o di%its& 0 and 1! 'e need a $ay to con(ert numbers rom one system to another! )he smallest unit o stora%e in the computer is the bit# $hich stands or binary di%it! * bit can hold one o t$o (alues# 0 or 1 )he 0 and 1 (alues are o ten interpreted as alse and true# or as an electrical impulse bein% o and on!
The octal numeral system

)he octal numeral system# or oct or short# is the base+8 number system# and uses the di%its 0 to ,! -umerals can be made rom binary numerals by %roupin% consecuti(e binary di%its into %roups o three (startin% rom the ri%ht)! For example# the binary representation or decimal ,. is 1001010# $hich can be %rouped into (00)1 001 010 / so the octal representation is 112!
The Hexadecimal Numeral System

Hexadecimal (also base 16# or hex) is a positional numeral system $ith a radix# or base# o 16! 0t uses sixteen distinct symbols# most o ten the symbols 0+1 to represent (alues 2ero to nine# and *# B# "# D# 3# F (or alternati(ely a throu%h ) to represent (alues ten to i teen! 3ach hexadecimal di%it represents our binary di%its (bits) (also called a 4nibble4)# and the primary use o hexadecimal notation is as a human+ riendly representation o binary coded (alues in computin% and di%ital electronics! For example# byte (alues can ran%e rom 0 to 255 (decimal) but may be more con(eniently represented as t$o hexadecimal di%its in the ran%e 00 throu%h FF! Hexadecimal is also commonly used to represent computer memory addresses!
Decimal numbers

1.61 7 1 x 106 8 )housands Base or 9adix 7 10

. x 102 8 Hundreds

6 x 101 8 )ens

1 x 100 Ones

Decimal to Binary Conversion

)o con(ert inte%er decimals to binary# di(ide the ori%inal number by the lar%est possible po$er o 2 and successi(ely di(ide the remainders by successi(ely smaller po$ers o 2 until the po$er is 1! )he binary representation is ormed by the :uotients# $ritten in the order %enerated by the al%orithm! 16 6 6 1 0
Decimal to Octal

2 2 2 2

1 0 1 1

;east si%ni icant bit <ost si%ni icant bit (16)10 7 (1101)2

)o con(ert inte%er decimals to octal# di(ide the ori%inal number by the lar%est possible po$er o 8 and successi(ely di(ide the remainders by successi(ely smaller po$ers o 8 until the po$er is 1! )he octal representation is ormed by the :uotients# $ritten in the order %enerated by the al%orithm!

15 11 1 0
Decimal to Hexadecimal

8 8 8

, 6 1

;east si%ni icant octal di%it <ost si%ni icant octal di%it (16)10 7 (16,)8

)o con(ert inte%er decimals to hex# di(ide the ori%inal number by the lar%est possible po$er o 16 and successi(ely di(ide the remainders by successi(ely smaller po$ers o 16 until the po$er is 1! )he hexadecimal representation is ormed by the :uotients# $ritten in the order %enerated by the al%orithm! 218 1 11 1 0 (16)10 7 (B*D)16 *710# B711# "712# D716# 371.# F715
Binary to Decimal

1 6 1 6 1 6

1 6 1 0 1 1

;east si%ni icant hex di%it

<ost si%ni icant hex di%it

1101 7 1 x 26 8 1 x 22 8 0 x 21 8 1 x 20 71x881x.80x281x1 788.8081 (1101)2 7 (16)10


Octal to Decimal

7 11 x 256 8 10 x 16 8 16 x 1 7 2816 8 160 8 16 (B*D)16 7 (2181)10 * 7 10# B 7 11# " 7 12# D 7 16# 3 7 1.# F 7 15
Why octal or hex?

16, 7 1 x 82 8 6 x 81 8 , x 80 7 1 x 6. 8 6 x 8 8 , x 1 7 6. 8 2. 8 , (16,)8 7 (15)10 Di%its used in Octal number system = 0 to ,


Hexadecimal to Decimal

3ase o use and con(ersion )hree bits ma>e one octal di%it 111 010 110 101 , 2 6 5 7? ,265 in octal Four bits ma>e one hexadecimal di%it 1110 1011 0101 3 B 5 7? 3B5 in hex

B*D 7 11 x 162 8 10 x 161 8 16 x 160


Unsigned !ddition

Binary *ddition 0101 (5) 8 1001 (1) 1110 (1.) " # $ Binary @ubtraction 1001 (1) + 0101 (5) 0100 (.) % # $ # 0 1 $ 1 1 0 # 0 1 $ 1 1 0

You might also like