Digital computer deals with numbers; it is essential to know what kind of numbers can be handled most easily when using these machines. We accustomed to work primarily with the decimal number system for numerical calculations, but there is some number of systems that are far better suited to the capabilities of digital computers. And there is a number system used to represents numerical data when using the computer.
2. 2
TABLE OF CONTENTS
Cover Page 1
Table of Contents 2
Number Systems 4
Decimal Number System 4
Decimal Integer 4
Decimal Fraction 4
Expanded Notation for Decimal Integers 5
Expanded Notation for Decimal Fractions 5
Data Representation in Digital Computing 5
Binary System 6
Binary Integers 6
Binary Fractions 6
Decimal to Binary Conversion of Integers 7
Binary to Decimal Conversion of Integers 8
Decimal to Binary Conversion of Fractions 9
Non-terminating Conversion of Fractions 10
Decimal to Binary Conversions with Integral and Fractional Parts 11
Binary to Decimal Conversions with Integral and Fractional Parts 12
Binary Arithmetic 12
Binary Addition 12
Binary Subtraction 13
Binary Multiplication 14
3. 3
Binary Division 15
Octal Number System 17
Decimal to Octal Conversion 18
Octal to Decimal Conversion 19
Octal to Binary Conversion 19
Binary to Octal Conversion 20
Hexadecimal Number System 21
Decimal to Hexadecimal Conversion 22
Hexadecimal to Decimal Conversion 23
Hexadecimal to Binary Conversion 23
Binary to Hexadecimal Conversion 24
References 25
4. 4
NUMBER SYSTEM
Digital computer deals with numbers, it is important to know what kind of
numbers can be handled most easily when using these machines. We accustomed to work
primarily with decimal number system for numerical calculations, but there are some
number systems that are far better suited to the capabilities of digital computer. And there
are number system used to represents numerical data when using the computer.
Decimal Number System / Base 10 Number System
- The word “Decimal” comes or derived from the Latin word “Ten”
- The numerals run from 0 to 9 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; these numerals are
called Arabic Numerals
- Base is a number raised to a power
- 10 is the base of the decimal number system
- Radix is the other term for the base of the number system defined as the number
of different digits which can occur in each position in the number system
Note: Power of 10 may be expressed as 100
or 1, 101
or 10, 102
or 100, etc. and this is
called place value. Each digit in decimal number system is called face value.
Example: The digit 3 in the decimal integer 321 has a face value of 3 and place value
of 102
.
Decimal Integer
Decimal Integer is a string of decimal digits.
Example: 1234, 2509, etc.
Decimal Fraction
Decimal Fraction is a string of decimal digits with an embedded decimal point.
Example: 1234.56, 2509.325 etc.
Note: In a decimal fraction, the place values to the right of the decimal are
expressed to the negative powers of 10 such as 10-1
or 1/10 or 0.1, 10-2
or 1/100
or 0.01, etc.
5. 5
Expanded Notation for Decimal Integer
Any decimal integer can be expressed as the sum of each digit times the
power of ten. For example, 2509 can be expressed as
2509 = 2x103
+ 5x102
+ 0x101
+ 9x100
= 2x1000 + 5x100 + 0x10 + 9x1
= 2000 + 500 + 0 + 9
= 250910
Expanded Notation for Decimal Fraction
Any decimal fraction may also be expressed in expanded notation. For
example, 2509.325 can be expressed as
2509.325 = 2x103
+ 5x102
+ 0x101
+ 9x100
+ 3x10-1
+ 2x10-2
+ 5x10-3
= 2x1000 + 5x100 + 0x10 + 9x1 + 3x0.1 + 2x0.01 + 5x0.001
= 2000 + 500 + 0 + 9 + 0.3 + 0.02 + 0.005
= 2509.32510
Data Representation in Digital Computing
In the computer, data is recorded as electronic signals or indications. The presence
and absence of these signals in specific circuitry represents data in the computer just as
the presence or absence of punched holes represents data on a punch card. Representing
the data within the computer is accomplished by assigning a specific value to each
binary component or groups or components. The values that the designer assigns to
individual binary components become the code for representing data in computer.
Figure 7-1. Representing Decimal Data by Binary Components
6. 6
Binary Number System / Base 2 Number System
- Binary is derived from the Latin word for “Two”
- Two or 2 is the base for the binary number system
- It uses only two numerals (0 & 1); these are called as BITS. A bit is a short term
for binary digits.
- Zero or 0 represents the absence of an assigned value
- One or 1 represents the presence of the assigned value
Table 7 – 1. Power of Two and its equivalent decimal value
Power of Two Decimal Value
210
1024
29
512
28
256
27
128
26
64
25
32
24
16
23
8
22
4
21
2
20
1
2-1
½ = 0.5
2-2
¼ = 0.25
2-3
1/8 = 0.125
2-4
1/16 = 0.0625
2-5
1/32 = 0.03125
2-6
1/64 = 0.015625
Binary Integers
Binary Integers are binary numbers that do not have fractional part or
without an embedded binary point.
Example: 1012 , 11102 , etc.
Binary Fractions
Binary Fractions are binary numbers with an embedded binary point.
Example: 110.012 , 10110.0102 , etc.
7. 7
Decimal to Binary Conversion (for Integers)
To convert decimal whole numbers from base 10 to any other base, divide that
number repeatedly by the value of the base to which the number is being converted. The
division operation is repeated until the quotient is zero. The remainders – written in
reverse of the order in which they were obtained from the equivalent numeral.
Example 1. Convert 6310 number system to binary number system.
A. Division – Multiplication Method
Division Quotient Remainder
63/2 31 1
31/2 15 1
15/2 7 1
7/2 3 1
3/2 1 1
1/2 0 1
A. Tabulation Method
26
25
24
23
22
21
20
64 32 16 8 4 2 1
0 1 1 1 1 1 1
Example 2. Convert 13910 number system to binary number system.
A. Division – Multiplication Method
Division Quotient Remainder
139/2 69 1
69/2 34 1
34/2 17 0
17/2 8 1
8/2 4 0
4/2 2 0
2/2 1 0
½ 0 1
End of calculation
Therefore,
6310 = 1111112
Therefore,
6310 = 1111112
End of calculation
Therefore,
13910 = 100010112
8. 8
8 + 1 = 910
B. Tabulation Method
27
26
25
24
23
22
21
20
128 64 32 16 8 4 2 1
1 0 0 0 1 0 1 1
Binary to Decimal Conversion (for Integers)
Binary numerals can be converted to decimal by the use of Expanded Notation.
When this approach is used, the position values of the original numeral are written out.
Example 3. Convert 10012 to decimal number system.
A. Expanded Notation Method
10012 = 1x23
+ 0x22
+ 0x21
+ 1x20
= 1x8 + 0x4 + 0x2 + 1x1
= 8 + 0 + 0 + 1
= 910
B. Tabulation Method
1 0 0 1
23
22
21
20
8 4 2 1
Example 4. Convert 101001102 to decimal number system.
A. Expanded Notation Method
101001102 = 1x27
+ 0x26
+ 1x25
+ 0x24
+ 0x23
+ 1x22
+ 1x21
+ 0x20
= 1x128 + 0x64 + 1x32 + 0x16 +0x8 + 1x4 + 1x2 + 0x1
= 128 + 0 + 32 + 0 + 0 + 4 + 2 + 0
= 16610
Therefore,
6310 = 100010112
Therefore,
10012 = 910
Therefore,
10012 = 910
Therefore,
101001102 =16610
9. 9
B. Tabulation Method
1 0 1 0 0 1 1 0
27
26
25
24
23
22
21
20
128 64 32 16 8 4 2 1
Seatwork
1. Convert the following decimal number system to binary numbers using
Division – Multiplication Method and Tabulation Method:
a) 24310
b) 18710
2. Convert the following binary number system to decimal number
system using the Expanded Notation Method and Tabulation Method:
a) 101010112
b) 1101101012
Decimal to Binary Conversion (for Fractions)
A decimal fraction may also be converted into an equivalent binary notation. The
conversion may be accomplished using several techniques. A much simpler method
consists of repeatedly doubling the decimal fraction and noting the integral part of the
product.
Example 5. Convert the decimal fraction 0.37510 to binary fraction.
A. Division – Multiplication Method
Multiplication Products Integral Parts
0.375x2 0.75 0
0.75 x2 1.5 1
0.5 x2 1.0 1
128 + 32 + 4 + 2 = 16610 Therefore,
101001102 =16610
End of calculation
Therefore,
0.37510 = 0.0112
10. 10
B. Tabulation Method
2-1
2-2
2-3
0.5 0.25 0.125
0 1 1
Example 6. Convert the decimal fraction 0.4062510 to binary fraction.
A. Division – Multiplication Method
Multiplication Products Integral Parts
0.40625x2 0.8125 0
0.8125 x2 1.625 1
0.625 x2 1.25 1
0.25 x2 0.5 0
0.5 x2 1.0 1
B. Tabulation Method
2-1
2-2
2-3
2-4
2-5
0.5 0.25 0.125 0.0625 0.03125
0 1 1 0 1
Non-terminating Conversion of Fractions
The binary equivalent of a terminating decimal fraction does not always terminate
or is not exactly converted.
Example 7. The decimal fraction 0.810 is to be converted to its binary
equivalent.
Therefore,
0.37510 = 0.0112
End of calculation
Therefore,
0.4062510 = 0.011012
Therefore,
0.4062510 = 0.011012
11. 11
A. Division – Multiplication Method
Multiplications Products Integral Parts
0.8 x 2 1.6 1
0.6 x 2 1.2 1
0.2 x 2 0.4 0
0.4 x 2 0.8 0
0.8 x 2 1.6 1
0.6 x 2 1.2 1
0.2 x 2 0.4 0
0.4 x 2 0.8 0
0.8 x 2 1.6 1
…….. .… .
…….. …. .
It will be noted that the first four steps will continuously be repeated and the same
four bits will be obtained again and again. Here, the fractional part of the decimal number
does not become zero after a series of multiplications. Therefore,
0.810 = 0.110011001……….2
In this particular case, where the conversion does not terminate, the process of
conversion is only continued until the desired precision has been reached.
Decimal to Binary Conversions (with Integral and Fractional Parts)
Example 8. Convert the decimal number 24.62510 to its binary equivalent.
Step 1. Convert the integral part.
Division – Multiplication Method
Divisions Quotients Remainders
24/2 12 0
12/2 6 0
6/2 3 0
3/2 1 1
1/2 0 1
Step 2. Convert the fractional part.
Division – Multiplication Method
Multiplication Products Integral Parts
0.625 x 2 1.25 1
0.25 x 2 0.5 0
0.5 x 2 1.0
Therefore,
2410 = 110002
Therefore,
0.62510 = 0.1012
12. 12
Step 3. Add the equivalents.
24.62510 = 110002 + 0.1012
= 11001.1012
Binary to Decimal Conversions (with Integral and Fractional Parts)
Example 9. Convert the binary number 11.0112 to its decimal equivalent.
Expanded Notation Method
11.0112 = 1x21
+ 1x20
+ 0x2-1
+ 1x2-2
+ 1x2-3
= 1x2 + 1x1 + 0x0.5 + 1x0.25 + 1x0.125
= 2 + 1 + 0 + 0.25 + 0.125
= 3.37510
Seatwork
1. Convert the following decimal fractions to binary fractions using
Division – Multiplication Method and Tabulation Method:
a) 156.5625010
b) 348.7812510
2. Convert the following binary fractions to decimal fractions system
using the Expanded Notation Method and Tabulation Method:
c) 101.10112
d) 1110110.0110012
Binary Arithmetic
A. Binary Addition
Four possible combinations when adding these two binary numbers:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 plus a carry-over of 1
Therefore,
24.62510 = 11000.1012
13. 13
Example:
a) Binary Checking: Decimal
11 3
+100 + 4
111 7
b) Binary Checking: Decimal
1010 10
+ 1100 + 12
10110 22
c) Binary Checking: Decimal
11.01 3.25
+101.11 + 5.75
1001.00 9.00
d) Binary Checking: Decimal
101 5
100 6
10 2
1010 10
+ 1110 +14
100011 35
Note: In each example we checked our solution by converting the binary
numbers to decimal and the determining if the decimal sum was equal to
the binary total. If not, then an error was made in the process.
B. Binary Subtraction
The table for binary subtraction is as follows:
0 – 0 = 0
1 – 1 = 0
1 – 0 = 1
0 – 1 = 0 with a barrow of 1
Note: Binary numbers can also be negative, just like decimal numbers. If a
larger number is subtracted from a smaller number, the negative sign is
prefixed to the answer.
14. 14
Example:
a) Binary Checking: Decimal
1010 10
- 100 - 4
110 6
b) Binary Checking: Decimal
1111 15
- 1000 - 8
111 7
c) Binary Checking: Decimal
100011 35
- 1111 - 15
10100 20
d) Binary Checking: Decimal
1000.11 8.75
- 11.01 - 3.25
101.10 5.50
e) Binary Checking: Decimal
101 5
- 111 - 7
- 10 - 2
C. Binary Multiplication
The table for binary multiplication is as follows:
0 x 0 = 0
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1
15. 15
Examples
a) Binary Checking: Decimal
101 (multiplicand) 5
x 11 (multiplier) x 3
101 (1st
partial product) 15
+ 101 (2nd
partial product)
1111 (column sums yield the answer)
f) Binary Checking: Decimal
111 7
x 111 x 7
111 49
111
+111
110001
D. Binary Division
The table for binary division is as follows:
0 0 = 0
0 1 = 0
1 1 = 1
1 0 = cannot be
Example:
a) Binary Checking: Decimal
011 (quotient)
11 1001 (dividend) 9 / 3 = 3
0
100
- 11
11
-11
0 (remainder)
(divisor)
16. 16
b) Binary Checking: Decimal
11
100 1100 12 / 4 = 3
-100
100
-100
0
Repeated Subtraction Method
b) 1100
-100 (1st
subtraction)
1000
-100 (2nd
subtraction)
100
-100 (3rd
subtraction)
0
The solution shows that three (3) repeated subtractions were performed. Since, the
equivalent of 310 in binary notation is 112, therefore, 11002 / 1002 = 112.
Seatwork
Perform the required binary arithmetic operation:
1. 1110111 2. 110111 3. 111111
+ 110111 + 1111 + 10111
+ 1011
4. 10101101 5. 110110011
- 111111 - 11010101
6. 101010 7. 11011011
x 1010 x 1001
8. 1011111 101 = ?
Therefore,
11002 / 1002 = 112
17. 17
Octal Number System/ Base 8 Number System
- Octal is derived from the Greek word meaning “eight”.
- The octal number system was adapted because of the difficulty of dealing with long
strings of binary 0s and 1s in converting them into decimals. Binary numbers are
extremely awkward to read or handle. It requires many more positions for data than
any other numbering system. To represent decimal numbers we must use so many
binary digits. Thus, in most computers, binary numbers are grouped in order to
conserve storage location. The octal system overcome this problem since it is
essentially a shorthand method for replacing groups of three binary digits by single
octal digit. In this way, the numbers of digits required to represent any number is
significantly reduced and still maintain the binary concept.
- Octal numbers are important in digital computers, although many computer
specialists and users are not thoroughly familiar with binary, octal, and other
numbering systems used by computers. Knowledge of these concepts can be very
helpful in debugging programs, understanding how computer operates, and in
selecting computer equipments.
- The radix for the number system is 8.
- It uses 8 basic digits {0, 1, 2, 3, 4, 5, 6, and 7}.
Table 7 – 2. Power of Eight and its equivalent decimal value
Power of Eight Decimal Value
810
1073741824
89
134217728
88
16777216
87
2097152
86
262144
85
32768
84
4096
83
512
82
64
81
8
80
1
8-1
1/8 = 0.125
8-2
1/64 = 0.015625
8-3
1/512 = 0.001953125
8-4
1/4096 = 0.000244140625
8-5
1/32768 = 0.00003051757813
8-6
1/262144 = 0.000003814697266
18. 18
Table 7 – 3. Octal Number and its equivalent Decimal number.
Decimal
Number
Octal
Number
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 20
17 21
18 22
19 23
20 24
21 25
22 26
23 27
24 30
25 31
… …
Decimal to Octal Conversion
Example 1. Convert the decimal number 1910 to its equivalent octal number.
Division – Multiplication Method / Remainder Method
Division Quotient Remainder
19 / 8 2 3
2 / 8 0 2
Example 2. Convert the decimal number 26510 to its equivalent octal number.
Division – Multiplication Method / Remainder Method
Division Quotient Remainder
265 / 8 33 1
33 / 8 4 1
4 / 8 0 4
End of calculation
1910 = 238
26510 = 4118
19. 19
Note: When converting from decimal to octal, divide the decimal number by the radix
of octal number system and note the remainder after each division. This
technique is called as Remainder Method also known as the Division –
Multiplication Method. When the divide operation produces a quotient or result
of zero, then the process is terminated. The remainders in reverse order, as
shown by the arrow, for the octal number.
Octal to Decimal Conversion
Example 3. Convert the octal number 358 to its equivalent decimal number.
Expanded Notation Method / Positional Method
358 = 3 x 81
+ 5 x 80
= 3 x 8 + 5 x 1
= 2910
Example 4. Convert the octal number 4858 to its equivalent decimal number.
Expanded Notation Method / Positional Method
4858 = 4x82
+ 8x81
+ 5x80
= 4x64 + 8x8 + 5x1
= 256 + 64 + 5
= 32510
Note: To convert from octal to decimal, multiply each octal digit by its positional
value and add the resulting products.
Octal to Binary Conversion
Example 5. Convert the octal number 458 to its equivalent binary number.
Tabulation Method
4 5
22
21
20
22
21
20
4 2 1 4 2 1
1 0 0 1 0 1
358 = 2910
4858 = 32510
458 = 1001012
20. 20
Example 6. Convert the octal number 7328 to its equivalent binary number.
Tabulation Method
7 3 2
22
21
20
22
21
20
22
21
20
4 2 1 4 2 1 4 2 1
1 1 1 0 1 1 0 1 0
Note: One octal digit is equivalent to 3 positional binary digits or bits.
Binary to Octal Conversion
Example 7. Convert the binary number 1010102 to its equivalent octal number.
Tabulation Method
1 0 1 0 1 0
22
21
20
22
21
20
4 2 1 4 2 1
5 2
Example 8. Convert the binary number 101101112 to its equivalent octal number.
Tabulation Method
0 1 0 1 1 0 1 1 1
22
21
20
22
21
20
22
21
20
4 2 1 4 2 1 4 2 1
2 6 7
Seatwork
1. Convert the decimal number 38910 to its equivalent octal number.
2. Convert the octal number 3428 to its equivalent decimal number.
3. Convert the octal number 2378 to its equivalent binary number.
4. Convert the binary number 11011000112 to its equivalent octal number.
7328 = 1110110102
1010102 = 528
101101112 = 2678
21. 21
Hexadecimal Number System / Base 16 Number System
- The term “hexadecimal” is derived from the combining Greek word “six”
with the Latin word “ten”.
- It uses 10 numerals {0,1,2,3,4,5,6,7,8 & 9} and letter {A, B, C, D, E & F}.
- The radix of the number system is 16.
Table 7 – 4. Hexadecimal Number and its equivalent Decimal number.
Decimal
Number
Hexadecimal
Number
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
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
22. 22
Table 7 – 5. Power of sixteen and its equivalent decimal value
Power of Sixteen Decimal Value
168
4294967296
167
268435456
166
16777216
165
1048576
164
65536
163
4096
162
256
161
16
160
1
16-1
1/16 = 0.0625
16-2
1/256 = 0.00390625
16-3
1/4096= 0.000244140625
16-4
1/65536 = 0.00001525878906
16-5
1/1018576= 0.0000009536743164
Decimal to Hexadecimal Conversion
Example 1. Convert the decimal number 5910 to its equivalent hexadecimal
number.
Division – Multiplication Method / Remainder Method
Divisions Quotients Remainders
59 / 16 3 11 (B)
3 / 16 0 3
Example 2. Convert the decimal number 38510 to its equivalent hexadecimal
number.
Division – Multiplication Method / Remainder Method
Divisions Quotients Remainders
385 / 16 24 1
24 / 16 1 8
1 / 16 0 1
5910 = 3B16
38510 = 18116
23. 23
Hexadecimal to Decimal Conversion
Example 3. Convert the hexadecimal number AD16 to its equivalent decimal
number.
Expanded Notation Method / Positional Method
AD16 = Ax161
+ Dx160
= 10x16 + 13x1
= 160 + 13
= 17310
Example 4. Convert the hexadecimal number BC516 to its equivalent decimal
number.
Expanded Notation Method / Positional Method
BC516 = Bx162
+ Cx161
+ 5x160
= 11x256 + 12x16 + 5x1
= 2816 + 192 + 5
= 301310
Hexadecimal to Binary Conversion
Example 5. Convert the hexadecimal number 1AC16 to its equivalent binary
number.
Tabulation Method
1 A C
23
22
21
20
23
22
21
20
23
22
21
20
8 4 2 1 8 4 2 1 8 4 2 1
0 0 0 1 1 0 1 0 1 1 0 0
Example 6. Convert the hexadecimal number 3B16 to its equivalent binary
number.
Tabulation Method
3 B
23
22
21
20
23
22
21
20
8 4 2 1 8 4 2 1
0 0 1 1 1 0 1 1
AD16 = 17310
BC516 = 301310
1AC16 = 1101011002
3B16 = 1110112
24. 24
Binary to Hexadecimal Conversion
Example 7. Convert the binary number 100111012 to its equivalent hexadecimal
number.
Tabulation Method
1 0 0 1 1 1 0 1
23
22
21
20
23
22
21
20
8 4 2 1 8 4 2 1
9 (A) 13 (D)
Example 8. Convert the binary number 1111100000012 to its equivalent
hexadecimal number.
Tabulation Method
1 1 1 1 1 0 0 0 0 0 0 1
23
22
21
20
23
22
21
20
23
22
21
20
8 4 2 1 8 4 2 1 8 4 2 1
15 (F) 8 1
Seatwork
1. Convert the decimal number 43310 to its equivalent hexadecimal number.
2. Convert the hexadecimal number 28216 to its equivalent decimal number.
3. Convert the hexadecimal number 10016 to its equivalent binary number.
4. Convert the binary number 10101011110112 to its equivalent hexadecimal
number.
100111012= 9D16
1111100000012 = F8116
25. 25
REFERENCES
Byte-Notes (n.d.). Number System in Computer. Retrieved from https://byte-
notes.com/number-system-computer/.
Cook, D. (n.d.). Number Systems. Retrieved from
https://www.robotroom.com/NumberSystems.html.
GeeksforGeeks (n.d.). Number System and Base Conversion. Retrieved from
https://www.geeksforgeeks.org/number-system-and-base-conversions/.
Mendelson, E. (2008). Number Systems and the Foundation of Analysis. New York:
Dover Publications, Inc.
TutorialPoints (n.d.). Number System Conversion. Retrieved from
https://www.tutorialspoint.com/computer_logical_organization/number_system_c
onversion.htm