The document provides an overview of various number systems including decimal, binary, octal, and hexadecimal, explaining their bases, digits, and positional value. It also covers methods for converting between these systems and performing arithmetic operations such as addition, subtraction, multiplication, and division in binary, octal, and hexadecimal. Additionally, it includes examples and calculations to illustrate these concepts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
16 views17 pages
952995-Number System (Base System)
The document provides an overview of various number systems including decimal, binary, octal, and hexadecimal, explaining their bases, digits, and positional value. It also covers methods for converting between these systems and performing arithmetic operations such as addition, subtraction, multiplication, and division in binary, octal, and hexadecimal. Additionally, it includes examples and calculations to illustrate these concepts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 17
Digital Number System
A digital system can understand positional number system only where there are a few symbols
called digits and these symbols represent different values depending on the position they occupy in
the number.
A 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 base is defined as the total number of digits
available in the number system).
Decimal Number System
The number system that we use in our day-to-day life is the decimal number system. Decimal
number system has base 10 as it uses 10 digits from 0 to 9. In decimal number system, the
successive positions to the left of the decimal point represents units, tens, hundreds, thousands
and so on.
Each position represents a specific power of the base (10). For example, the decimal number 1234
consists of the digit 4 in the units position, 3 in the tens position, 2 in the hundreds position, and 1
in the thousands position, and its value can be written as,
(1x10) + (2100) + (3x10), + (4x1)
(1x10?) + (2x10?) + (3x1e") + (4x1@%)
1000 + 200 + 30 +1
1234
‘As a computer programmer or an IT professional, you should understand the following number
systems which are frequently used in computers.Number System & Description
Binary Number System
Base 2. Digits used: 0, 4
Octal Number System
Base 8. Digits used: 0 to 7
Hexa Decimal Number System
Base 16. Digits used: 0 to 9, Letters used: A- F
Binary Number System
Characteristics
Uses two digits, 0 and 1.
Also called base 2 number system
Each position in a binary number represents a 0 power of the base (2). Example: 2°
Last position in a binary number represents an x power of the base (2). Example: 2* where
x represents the last position - 1.
Example
Binary Number: 101012
Calculating Decimal Equivalent -
Step _ Binary Number Decimal Number
Step1 101012 (1 x 24) + (0 x 25) + (1 x 22) + (0 x 21) + (1 * 2%))to
Step2 101012 (16 +0+4+0+1)10
Step3 101012 2Ar0
Note: 101012 is normally written as 10101.
Octal Number System
Characteristics
+ Uses eight digits, 0,1,2,3,4,5,6,7.
+ _Also called base 8 number systemEach position in an octal number represents a 0 power of the base (8). Example: 8°
Last position in an octal number represents an x power of the base (8). Example: 8* where
x represents the last position - 1.
Example
Octal Number ~ 125703
Calculating Decimal Equivalent ~
Step Octal Number Decimal Number
Step1 125703 ((1 x 84) + (2 x 8%) + (5 x 82) + (7 x 81) + (0 x 8%))i9
Step 2 125703 (4096 + 1024 + 320 + 56 + 0)10
Step3 12570, 549610
Note: 12570g is normally written as 12570.
Hexadecimal Number System
Charactetistics
Uses 10 digits and 6 letters, 0,1,2,3,4,5,6,7
Letters represents numbers starting from 10. A =
15.
Also called base 16 number system.
Each position in a hexadecimal number represents a 0 power of the base (16). Example
16°.
Last position in a hexadecimal number represents an x power of the base (16). Example
16* where x represents the last position - 1.
Example -
Hexadecimal Number: 19FDE15
Calculating Decimal Equivalent -Step
Step 1
Step 2
Step 3
Step 4
Hexadecimal Number
19FDE 15
19FDE\6
19FDE 16
19FDE 16
Decimal Number
((1 x 164) + (9 x 16°) + (F x 162) + (D x 161) + (E x 16))i9
((1 * 164) + (9 x 169) + (15 * 162) + (13 x 161) + (14 x 16%))10
(65536 + 36864 + 3840 + 208 + 14)i9
10646210
Note ~ 19FDE jg is normally written as 19FDE.Number System Conversion
There are many methods or techniques which can be used to convert numbers from one base to
another. We'll demonstrate here the following -
Decimal to Other Base System
Other Base System to Decimal
Other Base System to Non-Decimal
Shortcut method - Binary to Octal
Shortcut method - Octal to Binary
Shortcut method - Binary to Hexadecimal
Shortcut method - Hexadecimal to Binary
Decimal to Other Base System
Steps
Step 1 - Divide the decimal number to be converted by the value of the new base.
Step 2 ~ Get the remainder from Step 1.as the rightmost digit (least significant digit) of 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.
Example -
Decimal Number: 29;
Calculating Binary Equivalent ~Step Operation Remainder
Step 1
Step 2
Step 3 7/12
Step 4 3/2
Step 5 1/2
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).
Decimal Number ~ 2949 = Binary Number ~ 111012,
Other Base System to Decimal System
Steps
+ Step 1 - Determine the column (positional) value of each digit (this depends on the
position of the digit 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.
Example
Binary Number = 111012
Calculating Decimal Equivalent -
Step _ Binary Number Decimal Number
Step1 111012 (1x 28) # (1% 25) # (1 x 22) + (0x 21) + (1 x 2))10
Step2 111012 (16 +844 +04 1/10
Step3 111012 2910
Binary Number ~ 111012 = Decimal Number - 2949
Other Base System to Non-Decimal SystemSteps
+ Step 4 - Convert the original number to a decimal number (base 10).
+ Step 2 - Convert the decimal number so obtained to the new base number.
Example
Octal Number ~ 25g
Calculating Binary Equivalent -
Step 1 - Convert to Decimal
Step Octal Number Decimal Number
Step1 25g (2 * 81) + (5 * 8%)19
Step2 255 (16 +5 )io
Step3 255 2440
Octal Number = 25g = Decimal Number ~ 2110
Step 2- Convert Decimal to Binary
Step Operation Remainder
Step 1
Step 2
Step3 5/2
Step4 2/2
Step5 1/2
Decimal Number ~ 219 = Binary Number - 101012
Octal Number ~ 25g = Binary Number ~ 101012
Shortcut method - Binary to Octal
Steps
+ Step 4 ~ Divide the binary digits into groups of three (starting from the right).
+ Step 2 - Convert each group of three binary digits to one octal digit.Example
Binary Number ~ 101012
Calculating Octal Equivalent -
Step Binary Number Octal Number
Step 1 101012 010 101
Step2 101019 23 53
Step3 101012 258
Binary Number ~ 101012 = Octal Number ~ 255
Shortcut method - Octal to Binary
Steps
+ Step 1 - Convert each octal digit to a 3 digit binary number (the octal digits may be treated
as decifnal for this conversion).
Step 2 - Combine all the resulting binary groups (of 3 digits each) into a single binary
number.
Example
Octal Number ~ 25g
Calculating Binary Equivalent -
Step Octal Number Binary Number
Step 1 210 510
Step2 25, 0102 1012
Step3 25, 010101,
Octal Number ~ 25g = Binary Number ~ 101012
Shortcut method - Binary to Hexadecimal
Steps
+ Step 4 ~ Divide the binary digits into groups of four (starting from the right).
+ Step 2 - Convert each group of four binary digits to one hexadecimal symbol.Example
Binary Number ~ 101012
Calculating hexadecimal Equivalent -
Step Binary Number Hexadecimal Number
Step 1 101012 0001 0101
Step2 101019 410 510
Step3 101012 1516
Binary Number ~ 10101 = Hexadecimal Number ~ 1515
Shortcut method - Hexadecimal to Binary
Steps
+ Step 1 - Convert each hexadecimal digit to a 4 digit binary number (the hexadecimal digits
may be treated as decimal for this conversion).
Step 2.- Combine all the resulting binary groups (of 4 digits each) into a single binary
number.
Example
Hexadecimal Number ~ 1546
Calculating Binary Equivalent ~
Step Hexadecimal Number Binary Number
Step1 151 140 540
Step2 1515 00012 01012
Step3 1515 000101012
Hexadecimal Number ~ 154g = Binary Number ~ 101012Binary Arithmetic
Binary arithmetic is essential part of all the digital computers and many other digital system.
Binary Addition
Itis a key for binary subtraction, multiplication, division. There are four rules of binary addition.
cary _|
In fourth case, a binary addition is creating a sum of (144 = 10) ie. 0 is written in the given column
and a carry of ‘/over to the next column.
Example ~ Addition
0011010 + 001100 =00i00110 11 carry
0011010 =26%
+0001100 =120
0100110 =38%
Binary Subtraction
Subtraction and Borrow, these two words will be used very frequently for the binary subtraction,
There are four rules of binary subtraction.
Example ~ Subtraction0011010 - 001100 = 00001110 11 borrow
0044010 =26:0
-0001100 =12%
0001110 =140
Binary Multiplication
Binary multiplication is similar to decimal multiplication. It is simpler than decimal multiplication
because only 0s and 1s are involved, There are four rules of binary multiplication
Multiplication
Example - Multiplication
Example:
0011010 x 001100 = 100111000
0011010 =26:
x0001100 =12.
0000000
0000000
0011010
0011010
0100111000 =3120
Binary Division
Binary division is similar to decimal division. It is called as the long division procedure.
Example - Division101010 /000110 = 000111
111
000110 )-01010
-110
xbor
110
110
-110
vOctal Arithmetic
Octal Number System
Following are the characteristics of an octal number system.
Uses eight digits, 0,1,2,3,4,5,6,7.
Also called base 8 number system.
Each position in an octal number represents a 0 power of the base (8). Example: 8°
Last position in an octal number represents an x power of the base (8). Example: 8* where
x represents the last position - 1
Example
Octal Number ~ 125703
Calculating Decimal Equivalent =
Step Octal Number Decimal Number
Step 1 12570, (1 x 84) + (2 x 8%) + (5 x 82) + (7 x 81) + (0 x 8°19
Step2 12570, (4096 + 1024 + 320 + 56 + O)io
Step3 125703 54961
Note - 12570s is normally written as 12570.
Octal Addition
Following octal addition table will help you to handle octal addition.°
Noauswnro
BY Ou aeNe
Bev ounoNn
o{ === o p
To use this table, simply follow the directions used in this example: Add 6s and 5p. Locate 6 in the A
column then locate the 5 in the B column. The point in ‘sum’ area where these two columns
intersect is the 'sum' of two numbers.
6s + 5p = 135.
Example ~ Addition
4562+ 1238 = 6012 11 cany
456 =3020
+123 = 83.0
601 = 385:
Octal Subtraction
The subtraction of octal numbers follows the same rules as the subtraction of numbers in any other
number system. The only variation is in borrowed number. In the decimal system, you borrow a
group of 1040. In the binary system, you borrow a group of 249. In the octal system you borrow a
group of 84.
Example ~ Subtraction
Example:
4563-1738 = 3338Hexadecimal Arithmetic
Hexadecimal Number System
Following are the characteristics of a hexadecimal number system.
Uses 10 digits and 6 letters, 0,1,2,3,4,5,6,7,8,9,A.B,C,D.E,F.
Letters represents numbers starting from 10. A = 10, B = 11, C = 12,D = 13, B= 14, F =
15.
Also called base 16 number system.
Each position in a hexadecimal number represents a 0 power of the base (16). Example -
16°
Last position in a hexadecimal number represents an x power of the base (16). Example -
16* where x represents the last position - 1
Example
Hexadecimal Number - 19FDEys
Calculating Decimal Equivalent ~
Step Hexadecimal Number Decimal Number
Step1 19FDEi6 (1 164) + (9 x 16) + (F x 162) + (D x 161) + (E x 16%))i9
Step2 19FDErg ((1 x 164) + (9 x 169) + (15 x 162) + (13 * 161) + (14 x 16%))10
Step3 19FDE16 (65536 + 36864 + 3840 + 208 + 14)19
Step4 19FDE15 10646210
Note - 19FDE;¢ is normally written as 19FDE.
Hexadecimal Addition
Following hexadecimal addition table will help you greatly to handle Hexadecimal addition.+
EF
F 10
10 11
nu.
1011 12 13
10 1112 13 14
11 1213 14 15,
1011 12 1314 15 16
10 1112 13 1415 16 17
111213 14 1516 17 18
10 11 12 13 14 15 1617 18 19
10 11.12 131415 16 1718 19 1A
10 1112 13 141516 17 18.19 1A 18
10 11 1213 14 15 16 17 18 191A 18 1C
10 1112 131415 16 1718 19 1A1B 1¢ 1D
1112 13 1415 16 17 1819 1A 1B1C 1D 16
mmOOePL@VHHMALN
mMmMOOePoBONaMe
mmOonB>ooraNn
gam won
8 com>
MMOOBD>OMNANEYNHO
TmMoONn@>oeVaurwnro
BTT™MOOB>SeNaGAYNH
To use this table, simply follow the directions used in this example - Add Aye and 546, Locate A in
the X column then locate the 5 in the Y column. The point in ‘sum’ area where these two columns
intersect is the sum of two numbers.
Ais +)5is = Fas-
Example ~ Addition
40616 #48336 = 65935 1 carry
4A6 =1190:0
+1B3 = 435.
659 =1625:0
Hexadecimal Subtraction
The subtraction of hexadecimal numbers follow the same rules as the subtraction of numbers in
any other number system. The only variation is in borrowed number. In the decimal system, you
borrow a group of 1049. In the binary system, you borrow a group of 20. In the hexadecimal system
you borrow a group of 1610.
Example - Subtraction4A6is- 1B3i6 = F316 16 borrow
34A6 =1190:0
1B3 = 435.
2F3 =755i0