0% found this document useful (0 votes)
81 views

Module 1 - Number System

This document discusses digital systems and various number systems used to represent data in digital electronics. It provides an overview of digital devices and computers that use digital systems. It then describes different number systems like binary, decimal, octal and hexadecimal systems that are used to represent discrete elements of information in digital systems. It explains concepts like bits, bytes, radix, place value and provides examples of representing numbers and performing operations in these number systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Module 1 - Number System

This document discusses digital systems and various number systems used to represent data in digital electronics. It provides an overview of digital devices and computers that use digital systems. It then describes different number systems like binary, decimal, octal and hexadecimal systems that are used to represent discrete elements of information in digital systems. It explains concepts like bits, bytes, radix, place value and provides examples of representing numbers and performing operations in these number systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Digital Electronics 1 1

DIGITAL SYSTEMS

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 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. 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.

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 2

Number System

The study of number systems is important from the viewpoint of


understanding how data are represented before they can be
processed by any digital system including a digital computer.

In this module, we will discuss different number systems commonly


used to represent data.

Number System is a way or methodology on how numbers are


represented inside the computer’s memory. Human beings think in
decimal, while computer process in binary. Technically, computer can
accept data in human readable form then convert them into acceptable
computer code to generate an output which can be understood by
man.

Different characteristics that define a number system include:


• the number of independent digits used in the number system,
• the place values of the different digits constituting the number
• and the maximum numbers that can be written with the given
number of digits.
Among the three characteristic parameters, the most fundamental is
the number of independent digits or symbols used in the number
system. It is known as the radix or base of the number system.

Number System Base or Radix Set of valid digits


Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9
Binary 2 0 and 1
Octal 8 0, 1, 2, 3, 4, 5, 6 and 7
Hexadecimal 16 0 to 9, A, B, C, D, E and F

Note: A=10, B=11, C=12, D= 13, E=14 and F=15

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 3

DECIMAL NUMBER SYSTEM


The decimal number system is a radix-10 number system and
therefore has 10 different digits or symbols.
These are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
All higher numbers after ‘9’ are represented in terms of these
10 digits only
Numbers should not be greater than or equal to 10 (or its base)
The place values of different digits in a mixed decimal number,
starting from the decimal point, are 100, 101, 102 and so on (for
the integer part) and 10−1, 10−2, 10−3 and so on (for the fractional
part).
The value or magnitude of a given decimal number can be
expressed as the sum of the various digits multiplied by their
place values or weights.

For example, in the case of the decimal number 1234.567,


➢ the integer part (i.e. 1234) can be expressed as
1234 = (1×103) + (2×102) + (3×101) + (4×100)
= 1000 + 200 + 30 + 4 = 1234

➢ and the fractional part can be expressed as


567 = (5×10−1) + (6×10−2) + (7×10−3)
= 0.5 + 0.06 + 0.007 = 0.567

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 4

BINARY NUMBER SYSTEM


The binary number system is a radix-2 number system with ‘0’
and ‘1’ as the two independent digits.
All larger binary numbers are represented in terms of ‘0’ and ‘1’.
The procedure for writing higher order binary numbers after ‘1’
is similar to the one explained in the case of the decimal number
system.
Numbers should not be greater than or equal to 2 (or its base)
the place values of different digits in a mixed binary number are
20, 21, 22 and so on (for the integer part) and 2−1, 2−2, 2−3 and
so on (for the fractional part).
For example, the first 16 numbers in the binary number system would
be:
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101,
1110 and 1111.

Example 1:
Consider an arbitrary number system with the independent digits as 0,
1 and X. What is the radix of this number system? List the first 10
numbers in this number system.
Solution
❖ The radix of the proposed number system is 3.
❖ The first 10 numbers in this number system would be
0, 1, X, 10, 11, 1X, X0, X1, XX and 100.
Decimal Binary 3-bit binary 4-bit binary
0 0 000 0000
1 1 001 0001
2 10 010 0010
3 11 011 0011
4 100 100 0100
5 101 101 0101
6 110 110 0110
7 111 111 0111

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 5

OCTAL NUMBER SYSTEM


