Number Systems
Way to represent
numbers
Why do we need number systems?
What is a number system?
1. Decimal
2. Binary
3. Hexadecim
al
How many number systems are you aware of?
Number System
Place Value – position of each digit
Base – A number base indicates how many digits/symbols are
there within a numerical system
Decimal Number System
Also called as “Base 10” system
Has 10 symbols
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Each place value is a power of 10. So, moving from right to
left we have the place values as
1000s 100s 10s 1s
For example, in the number 459
The “9” is in the Ones place, meaning 9 ones (9)
The “5” is in the Tens place, meaning 5 tens (50)
The “4” is in the Hundreds place, meaning 4 hundreds
(400)
Ones (1s)
Tens (10s)
Hundreds (100s)
459
100s 10s
1s
10x Bigger
2 1
10 10
0
10
= =
0
10
=
1 0
1
4 5 9
459 = 4 x 102 + 5 x 101 + 9 x 100
342 = 3 x 102 + 4 x 101 + 2 x 100
2071 = 2 x 103 + 0 x 102 + 7 x 101 + 1 x 100
Binary System
Also called as “Base 2” system
Has 2 symbols
0, 1
Each place value is a power of 2. So, moving from right to left
we have the place values as
8s 4s 2s 1s
State of
Power Binary
bulb/led
On 1
Off 0
Ones (1s)
Twos (2s)
Fours (4s)
101
4s 2s 1s
2x Bigger
2 1
2 2
20
= =
=
4 2
1
1 0 1
101 = 1 x 22 + 0 x 21 + 1 x 20
=1x4 + 0x2 + 1x1
= 4+0+1
= 5
1012 = 510
Hexadecimal Number System
Also called as “Base 16” system
Has 16 symbols
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Each place value is a power of 16. So, moving from right to
left we have the place values as
4096s 256s 16s 1s
1 1 1 1 1 1
Decimal 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5
Hexadecim
0 1 2 3 4 5 6 7 8 9 A B C D E F
al
2 1
16 16
0
16
6 = =
25 16
=
1
3 B E
3BE = 3 x 162 + B x 161 + E x 160
= 3 x 256 + B x 16 + E x 1
= 3 x 256 + 11 x 16 + 14 x 1
= 768 + 176 + 14
= 958
3BE16 = 95810
Why do we need Binary
System?
Computer hardware is made up of millions of electric wires or
switches
Each wire is capable of carrying electricity
They understand the presence or absence of
power/voltage/power
The presence of power is represented by 1/on and the absence
of it is represented by 0/off
This on/off state of a single wire is called a bit and it is the
smallest piece of information that a computer can store
Conversion
from one
number system
to another
Binary to Decimal
1011012 = 4510
Convert the binary number 1100 to denary
Step 1:
Draw a table with 4 rows and as many columns as the number
of digits in the given binary number
Step 2:
Fill the first row with digits from the binary number
1 1 0 0
Convert the binary number 1100 to denary
Step 3:
Fill the second row with powers of 2 starting from right
1 1 0 0
23 22 21 20
Step 4:
Fill the third row with decimal equivalent values of the second
row
1 1 0 0
23 22 21 20
8 4 2 1
Convert the binary number 1100 to denary
Step 5:
Fill the last/fourth row with the product of the values from row 1
and row 3
1 1 0 0
23 22 21 20
8 4 2 1
8 4 0 0
Step 6:
Add up all the values from the fourth row. That gives the
decimal equivalent of the binary number
11002 = 1210
Decimal to Binary
Method 1
Method 2
Step 1:
Draw a table with two rows and ‘n’ columns. Choose ‘n’ in such
a way that 2n gives a value greater than or equal to the given
decimal number
Step 2:
Fill the first row with integral powers of 2 (1, 2, 4 8, ….) starting
from right
Step 3:
Compare the decimal number with the value in the first column
of row 1. If it is less put a zero in the first column of the second row
and move to the next column. If it is greater or equal put a 1
subtract the decimal number from the value in the column. Take
the result and repeat the above process with the next column. Do
this till you reach the last column.
Step 4:
Read the values of the second row from left to right. That is the
binary equivalent of the given decimal number
Method 2
(25)
32 16 8 4 2 1
0
25 < 32
Method 2
32 16 8 4 2 1
0 1
25 > 16
25 – 16 = 9
Method 2
32 16 8 4 2 1
0 1 1
9>8
9–8=1
Method 2
32 16 8 4 2 1
0 1 1 0
1<4
Method 2
32 16 8 4 2 1
0 1 1 0 0
1<2
Method 2
32 16 8 4 2 1
0 1 1 0 0 1
2510 = 110012
Hexadecimal to Binary
Convert the hexadecimal number 3C5 to binary
1. Separate the digits of the number
2. Write down the binary equivalent of each digit as a four digit number
3. Join all of them.
3C5
3 C 5
0011 1100 0101
3C516 = 11110001012
Binary to Hexadecima
onvert the binary number 1110110101 to hexadecim
1. Group the digits of the number into 4s
2. Add extra zeroes to the extreme left group if needed
3. Write down the hexadecimal equivalent of each group
1110110101
0011 1011 0101
3 B 5
11101101012 = 3B516
Summary of conversions
Convert a decimal number to an equivalent number of base ‘n’
1. Divide the decimal number with ‘n’ and note the quotient and the
remainder
2. Divide the quotient with ‘n’ and note the remainder
3. Repeat step 2 till the quotient is 0
4. Read all the remainders from bottom to top (last to first). This is the
equivalent of the decimal number in base ‘n’
Convert a number of base ‘n’ to decimal
1. Multiply each digit with integral powers of ‘n’ starting from
right
2. Add all the values
Summary of conversions
Convert an hexadecimal number to binary
1. Write down the binary equivalent of each digit
2. Group the binary digits into four’s
3. Read all the digits from left to right
Convert a binary number to hexadecimal
1. Group the binary digits into four’s
2. Write down the hexadecimal equivalent of each group
3. Read all the values from left to right
List few areas/points where Hexadecimal
Systems are used
Text and numbers can be encoded in a computer as patterns of
binary digits.
Hexadecimal is a shortcut for representing binary.
ASCII and Unicode are important character sets that are used
as standard.
An 8-bit binary number can be written using only two
different hex digits - one hex digit for each nibble (or
group of 4-bits).
It is much easier to write numbers as hex than to write them
as binary numbers.
For example:
11010100 in binary would be D4 in hex
FFFF3 in hex would be 11111111111111110011 in binary
Colours
Hex can be used to represent colours on web pages and image-
editing programs using the format #RRGGBB (RR = reds, GG =
greens, BB = blues).
The # symbol indicates that the number has been written in
hex format.
MAC Addresses
Media Access Control (MAC) address is a number which
uniquely identifies a device on the internet.
e.g. D5-BE-E9-8D-44-9C
Expressing MAC addresses in hexadecimal format makes them
easier to read and work with.
Web Addresses
The URL www.cie.org.uk is represented in hexadecimal as
follows:
%77 %77 %77 %2E %63 %69 %65 %2E %6F %72 %67 %2E %75 %6B
The % symbol indicates that the value is in hexadecimal
Memory Dumps (Errors)
Hexadecimal is often used in error messages on your computer.
The hexadecimal number refers to the memory location of the
error.
This helps programmers to find and then fix problems.
Make a list of the reasons why it is easy to
use Hexadecimal system