STLC 01 Content
STLC 01 Content
College of Engineering
Bambang Campus
1. Introduction
2. Different Radices of Number Systems
3. Conversion of Different Conversion Systems
4. Mathematical Operations of the Different Conversion Systems
This lesson is an introduction to the different number systems, which are used for communication
between a digital electronic component to its end-users. This module includes introduction to binary
number system, octal number system, decimal number system, and hexadecimal number system. It
also includes the conversion between the different number systems, which helps end-users better
understand the behavior of a digital component.
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
1-1 INTRODUCTION
Digital systems have such a prominent role in everyday life that we refer to the present technological
period as the digital age. Digital systems are used in communication, business transactions, traffic
control, spacecraft guidance, medical treatment, weather monitoring, the Internet, and many other
commercial, industrial, and scientific enterprises. We have digital telephones, digital televisions, digital
versatile discs, digital cameras, handheld devices, and, of course, digital computers. We enjoy music
downloaded to our portable media player (e.g., iPod Touch TM) and other handheld devices having high-
resolution displays. These devices have graphical user interfaces (GUIs), which enable them to
execute commands that appear to the user to be simple, but which, in fact, involve precise execution of
a sequence of complex internal instructions. Most, if not all, of these devices have a special-purpose
digital computer embedded within them. The most striking property of the digital computer is its
generality. It can follow a sequence of instructions, called a program, that operates on given data. The
user can specify and change the program or the data according to the specific need. Because of this
flexibility, general-purpose digital computers can perform a variety of information-processing tasks that
range over a wide spectrum of applications.
One characteristic of digital systems is their ability to represent and manipulate discrete
elements of information. Any set that is restricted to a finite number of elements contains discrete
information. Examples of discrete sets are the 10 decimal digits, the 26 letters of the alphabet, the 52
playing cards, and the 64 squares of a chessboard. Early digital computers were used for numeric
computations. In this case, the discrete elements were the digits. From this application, the term
digital computer emerged. Discrete elements of information are represented in a digital system by
physical quantities called signals. Electrical signals such as voltages and currents are the most
common. Electronic devices called transistors predominate in the circuitry that implements these
signals. The signals in most present-day electronic digital systems use just two discrete values and are
therefore said to be binary. A binary digit, called a bit, has two values: 0 and 1. Discrete elements of
information are represented with groups of bits called binary codes. For example, the decimal digits 0
through 9 are represented in a digital system with a code of four bits (e.g., the number 7 is represented
by 0111). How a pattern of bits is interpreted as a number depends on the code system in which it
resides. To make this distinction, we could write (0111) 2 to indicate that the pattern 0111 is to be
interpreted in a binary system, and (0111)10 to indicate that the reference system is decimal. Then
01112 = 710, which is not the same as 011110, or one hundred eleven. The subscript indicating the base
for interpreting a pattern of bits will be used only when clarification is needed. Through various
techniques, groups of bits can be made to represent discrete symbols, not necessarily numbers, which
are then used to develop the system in a digital format. Thus, a digital system is a system that
manipulates discrete elements of information represented internally in binary form. In today’s
technology, binary systems are most practical because, as we will see, they can be implemented with
electronic components.
Discrete quantities of information either emerge from the nature of the data being processed or
may be quantized from a continuous process. On the one hand, a payroll schedule is an inherently
discrete process that contains employee names, social security numbers, weekly salaries, income
taxes, and so on. An employee’s paycheck is processed by means of discrete data values such as
letters of the alphabet (names), digits (salary), and special symbols (such as ₽). On the other hand, a
research scientist may observe a continuous process, but record only specific quantities in tabular form.
The scientist is thus quantizing continuous data, making each number in his or her table a discrete
quantity. In many cases, the quantization of a process can be performed automatically by an analog-
to-digital converter, a device that forms a digital (discrete) representation of an analog (continuous)
quantity.
The general-purpose digital computer is the best-known example of a digital system. The major
parts of a computer are a memory unit, a central processing unit, and input-output units. The memory
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
A decimal number such as 7,392 represents a quantity equal to 7 thousands, plus 3 hundreds, plus 9
tens, plus 2 units. The thousands, hundreds, etc., are powers of 10 implied by the position of the
coefficients (symbols) in the number. To be more exact, 7,392 is a shorthand notation for what should
be written as
3 2 1 0
7 ×10 +3 × 10 + 9 ×10 +2 ×10
However, the convention is to write only the numeric coefficients and, from their position, deduce the
necessary powers of 10 with powers increasing from right to left. In general, a number with a decimal
point is represented by a series of coefficients:
a 5 a 4 a3 a2 a1 a0 . a−1 a−2 a−3
The coefficients a j are any of the 10 digits (0, 1, 2, … , 9), and the subscript value j gives the place
value and, hence, the power of 10 by which the coefficient must be multiplied. Thus, the preceding
decimal number can be expressed as
5 4 3 2 1 0 −1 −2 −3
10 a5 +10 a4 +10 a 3+10 a 2+ 10 a 1+10 a0 +10 a−1+10 a−2 +10 a−3
The decimal number system is said to be of base, or radix, 10 because it uses 10 digits and the
coefficients are multiplied by powers of 10. The binary system is a different number system. The
coefficients of the binary system have only two possible values: 0 and 1. Each coefficient a j is
multiplied by a power of the radix, e.g., 2 j, and the results are added to obtain the decimal equivalent of
the number. The radix point (e.g., the decimal point when 10 is the radix) distinguishes positive powers
of 2 from negative powers of 2. For example, the decimal equivalent of the binary number 11010.11 is
26.75, as shown from the multiplication of the coefficients by powers of 2:
4 3 2 1 0 −1 −2
1 ×2 +1 ×2 + 0× 2 + 1× 2 + 0× 2 +1× 2 +1× 2 =26.75
There are many different number systems. In general, a number expressed in a base-r system has
coefficients multiplied by powers of r:
n n−1 2 1 0 −1 −2 −m
a n ⋅r + an−1 ⋅ r + …+a 2 ⋅r +a 1 ⋅r +a 0 r + a−1 ⋅r +a−2 ⋅ r +…+ a−m ⋅r
The coefficients a j range in value from 0 to r −1. To distinguish between numbers of different bases,
we enclose the coefficients in parentheses and write a subscript equal to the base used (except
sometimes for decimal numbers, where the content makes it obvious that the base is decimal). An
example of a base-5 number is
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Arithmetic operations with numbers in base r follow the same rules as for decimal numbers.
When a base other than the familiar base 10 is used, one must be careful to use only the r -allowable
digits. Examples of addition, subtraction, and multiplication of two binary numbers are as follows:
.
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
The sum of two binary numbers is calculated by the same rules as in decimal, except that the
digits of the sum in any significant position can be only 0 or 1. Any carry obtained in a given significant
position is used by the pair of digits one significant position higher. Subtraction is slightly more
complicated. The rules are still the same as in decimal, except that the borrow in a given significant
position adds 2 to a minuend digit. (A borrow in the decimal system adds 10 to a minuend digit.)
Multiplication is simple: The multiplier digits are always 1 or 0 ; therefore, the partial products are equal
either to a shifted (left) copy of the multiplicand or to 0 .
The binary number system uses only two symbols (0, 1). It is said to have a radix of 2 and is commonly
called the base 2 number system. Each binary digit is called a bit.
Counting in binary is illustrated above. The binary number is shown on the right with its decimal
equivalent on the left. The rightmost bit is called the least significant bit (LSB) and the leftmost bit is
called the most significant bit (MSB).
If a 1 appears in the right column, a 1 is added to the binary count. The second place from the right is
the 2s place and a 1 appearing in this column means that 2 is added to the count. It is customary in
digital electronics to memorize at least the binary counting sequence from 0000 to 1111 (read as one-
one-one-one) or decimal 15.
Binary-to-decimal Conversion
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
⋯+ ( a3 ×23 ) + ( a2 ×22 ) + ( a1 ×21 ) + ( a0 ×20 ) + ( a−1 × 2−1 ) + ( a¿2 ×2−2) + ( a−3 × 2−3 ) + …
For example
Integer
Remainder/2 Coefficient
quotient
41 1
¿ 20 +¿ a 0=1
2 2
20
¿ 10 +¿ 0 a 1=0
2
10
¿ 5 +¿ 0 a 2=0
2
5 1
¿ 2 +¿ a 3=1
2 2
2
¿ 1 +¿ 0 a 4=0
2
1 1
¿ 0 +¿ a 5=1
2 2
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
EXAMPLE 1.1 Convert the following binary numbers to their decimal equivalents:
(a) 111100011112 = ____________10
(b) 11100.0112 = ___________10
(c) 110011.100112 = __________10
SOLUTION:
(a) 111100011112 = (1 x 210) + (1 x 29) + (1 x 28) + (1 x 27) + (0 x 26) + (0 x 25) + (0 x 24) + (1 x 23) + (1 x
22) + (1 x 21)
+ (1 x 20)
= 1024 + 512 + 256 + 128 + 0 + 0 + 0 + 8 + 4 + 2 + 1
= 193510
(b) 11100.0112 = (1 x 24) + (1 x 23) + (1 x 22) + (0 x 21) + (0 x 20) + (0 x 2–1) + (1 x 2–2) + (1 x 2–3)
= 16 + 8 + 4 + 0 + 0 + 0 + 0.25 + 0.125
= 28.37510
(c) 110011.100112 = (1 x 25) + (1 x 24) + (1 x 21) + (1 x 20) + (1 x 2–1) + (1 x 2–4) + (1 x 2–5)
= 32 + 16 + 2 + 1 + 0.5 + 0.0625 + 0.03125
= 51.5937510
EXAMPLE 1.2 Convert the following decimal numbers to their binary equivalents:
(a) 6410 = ___________2
(b) 14510 = ___________2
(c) 25510 = ___________2
(d) 34.7510 = ____________2
(e) 27.187510 = ____________2
SOLUTION:
(a) 6410 = ?
Integer
Remainder/2 Coefficient
quotient
64
¿ 32 +¿ 0 a 0=0
2
32
¿ 16 +¿ 0 a 1=0
2
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Integer
Remainder/2 Coefficient
quotient
145 1
¿ 72 +¿ a 0=1
2 2
72
¿ 36 +¿ 0 a 1=0
2
36
¿ 18 +¿ 0 a 2=0
2
18
¿ 9 +¿ 0 a 3=0
2
9 1
¿ 4 +¿ a 4=1
2 2
4
¿ 2 +¿ 0 a 5=0
2
2
¿ 1 +¿ 0 a 6=0
2
1 0 1
¿
ends the +¿ a 7=1
2conversion
2
14510 = a7a6a5a4a3a2a1a0 = 100100012
(c) 25510 = ?
Integer
Remainder/2 Coefficient
quotient
255 1
¿ 127 +¿ a 0=1
2 2
127 1
¿ 63 +¿ a 1=1
2 2
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Integer Remainder/
Coefficient
quotient 2
34
¿ 17 +¿ 0 a 0=0
2
17 1
¿ 8 +¿ a 1=1
2 2
8
¿ 4 +¿ 0 a 2=0
2
4
¿ 2 +¿ 0 a 3=0
2
2
¿ 1 +¿ 0 a 4=0
2
0
1 ends the 1
¿ +¿ a 5=1
2 conversio 2
n
Integer Remainder/
Coefficient
quotient 2
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
The hexadecimal number system has a radix of 16. It is referred to as the base 16 number system. It
uses the symbols 0-9, A, B, C, D, E, and F as shown in the hexadecimal column of the table below.
The letter A stands for a count of 10, B for 11, C for 12, D for 13, E for 14, and F for 15.
If a 1 appears in the rightmost hexadecimal digit, a 1 is added to the hexadecimal count. The second
place from the right is the 16s place and a 1 appearing in this digit position means that 16 is added to
the count.
Hexadecimal-to-decimal Conversion
A hexadecimal number can be converted to decimal by forming the sum of the powers of 16. For a
hexadecimal number with position convention …h3h2h1h0 . h–1h–2h–3…, the sum of the powers of 16 is
For example, to convert hexadecimal B65F to decimal, first remember that A 16 = 1010, B16 = 1110, C16 =
1210, D16 = 1310, E16 = 1410, and F16 = 1510. Then form the sum of the powers of 16.
Integer
Remainder/16 Coefficient
quotient
2560
¿ 160 +¿ 0 h 0=0
16
160
¿ 10 +¿ 0 h1=0
16
10 10
¿ 0 +¿ h2 =A
16 16
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
EXAMPLE 1.3 Convert the following hexadecimal numbers to their decimal equivalents:
(a) F.416 = ____________10
(b) D3.E16 = ___________10
(c) 1111.116 = __________10
(d) 888.816 = __________10
(e) EBA.C16 = __________10
SOLUTION:
(a) F.416 = (15 x 160) + (4 x 16–1)
= 15 + 0.25
= 15.2510
(b) D3.E16 = (13 x 161) + (3 x 160) + (14 x 16–1)
= 208 + 3 + 0.875
= 211.087510
(c) 1111.116 = (1 x 163) + (1 x 162) + (1 x 161) + (1 x 160) + (1 x 16–1)
= 4096 + 256 + 16 + 1 + 0.0625
= 4369.062510
(d) 888.816 = (8 x 162) + (8 x 161) + (8 x 160) + (8 x 16–1)
= 2048 + 128 + 8 + 0.5
= 2184.510
(e) EBA.C16 = (14 x 162) + (11 x 161) + (10 x 160) + (12 x 16–1)
= 3584 + 176 + 10 + 0.75
= 3770.7510
EXAMPLE 1.4 Convert the following decimal numbers to their hexadecimal equivalents:
(a) 810 = ___________16
(b) 6410 = ___________16
(c) 25510 = ___________16
(d) 204.12510 = ____________16
(e) 631.2510 = ____________16
(f) 10 000.003 906 2510 = ____________16
SOLUTION:
(a) 810 = ?
Integer
Remainder/16 Coefficient
quotient
8 8
¿ 0 +¿ h 0=8
16 16
810 = h0 = 816
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Integer
Remainder/16 Coefficient
quotient
64
¿ 4 +¿ 0 h 0=0
16
4 4
¿ 0 +¿ h1=4
16 16
6410 = h1h0 = 4016
(c) 25510 = ?
Integer
Remainder/16 Coefficient
quotient
255 15
¿ 15 +¿ h 0=F
16 16
15 15
¿ 0 +¿ h1=F
16 16
25510 = h1h0 = FF16
(d) 204.12510 = ____________16
Integer
Remainder/16 Coefficient
quotient
204 12
¿ 12 +¿ h 0=C
16 16
12 12
¿ 0 +¿ h1=C
16 16
Integer
Remainder/16 Coefficient
quotient
631 7
¿ 39 +¿ h 0=7
16 16
39 7
¿ 2 +¿ h1=7
16 16
2 2
¿ 0 +¿ h2 =2
16 16
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Integer
Remainder/16 Coefficient
quotient
10000
¿ 625 +¿ 0 h 0=0
16
625 1
¿ 39 +¿ h1=1
16 16
39 7
¿ 2 +¿ h2 =7
16 16
2 2
¿ 0 +¿ h3 =2
16 16
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
The octal number system has a radix of 8. It is referred to as the base 8 number system. It uses the
symbols 0, 1, 2, 3, 4, 5, 6, and 7 as shown in the octal column of the table below. The letter A stands
for a count of 10, B for 11, C for 12, D for 13, E for 14, and F for 15.
Decima
Decimal Binary Octal Binary Octal
l
0 000 0 16 10000 20
1 001 1 17 10001 21
2 010 2 18 10010 22
3 011 3 19 10011 23
4 100 4 20 10100 24
5 101 5 21 10101 25
6 110 6 22 10110 26
7 111 7 23 10111 27
8 1000 10 24 11000 30
9 1001 11 25 11001 31
10 1010 12 26 11010 32
11 1011 13 27 11011 33
12 1100 14 28 11100 34
13 1101 15 29 11101 35
14 1110 16 30 11110 36
15 1111 17 31 11111 37
If a 1 appears in the rightmost octal digit, a 1 is added to the octal count. The second place from the
right is the 8s place and a 1 appearing in this digit position means that 8 is added to the count.
Octal-to-Decimal Conversion
An octal number can be converted to decimal by forming the sum of the powers of 8. For an octal
number with position convention …o3o2o1o0 . o–1o–2o–3…, the sum of the powers of 8 is
Integer
Remainder/8 Coefficient
quotient
225
¿ 28 +¿ 1 o 0=1
8
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Binary-to-Octal Conversion
As with the hexadecimal system, the prime advantage of the octal system is its easy conversion to
binary. Since 23 = 8, each octal digit corresponds to three binary digits. The first 16 numbers in the
decimal, binary, octal, and hexadecimal number systems are listed in the table below.
Octal
Decimal Binary Hexadecimal
(base
(base 10) (base 2) (base 16)
8)
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
The conversion from binary to octal is easily accomplished by partitioning the binary number into
groups of three digits each, starting from the binary point and proceeding to the left and to the right.
The corresponding octal digit is then assigned to each group. The following example illustrates the
procedure:
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Complements are used in digital computers for simplifying the subtraction operation and for logical
manipulation. There are two types of complements for each base-r system: the radix complement (r’s
complement) and the diminished radix complement ((r – 1)’s complement).
- For binary: 2’s complement & 1’s complement
- For decimal: 10’s complement & 9’s complement
(r – 1)’s Complement
Given a number N in base r having n integer digits and m fractional digits, the (r – 1)’s complement of N
is defined as r n −r−m −N . For decimal numbers, r = 10 and r – 1 = 9, so the 9’s complement of N is
n −m
10 −10 −N .
For example, to get the 9’s complement of 546700, first count the number of integer digits (6 in this
example).
The 9’s complement of 546700 is (106 – 1) – 546700 = 999999 – 546700 = 453299.
Also,
The 9’s complement of 012398 is (106 – 1) – 012398 = 999999 – 012398 = 987601.
REMARKS: The zeros at the beginning of a number are also considered for the complements as long
as it is defined.
For example, to get the 1’s complement of 1011000 (with 7 number of integer bits), first convert (2 7)10 to
its binary equivalent before performing the subtraction.
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
The (r – 1)’s complement of octal or hexadecimal numbers is obtained by subtracting each digit from
7’s or F’s (decimal 15), respectively.
EXAMPLE 1.7 Obtain the diminished radix complement of the following binary numbers:
(a) 10000000
(b) 11011010
(c) 10000101
(d) 00000000
(e) 01110110
(f) 11111111
SOLUTION:
(a) The 1’s complement of 1000 0000 is (28 – 1) – 1000 0000 = 1111 1111 – 1000 0000 = 0111 1111
(b) The 1’s complement of 1101 1010 is (28 – 1) – 1101 1010 = 1111 1111 – 1101 1010 = 0010 0101
(c) The 1’s complement of 1000 0101 is (28 – 1) – 1000 0101 = 1111 1111 – 1000 0101 = 0111 1010
(d) The 1’s complement of 0000 0000 is (28 – 1) – 0000 0000 = 1111 1111 – 0000 0000 = 1111 1111
(e) The 1’s complement of 0111 0110 is (28 – 1) – 0111 0110 = 1111 1111 – 0111 0110 = 1000 1001
(f) The 1’s complement of 1111 1111 is (28 – 1) – 1111 1111 = 1111 1111 – 1111 1111 = 0000 0000
EXAMPLE 1.8 Find the 9’s complement of the following decimal numbers:
(a) 52,784,630
(b) 25,000,000
(c) 63,325,600
(d) 00,000,000
SOLUTION:
(a) The 9’s complement of 52,784,630 is (108 – 1) – 52,784,630 = 99,999,999 – 52,784,630 =
47,216,369
(b) The 9’s complement of 25,000,000 is (108 – 1) – 25,000,000 = 99,999,999 – 25,000,000 =
74,999,999
(c) The 9’s complement of 63,325,600 is (108 – 1) – 63,325,600 = 99,999,999 – 63,325,600 =
36,674,399
(d) The 9’s complement of 00,000,000 is (108 – 1) – 00,000,000 = 99,999,999 – 00,000,000 =
99,999,999
EXAMPLE 1.9 (a) Find the diminished radix complement of B2FA16.
(b) Convert B2FA16 to binary.
(c) Find the 1’s complement of the result in (b).
(d) Convert the answer in (c) to hexadecimal and compare with the answer in (a).
SOLUTION:
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.
Mano, M. (2016). Digital Design with an Introduction to the Verilog HDL (5th ed.). pp. 17-42
Singapore: Pearson Education South Asia. Retrieved from https://nitsri.ac.in/Department/Computer
%20Science%20&%20Engineering/digital_design-__morris_mano-fifth_edition.pdf
Petriu, E.M. Digital Logic Circuits.
Shannon, C.E. A Symbolic Analysis of Relay and Switching Circuits.
Prepared by:
Recommending Approval:
Approved by:
In accordance with Section 185. Fair Use of a Copyrighted Work of Republic Act 8293, the copyrighted works included in this material may be
reproduced for educational purposes only and not for commercial distribution.