The octal number system has a radix - 8 and therefore has eight
distinct digits.
All higher-order numbers are expressed as a combination of
these on the same pattern as the one followed in the case of
the binary and decimal number systems
The independent digits are 0, 1, 2, 3, 4, 5, 6 and 7.
The place values for the different digits in the octal number
system are 80, 81, 82 and so on (for the integer part) and 8−1,
8−2, 8−3 and so on (for the fractional part).

For example, the next 10 numbers that follow ‘7’, would be


10, 11, 12, 13, 14, 15, 16, 17, 20 and 21.

HEXADECIMAL NUMBER SYSTEM


The hexadecimal number system is a radix-16 number system
and its 16 basic digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D,
E and F.
The place values or weights of different digits in a mixed
hexadecimal number are 160, 161, 162 and so on (for the integer
part) and 16−1, 16−2, 16−3 and so on (for the fractional part).
The decimal equivalent of A, B, C, D, E and F are 10, 11, 12,
13, 14 and 15 respectively, for obvious reasons.

The hexadecimal number system provides a condensed way of


representing large binary numbers stored and processed inside the
computer. One such example is in representing addresses of different
memory locations.
Let us assume that a machine has 64K Bytes of memory. Such a
memory has 64K Bytes (= 216= 65,536) memory locations and needs
65,536 different addresses. 210= 1024 = 1K, 64K = 64x 1024 = 65536
These addresses can be designated as
0 to 65,535 in the decimal number system
00000000 00000000 to 11111111 11111111 in the binary
0000 to FFFF in the hexadecimal number system

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 6

Number Systems – Some Common Terms

Binary Number System


• Bit is an abbreviation of the term ‘binary digit’ and is the
smallest unit of information. It is either ‘0’ or ‘1’.
• A byte is a string of eight bits. The byte is the basic unit of data
operated upon as a single unit in computers.
• A computer word is again a string of bits whose size, called the
‘word length’ or ‘word size’, is fixed for a specified computer,
although it may vary from computer to computer. The word
length may equal one byte, two bytes, four bytes or be even
larger.
• The 1’s complement of a binary number is obtained by
complementing all its bits, i.e. by replacing 0s with 1s and 1s
with 0s.
For example, the 1’s complement of (10010110)2 is
(01101001)2.
• The 2’s complement of a binary number is obtained by adding
‘1’ to its 1’s complement.
The 2’s complement of (10010110)2 is (01101010)2.

Decimal Number System


• Corresponding to the 1’s and 2’s complements in the binary
system, in the decimal number system we have the 9’s and
10’s complements.
• The 9’s complement of a given decimal number is obtained by
subtracting each digit from 9.
For example, the 9’s complement of (2496)10 would be
(7503)10. The
• 10’s complement is obtained by adding ‘1’ to the 9’s
complement.
The 10’s complement of (2496)10 is (7504)10.

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 7

Octal Number System


• In the octal number system, we have the 7’s and 8’s
complements.
• The 7’s complement of a given octal number is obtained by
subtracting each octal digit from 7.
For example, the 7’s complement of (562)8 would be (215)8.
• The 8’s complement is obtained by adding ‘1’ to the 7’s
complement.
The 8’s complement of (562)8 would be (216)8.

Hexadecimal Number System


• The 15’s and 16’s complements are defined with respect to the
hexadecimal number system.
• The 15’s complement is obtained by subtracting each hex digit
from 15.
For example, the 15’s complement of (3BF)16 would be (C40)16.
• The 16’s complement is obtained by adding ‘1’ to the 15’s
complement.
The 16’s complement of (3BF)16 would be (C41)16.

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 8

Number Representation in Binary


Different formats used for binary representation of both positive
and negative decimal numbers include the sign-bit magnitude method,
the 1’s complement method and the 2’s complement method.

Sign-Bit Magnitude
• In the sign-bit magnitude representation of positive and
negative decimal numbers, the MSB represents the ‘sign’, with
a ‘0’ denoting a plus sign and a ‘1’ denoting a minus sign. The
remaining bits represent the magnitude.
• In eight-bit representation, while MSB represents the sign, the
remaining seven bits represent the magnitude.
For example, the eight-bit representation of:
+12 would be 00001100, and that
−12 would be 10001100.
• An n−bit binary representation can be used to represent
decimal numbers in the range of −(2n−1−1) to +(2n−1−1).
• That is, eight-bit representation can be used to represent
decimal numbers in the range from −127 to +127 using the
sign-bit magnitude format.

