NUMBER SYSTEMS
NUMBER SYSTEM
BASE NO. 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 NAME Binary Ternary Quarternary Quinnary Senary Septary Octal Nonary Decimal Undinary Duadenary Trendary Quadtrodenary Quindenary Hexadecimal
COUNTING NUMBER SYSTEM
Binary 0000 0001 0010 0011 0100 0101 Octal 0 1 2 3 4 5 Hexadecimal 00 1 2 3 4 5 Decimal 0 1 2 3 4 5
0110
0111 1000 1001 1010 1011 1100 1101 1110 1111
6
7 10 11 12 13 14 15 16 17
6
7 8 9 A B C D E F
6
7 8 9 10 11 12 13 14 15
Number Systems
Decimal, Binary, Octal and Hexadecimal Numeric Systems.
Conversions among the different systems
Decimal Numbering systems
Base: 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Example: 523410
103 = 1000 100 5
102 = 100 = 2 3
101 = 10 1 4
5,234 = 5 x 1000 + 2 x 100 + 3 x 10 + 4 x 1
Base: 2 Digits: 0, 1 binary number:
Binary Numbering systems
1101012
positional powers of 2: 25 24 23 22 21 20 decimal positional value: 32 16 8 4 2 1 binary number: 1 1 0 1 0 1
Binary to Decimal Conversion
To convert to base 10, add all the values where a one digit occurs. Ex: 1101012
positional powers of 2: 25 24 23 22 21 20 decimal positional value: 32 16 8 4 2 1 binary number: 1 1 0 1 0 1 32 + 16 + 4 + 1 = 5310
Ex:
1010112
positional powers of 2: 25 24 23 22 21 20 decimal positional value: binary number:
Ex:
1010112 25 24 23 22 21
positional powers of 2: 20
decimal positional value: 32 16
2 1
binary number:
32 + 8 +
1
2 +
1 1
1 = 4310
The Division Method.
reach zero, remainders
Ex 1:
5610
Divide by 2 until you and then collect the in reverse.
1110002
2 ) 56 Rem: 2 ) 28 0 2 ) 14 0 2) 7 0 2) 3 1 2) 1 1 0 1
Ex: Find the binary ASCII and decimal ASCII values for the & character.
Rightmost Four Bits 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 000 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI 001 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US Leftmost Three Bits 010 011 100 Space 0 @ ! 1 A " 2 B # 3 C $ 4 D % 5 E & 6 F ' 7 G ( 8 H ) 9 I * : J + ; K , < L = M . > N / ? O 101 P Q R S T U V W X Y Z [ \ ] ^ _ 110 ` a b c d e f g h I j k l m n o 111 p q r s t u v w x y z { | } ~ DEL
Character Representation
From the chart: & = 0100110
Character Representation ASCII Table
(binary ASCII value)
Convert the binary value to decimal: 01001102 = 32 + 4 + 2 = 3810 Therefore: & = 38
(decimal ASCII value)
Octal Numbering systems
Base: 8 Digits: 0, 1, 2, 3, 4, 5, 6, 7 Octal number: 12468
powers of : 84 83 82 81 80 decimal value: 4096 512 64 8 1 Octal number: 1 2 4
Octal to Decimal Conversion
To convert to base 10, beginning with the rightmost digit multiply each nth digit by 8(n-1), and add all of the results together.
Ex:
12468
81 80 8 1 4 6 67810
positional powers of 8: 8 3 82 decimal positional value: 512 64 Octal number: 1 2 512 + 128 + 32 + 6 =
Ex:
103528
83 80 value: number: 84
positional powers of 8: 82 81 decimal positional Octal
The Division Method. Divide by 8 until
you reach zero, and then collect the remainders in reverse. Ex 1: 433010 = 103528
8 ) 4330 8) 8) 8) 8) 0 Rem: 541 2 67 8 1 1
5 3 0
Hexadecimal Numbering systems
Base: 16 Digits: 0, 1, 2, 3, 4, 5, 6, 7,8,9,A,B,C,D,E,F Hexadecimal number: 1F416 powers of : 164 163 162 161 160 decimal value: 65536 4096 256 16 1 Hexadecimal number: 1 F 4
To convert to base 10, beginning with the rightmost digit multiply each nth digit by 16(n-1), and add all of the results together.
Hexa to Decimal Conversion
Ex:
1F416
positional powers of 16: 163 162 161 160 decimal positional value: 4096 256 16 1 Hexadecimal number: 1 F 4 256 + 240 + 4 = 50010
Ex:
7E16
163 162 160 value:
positional powers of 16: 161 decimal positional Hexa number:
The Division Method. Divide by 16 until you reach zero, and then collect the remainders in reverse. Ex 1: 12610 = 7E16
16) 126 16) 7 0 Rem: 14=E 7
Binary to Octal Conversion
Since the maximum value represented in 3 bit is equal to: 23 1 = 7
i.e. using 3 bits we can represent values from 0 7 which are the digits of the Octal numbering system.
Thus, three binary digits can be converted to one octal digit and visa versa.
Ex Convert 7 4 2
:
7428 =
2
= = =
111 100 010
7428 = 111 100 0102
Ex Convert
: 101001102 =
8
110 100 010
= =
= 2
6 4
( pad empty digits with 0)
101001102 = 2468
Ex Convert 0110 1010
:
101001102 =
16
= =
6 A
101001102 = A616
To convert between Octal to Hexadecimal numbering systems and visa versa convert from one system to binary first then convert from binary to the new numbering system
Ex
Convert E8A16 1110 1000 111 010 001 010 bits) =
:
8
10102 (group by 3
7
E8A16
2
=
2
72178
Ex
Convert 111 7528 101 = 0102 0001 1 7528 (group 1110 E = 1010 A by 4
:
16
bits)
1EA16