CC 113 A The Computer Number Systems
CC 113 A The Computer Number Systems
Wise men said that knowledge can only become power when it is applied. I strongly agree. So
here is now the reason:
Computers and networking equipment such as routers and switches work with binary digits
(bits). In other words, the base 2 number system (binary number system) is what the computers
and data communication devices are using for its design, implementation, and operation. Bits can
be either a binary 1 or binary 0 that can represent as the absence (0) or presence (1) of current
which flows within a cable, wire or circuitry in the computer system. In switching system
application, 1 can be an ON state, while 0 can be an OFF state. In writing the programming
logic or algorithm, 1 can be interpreted as True or Yes, while 0 can be interpreted as False or
No.
The bits are encoded internally in the computer system and on networking media (cables or
wires) as either electrical voltage on copper cable such as unshielded twisted pair (UTP) cable or
a light pulses on fiber optic cable and electromagnetic waves in the wireless communication.
Now let us consider the application of these number systems to the Internet technology. We, the
human beings are more comfortable working with decimal numbers, therefore, Internet
Protocol (IP) addresses are usually written as dotted-decimal numbers separated by periods
(dots), each representing an octet, so that we can read them easily. This is referred to as “dotted
decimal notation”. This is in IP version 4 (IPv4) of the Internet Protocol which uses the 32-bit
address scheme (divided into 4 octets) to identify a particular network and a host on the
network.
Knowing and learning binary numbers and how they relate to decimal and hexadecimal numbers
are critical to understanding successfully the network routing, IP addresses, subnets, and
computer circuitry. Not to mention on becoming a successful network administrator or network
engineer someday. Who knows?
Page 1 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
Binary is a base 2 number system while the decimal is a base 10 number system.
The base 2 number system is what all computers and data communications used to communicate
and process data. Binary numbers are the key to understanding how router works and how
packets get from one workstation (host) to another on a Transport Control Protocol/Internet
Protocol (TCP/IP) network.
Examples:
1.) 7642 = 7 x 103 + 6 x 102 + 4 x 101 + 2 x 100
= 7 x 1000 + 6 x 100 + 4 x 10 + 2 x 1
= 7000 + 600 + 40 + 2
= 7642
Examples:
1.) 102 = 1 x 21 + 0 x 20
=2+0
= 210
2.) 1102 = 1 x 22 + 1 x 21 + 0 x 20
=4+2+0
= 610
3.) 11112 = 1 x 23 + 1 x 22 + 1 x 21 + 1 x 20
=8+4+2+1
= 1510
Page 2 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
= 11102
= 10012
3.)12010 = 120/2 60 0
= 60/2 30 0
= 30/2 15 0
= 15/2 7 1
= 7/2 3 1
= 3/2 1 1
= ½ 0 1
= 11110002
Page 3 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
Examples:
Divide Quotient Remainder
1.) 1010 = 10/8 1 2
= 1/8 0 1
= 128
2.) 13610 = 136/8 17 0
= 17/8 2 1
= 2/8 0 2
= 2108
3.) 149010 = 1490/8 186 2
= 186/8 23 2
= 23/8 2 7
= 2/8 0 2
= 27228
Examples:
1.) 148 = 1 x 81 + 4 x 80
=8+4
= 1210
2.) 2308 = 2 x 82 + 3 x 81 + 0 x 80
= 128 + 24 + 0
= 15210
3.) 68 = 6 x 80
= 610
Page 4 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
Other Solution
We can solve this octal to binary conversion by using the following technique:
4 2 1 The Octal Equivalent
111 The Binary Equivalent
For example, we want to convert an octal number 7 to binary number equivalent. Obviously, we
have the answer: 1 1 1. Now if you try to analyze the process, you could notice that we can easily
get the answer by adding the octal number equivalent at the top of each binary number (4+2+1) .
For example again, we want to convert an octal number 6 to binary number equivalent.
We have the answer: 1 1 0 since we simply add the octal number equivalent of each binary
number (4+2). What if we want to convert an octal number 5 to its binary number equivalent?
Going back to our technique, we have the answer : 1 0 1 since we add the octal number
equivalent above each binary number ( 4 + 1). In other words, when we combine the three octal
numbers (7658), we will arrive to the answer : 1111101012.
Page 5 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
What we did with the excess binary number is to simply make it a zero number.
Can you now solve it by your own?
Other Solution
We can solve this binary to octal conversion by using the following technique:
For example, to convert the binary number to its equivalent octal number we simply group them
into three bits: 4 2 1 / 4 2 1
111/101
By summing up all the octal numbers equivalent at the top of each respective binary 1 we can get
the right answer: 758 (4 + 2 + 1 / 4 + 1).
Another example; to convert the binary number 100110000 to its equivalent octal number, we
group them again into three bits: 4 2 1 / 4 2 1 / 4 2 1
100/110/000
Now summing up all the octal numbers at the top of each respective binary 1, we will arrive to
the answer: 4608 ( 4+0+0 / 4 + 2 + 0 / 0 + 0 + 0 ). We simply didn‟t include in our summation
any octal number equivalent at the top of each respective binary 0.
Examples:
1.) 1110001012 =
1112 = 7
0002 = 0
1012 = 5
= 7058
2.) 110.1112 =
110 = 6
111 = 7
= 6.78
3.) 1002 =
100 = 4
= 48
Page 6 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
In computer networking, Hexadecimal Number System is applied as the physical address of the
LAN-card which is called MAC (Media Access Control) address. In other words, each and
every LAN-card in a computer network has a unique MAC address that is in hexadecimal
format. The new IP address scheme in the Internet is also in hexadecimal format. It is the IPv6
(Internet Protocol version 6). The older IP address is expressed in decimal format. The old IP
address scheme was called IPv4(IP version 4).
With this consideration in mind, our learning experience will never go in vain. These reasons are
the very essence why we study this different number system which the computer is using
extensively. The hexadecimal number system consists of ten numbers: 0 to 9 and six letters.
These six letters: A through F are also considered as numerical values. This is a base 16 number
system. The given table that follows is the comparison between the decimal and hexadecimal
numbers. The letter A in hexadecimal is 10, while B is 11, C is 12, and so on.
Decimal Hexadecimal
Number Number
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F
16 10
17 11
18 12
Page 7 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
19 13
20 14
21 15
22 16
23 17
24 18
25 19
26 1A
27 1B
28 1C
29 1D
30 1E
31 1F
Examples:
Quotient Remainder
1.) 4210 = ?16
42/16 = 2 10 (is A)
2/16 = 0 2
.
. . 4210 = 2A16
338/16 = 21 2
21/16 = 1 5
1/16 = 0 1
.
. . 33810 = 15216
21/16 = 1 5
1/16 = 0 1
.
. . 2110 = 1516
Page 8 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
Examples :
1.) 9B516 = ?10
9B516 = 9 x 162 + 11 x 161 + 5 x 160
= 2304 + 176 + 5
= 248510
2.) F1C16 = 15 x 162 + 1 x 161 + 12 x 160
= 3840 + 16 + 12
= 386010
3.) E816 = 14 x 161 + 8 x 160
= 224 + 8
= 23210
Hexadecimal Binary
Number Digit
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Page 9 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
Examples :
1.) 3BD616 = ?2
3 = 0011
B = 1011
D = 1101
6 = 0110
.
. . 3BD616 = 00111011110101102
2.) 4F.9A16 = ?2
4 = 0100
F = 1111
9 = 1001
A = 1010
.
. . 4F.9A16 = 01001111.100110102
3.) E716 = ?2
E = 1110
7 = 0111
.
. . E716 = 111001112
Other Solutions
We too, can solve this hexadecimal to binary conversion by using the following technique (like
the way we did in octal to binary conversion):
Page 10 of 11
CC113 (A): Introduction to Computing The Computer Number Systems
(from a book of Copernicus P. Pepito)
Examples:
1.) 11110102 = ?16
0111 1010 { We add zero at the left side group }
7 A
.
. . 11110102 = 7A16
Other Solutions
Now this time we reverse the process by converting the binary number into hexadecimal number
equivalent. Again, we can solve this binary to hexadecimal conversion by using the following
technique (like the way we did in hexadecimal to binary conversion):
8 4 2 1 The Hexadecimal Equivalent
1111 The Binary Equivalent
For example, we want to convert 1111 binary number to hexadecimal number equivalent.
Obviously, we have the answer : F. Now if you try to analyze the process, you could notice that
we can easily get the answer by adding the hexadecimal number equivalent at the top of each
binary number (8+4+2+1 = 15(F)) .
For example again, we want to convert a binary number 1011 to hexadecimal number
equivalent. We have the answer: B since we simply add the hexadecimal number equivalent of
each binary number (8+0+2+1). What if we want to convert a binary number 0011 to its
hexadecimal number equivalent? Going back to our technique, we will have the answer : 3 since
we add the hexadecimal number equivalent above each binary number ( 0+0+2+1). In other
words, when we combine the three groups of binary numbers (1111 1011 00112), we will arrive
to the answer : FB316.
What we did with the excess binary number is to simply make it a zero number. Now
solve it by your own?
Page 11 of 11