1’s Complement
• In the 1’s complement format, the positive numbers remain
unchanged. The negative numbers are obtained by taking the
1’s complement of the positive counterparts.
For example,
+12 will be represented as 00001100 in eight-bit notation, and
−12 will be represented as 11110011, which is the 1’s
complement of 00001100.
• Again, n-bit notation can be used to represent numbers in the
range from −(2n−1−1) to +(2n−1−1) using the 1’s complement
format.
• The eight-bit representation of the 1’s complement format can
be used to represent decimal numbers in the range from −127
to +127.

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 9

2’s Complement
• In the 2’s complement representation of binary numbers, the
MSB represents the sign, with a ‘0’used for a plus sign and a
‘1’ used for a minus sign. The remaining bits are used for
representing magnitude.
• Positive magnitudes are represented in the same way as in the
case of sign-bit or 1’s complement representation.
• Negative magnitudes are represented by the 2’s complement
of their positive counterparts.
For example,
+12 would be represented as 00001100, and
−12 would be written as 11110100. (11110011 plus 1)

Please note that, if the 2’s complement of the magnitude of +9


gives a magnitude of −9, then the reverse process will also be
true, i.e. the 2’s complement of the magnitude of −9 will give a
magnitude of +9.

• The n-bit notation of the 2’s complement format can be used to


represent all decimal numbers in the range from +(2n−1−1) to
−(2n−1).
• The 2’s complement format is very popular as it is very easy to
generate the 2’s complement of a binary number and also
because arithmetic operations are relatively easier to perform
when the numbers are represented in the 2’s complement
format.

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 10

ANY NUMBER BASE TO DECIMAL

Finding the Decimal Equivalent


The decimal equivalent of a given number in another number
system is given by the sum of all the digits multiplied by their
respective place values. The integer and fractional parts of the given
number should be treated separately.

Binary-to-Decimal Conversion
The decimal equivalent of the binary number (1100.0101)2 is
determined as follows:
• The integer part = 1100
The decimal equivalent
= (1 × 23) + (1 × 22) + (0 × 21) + (0 × 20)
= 8 + 4 + 0 + 0 = 12

• The fractional part = .0101


Therefore, the decimal equivalent
= (0 × 2−1) + (1 × 2−2) + (0 × 2−3) + (1 × 2−4)
= 0 + 0.25 + 0 + 0.0625 = 0.3125
• Therefore, the decimal equivalent of (1100.0101)2 = 12.312510

Octal-to-Decimal Conversion
The decimal equivalent of the octal number (137.21)8 is determined as
follows:
• The integer part = 137
The decimal equivalent
= (1 × 82) + (3 × 81) + (7 × 80)
= 64 + 24 + 7 = 95
• The fractional part = .21
The decimal equivalent
= (2 × 8−1) + (1 × 8−2)
= 0.25 + 0.0156 = 0.2656

• Therefore, the decimal equivalent of (137.21)8 = (95.2656)10

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 11

Hexadecimal-to-Decimal Conversion
The decimal equivalent of the hexadecimal number (1E0.2A)16 is
determined as follows:
• The integer part = 1E0
• The decimal equivalent
= (1 × 162) + (14 × 161) + (0 × 160)
= 256 + 224 + 0 = 480
• The fractional part = .2A
• The decimal equivalent
= (2 × 16−1) + (10 × 16−2) = 0.164

• Therefore, the decimal equivalent of (1E0.2A)16 = (480.164)10

Example
Find the decimal equivalent of the following binary numbers expressed
in the 2’s complement format:
(a) 00001110;
(b) 10001110.
Solution
(a) The MSB bit is ‘0’, which indicates a plus sign.
The magnitude bits are 0001110.
The decimal equivalent
= (0×26)+(0×25)+(0×24)+(1×23)+(1×22)+(1×21)+(0×20)
= 0+0+0+8+4+2+0 = 14

Therefore, 00001110 represents +14

