Course : Introduction to Computing
Module No. : 2 (Concept of Computer System)
Title : C. The Number System
Objectives :
NUMBER SYSTEM
When we type some letters or words, the computer translates them in numbers as computers
can understand only numbers. A computer can understand the positional number system
where there are only a few symbols called digits and these symbols represent different values
depending on the position they occupy in the number.
The value of each digit in a number can be determined using −
● The digit
● The position of the digit in the number
● The base of the number system (where the base is defined as the total number of digits
available in the number system)
Computer architecture supports following number systems.
● Binary number system
● Octal number system
● Decimal number system
● Hexadecimal (hex) number system
Binary Number System
A Binary number system has only two digits that are 0 and 1. Every number (value) represents
with 0 and 1 in this number system. The base of binary number system is 2, because it has only
two digits.
1
Octal Number System
Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with
0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has
only 8 digits.
Decimal Number System
Decimal number system has only ten (10) digits from 0 to 9. Every number (value) represents
with 0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number system is 10,
because it has only 10 digits.
Hexadecimal Number System
A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F.
Every number (value) represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number
system. The base of hexadecimal number system is 16, because it has 16 alphanumeric values.
Here A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
Table 1 is the Number system with base, used digits, and representation.
Table 1.
Number system Base Used digits Example
Binary 2 0,1 (11110000)2
Octal 8 0,1,2,3,4,5,6,7 (360)8
Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9, (F0)16
A,B,C,D,E,F
Number System Conversion
There are three types of conversion:
1. Decimal Number System to Other Base
2. Other Base to Decimal Number System
3. Other Base to Other Base
Decimal Number System to Other Base
Step 1: Divide the decimal number to be converted by the value of the new base.
2
Step 2: Get the remainder from Step 1 as the rightmost digit (least significant digit) of the
new base number.
Step 3: Divide the quotient of the previous divide by the new base.
Step 4: Record the remainder from Step 3 as the next digit (to the left) of the new base
number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes
zero in Step 3.
The last remainder thus obtained will be the Most Significant Digit (MSD) of the new
base number.
Decimal to Binary Conversion Result
Decimal Number is : (12345)10 Binary Number is
(11000000111001)2
Decimal to Octal Conversion Result
3
Decimal Number is : (12345)10 Octal Number is
(30071)8
Decimal to Hexadecimal Conversion Result
Example 1 Hexadecimal Number is
Decimal Number is : (12345)10 (3039)16
Example 2 Hexadecimal Number is
Decimal Number is : (725)10 (2D5)16
Convert
10, 11, 12, 13, 14, 15
to its equivalent...
A, B, C, D, E, F
As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order
so that the first remainder becomes the Least Significant Digit (LSD) and the last
remainder becomes the Most Significant Digit (MSD).
Other Base System to Decimal System
Step 1: Determine the column (positional) value of each digit (this depends on the
position of the digits and the base of the number system).
Step 2: Multiply the obtained column values (in Step 1) by the digits in the corresponding
columns.
Step 3: Sum the products calculated in Step 2. The total is the equivalent value in
decimal.
4
Example:
Binary Number: 111012
Calculating Decimal Equivalent −
Step Binary Number Decimal Number
Step 1 111012 ((1 x 24) + (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10
Step 2 111012 (16 + 8 + 4 + 0 + 1)10
Step 3 111012 2910
Note: Binary Number : 111012 = Decimal Number : 2910
Other Base System to Non-Decimal System
Step 1: Convert the original number to a decimal number (base 10).
Step 2: Convert the decimal number to obtain the new base number.
Example
Octal Number : 258
Calculating Binary Equivalent −
Step 1 - Convert to Decimal
Step Octal Number Decimal Number
Step 1 258 ((2 x 81) + (5 x 80))10
Step 2 258 (16 + 5)10
Step 3 258 2110
Octal Number : 258 = Decimal Number : 2110
5
Step 2 - Convert Decimal to Binary
Step Operation Result Remainder
Step 1 21 / 2 10 1
Step 2 10 / 2 5 0
Step 3 5/2 2 1
Step 4 2/2 1 0
Step 5 1/2 0 1
Decimal Number : 2110 = Binary Number : 101012
Octal Number : 258 = Binary Number : 101012
Arithmetic Operation
Binary Arithmetic
Binary arithmetic is essential part of all the digital computers and many other digital system.
Binary Addition
It is a key for binary subtraction, multiplication, division. There are four rules of binary addition:
Case A+B Sum Carry
1 0+0 0 0
2 0+1 1 0
3 1+0 1 0
4 1+1 0 1
In fourth case, a binary addition is creating a sum of 1 + 1 = 10 i.e. 0 is written in the given
column and a carry of 1 over to the next column.
6
Example − Addition
IP ADDRESSES Expressed in BINARY
An IP address, or simply an "IP," is a unique address that identifies a device on the Internet or a
local network. It allows a system to be recognized by other systems connected via the Internet
protocol. There are two primary types of IP address formats used today — IPv4 and IPv6.
Binary numbering system consists of the numbers 0 and 1 called bits.
IPv4 addresses are:
- expressed in 32 binary bits divided into 4 8-bit octets.
- expressed in dotted decimal notation
7
Binary to Decimal Conversion
To convert a binary IPv4 address to decimal enter the 8-bit binary number of each octet under
the positional value of row 1 and then calculate to produce the decimal.
REFERENCES:
https://www.it.iitb.ac.in/~vijaya/ssrvm/dokuwiki/media/cm7_l8_4nov.pdf
https://www.g2.com/articles/history-of-computers
A Complete History of Computers: From the 1800s to Now by Mara Calvello (July 8, 2019)
https://www.technologyreview.com/2019/01/29/66141/what-is-quantum-computing/
https://www.livescience.com/20718-computer-history.html
https://techterms.com/definition/ip_address
http://vapenik.s.cnl.sk/pcsiete/CCNA1/07_IP_Addressing.pdf
https://www.coursehero.com/file/12298609/IP-Worksheet-2/
https://www.ripe.net/support/training/material/basic-ipv6-training-course/basicipv6-exercises-sol
utions-notation.pdf