(b) The MSB bit is ‘1’, which indicates a minus sign


The magnitude bits are therefore given by the 2’s complement of
0001110, i.e. 1110010
The decimal equivalent
= (1×26)+(1×25)+(1×24)+(0×23)+(0×22)+(1×21)+(0×20)
= 64 + 32 + 16 + 0 + 0 + 2 + 0 = 114

Therefore, 10001110 represents −114

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 12

DECIMAL TO ANY NUMBER BASE SYSTEM


In order to convert a decimal number into its representation in
a different number base, we have to repeatedly divide the decimal
number by the base in which it is converted, until the quotient becomes
zero or cannot be divided by. As the number is divided, the remainders
in reverse order from the digits of the number in the other base.

Example:
Convert the decimal number 53 to base 7.
Solution:

Dividend Divisor Remainder


53 7 4
7 7 0
1 7 1
0

Therefore, 5310 represents 1047

Decimal-to-Binary Conversion
For the integer part,
➢ the binary equivalent can be found by successively dividing the
integer part of the number by 2 and recording the remainders
until the quotient becomes ‘0’.
➢ The remainders written in reverse order constitute the binary
equivalent.

For the fractional part,


➢ it is found by successively multiplying the fractional part of the
decimal number by 2 and recording the carry until the result of
multiplication is ‘0’.
➢ The carry (Integer part) sequence written in forward order
constitutes the binary equivalent of the fractional part of the
decimal number

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 13

• If the result of multiplication does not seem to be heading


towards zero in the case of the fractional part, the process may
be continued only until the requisite number of equivalent bits
has been obtained.
• This method of decimal–binary conversion is popularly known
as the double-dabble method.

Example:
Find the binary equivalent of (13.375)10.

Solution:
• The integer part = 13
Dividend Divisor Remainder
13 2 1
6 2 0
3 2 1
1 2 1
0

The binary equivalent of 1310 = 11012

• The fractional part = .375


Product
Multiplicand Multiplier
Integer Fraction
0.375 2 0 .75
0.75 2 1 .50
0.50 2 1 .0

The binary equivalent of (0.375)10= (.011)2

Therefore, the binary equivalent of (13.375)10= (1101.011)2

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 14

Decimal-to-Octal Conversion
• The process of decimal-to-octal conversion is similar to that of
decimal-to-binary conversion.
• The progressive division in the case of the integer part and the
progressive multiplication while working on the fractional part
here are by ‘8’ which is the radix of the octal number system.
• Again, the integer and fractional parts of the decimal number
are treated separately.

Example 1.4
Find the octal equivalent of (73.75)10.
Solution
• The integer part = 73
Dividend Divisor Remainder
73 8 1
9 8 1
1 8 1
0

The octal equivalent of (73)10 = (111)8

• The fractional part = 0.75


Product
Multiplicand Multiplier
Integer Fraction
0.75 8 6 .0

• The octal equivalent of (0.75)10 = (.6)8

Therefore, the octal equivalent of (73.75)10 = (111.6)8

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 15

Decimal-to-Hexadecimal Conversion
• The process of decimal-to-hexadecimal conversion is also
similar.
• Since the hexadecimal number system has a base of 16, the
progressive division and multiplication factor in this case is 16.

Example:
Determine the hexadecimal equivalent of (82.25)10.
Solution
• The integer part = 82
Dividend Divisor Remainder
82 16 2
5 16 5
0

The hexadecimal equivalent of (82)10 = (52)16

• The fractional part = 0.25


Product
Multiplicand Multiplier
Integer Fraction
0.25 16 4 .0

The hexadecimal equivalent of (0.25)10 = (0.4)16

Therefore, the hexadecimal equivalent of (82.25)10 = (52.4)16

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 16

Binary–Octal and Octal–Binary Conversions


• An octal number can be converted into its binary equivalent by
replacing each octal digit with its three-bit binary equivalent.
• All we have then to remember is the three-bit binary equivalents
of the basic digits of the octal number system.
• A binary number can be converted into an equivalent octal
number by splitting the integer and fractional parts into groups
of three bits, starting from the binary point on both sides.
• The 0s can be added to complete the outside groups if needed.

Example:
Find the
a. binary equivalent of (374.26)8
b. octal equivalent of (1110100.0100111)2

Solution:
• The given octal number = (374.26)8

3 7 4 . 2 6
011 111 100 . 010 110

The binary equivalent of (374.26)8 = (011111100.010110)2


= (11111100.01011)2

• The given binary number = (1110100.0100111)2

001 110 100 . 010 011 100


1 6 4 . 2 3 4

The binary equivalent of (1110100.0100111)2 = (164.234)8

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 17

Hex–Binary and Binary–Hex Conversions


• A hexadecimal number can be converted into its binary
equivalent by replacing each hex digit with its four-bit binary
equivalent.
• All we have then to remember is the four-bit binary equivalents
of the basic digits of the hexadecimal number system.
• A given binary number can be converted into an equivalent
hexadecimal number by splitting the integer and fractional parts
into groups of four bits, starting from the binary point on both
sides.
• The 0s can be added to complete the outside groups if needed.

Example:
Find the
a. binary equivalent of (17E.F6)16
b. hex equivalent of (1011001110.011011101) 2
Solution:
• The given hex number = (17E.F6)16
1 7 E . F 6
0001 0111 1110 . 1111 0110

The binary equivalent = (000101111110.11110110)2


= (101111110.1111011)2

• The given binary number = (1011001110.011011101)2


0010 1100 1110 . 0110 1110 1000
2 C E . 6 E 8

The hex equivalent of (1011001110.011011101)2 is (2CE.6E8)16

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 18

Hex–Octal and Octal–Hex Conversions


• For hexadecimal–octal conversion, the given hex number is
firstly converted into its binary equivalent which is further
converted into its octal equivalent.
• An alternative approach is firstly to convert the given
hexadecimal number into its decimal equivalent and then
convert the decimal number into an equivalent octal number.
• The former method is definitely more convenient and
straightforward.
• For octal–hexadecimal conversion, the octal number may first
be converted into an equivalent binary number and then the
binary number transformed into its hex equivalent.
• The other option is firstly to convert the given octal number into
its decimal equivalent and then convert the decimal number into
its hex equivalent.

Example:
Find the
a. octal equivalent of (2F.C4)16
b. hex equivalent of (762.013)8
Solution:
• The given hex number = (2F.C4)16.
2 F . C 4
0010 1111 . 1100 0110

000 101 111 . 110 001 100


0 5 7 . 6 1 4

The Octal equivalent of (2F.C4)16 is 57.6148

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 19

• The given octal number = (762.013)8.

7 6 2 . 0 1 3
111 110 010 . 000 001 011

0001 1110 0010 . 0000 0101 1000


1 E 2 . 0 4 8

Prepared By: Engr. Mark Anthony C. Aseoche


Digital Electronics 1 20

Activity 1D

1. Express the following numbers in decimal:


a) (10110.0101)2
b) (26.25)8
c) (DADA.C)16
2. Convert 1234.5610 to the following number systems
a) Binary
b) Octal
c) Hexadecimal
3. Convert the following numbers with the indicated bases to decimal:
a) (4321)5
b) (798)12
c) (345)6
4. What is the largest binary number that can be expressed with 16 bits? What
are the equivalent decimal and hexadecimal numbers?
5. Convert the hexadecimal number 64CD to binary, and then convert it from
binary to octal.
6. Convert the decimal number 432 to binary in two ways:
a) convert directly to binary;
b) convert first to hexadecimal and then from hexadecimal to binary.
c) Which method is faster?
7. Obtain the 1’s and 2’s complements of the following binary numbers:
a) 00011000
b) 10100101
c) 11111111
8. Find the 9’s and the 10’s complement of the following decimal numbers:
a) 25,678,036
b) 12,000,000
c) 00,000,000
9. (a) Find the 16’s complement of C8DF.
(b) Convert C8DF to binary.
(c) Find the 2’s complement of the result in (b).
(d) Convert the answer in (c) to hexadecimal and compare with the answer
in (a).
10. Find the exact number of bytes in a system that contains:
a) 64K bytes
b) 16M bytes,
c) 7.2G bytes

Prepared By: Engr. Mark Anthony C. Aseoche

You might also like