Professional Documents
Culture Documents
Study Material
<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU>: <Course Code:22320><Course Name: Digital Techniques><Topic Name:
Number Systems and code>
<UO1a.1.><study Material>
Give number of
states in a
digital signal
Do You know
the
representation
of Digital signal
and Analog
signal?
A good example of a digital electronic system is a mobile phone. As you speak into the phone, the digital electronic circuits it contains
converts your voice into a series of electronic pulses (or 1s and 0s). These are transmitted and the receiving mobile phone then converts
the digital pulses back into your voice. Digital circuits are used because they are efficient and work well, also, digital signals are easier to
transmit than actual sound (for example a person’s voice)
Digital circuits and systems can be found in almost every field of electronics. In communications, the principles of digital electronics are
found in satellites, telephone switching and transmission networks, and navigation systems. Digital circuits in the area of consumer
electronics are found in compact discs, VCRs, and television. Process controls in industrial applications, and electronic systems used in
medicine have benefited greatly from advances in digital electronics.
Signal:
A signal is an electromagnetic or electrical current that is used for carrying data from one system or network to another. The signal is a
function that conveys information about a phenomenon.
In electronics and telecommunications, it refers to any time-varying voltage that is an electromagnetic wave which carries information.
A signal can also be defined as an observable change in quality such as quantity
Analog Signal :
Analog signal is a continuous signal in which one time-varying quantity represents another time-based variable. These kind of signals
works with physical values and natural phenomena such as earthquake, frequency, volcano, speed of wind, weight, lighting, etc.
Digital Signal:
A digital signal is a signal that is used to represent data as a sequence of separate values at any point in time. It can only take on one of a
fixed number of values. This type of signal represents a real number within a constant range of values.
Characteristics of Analog Signal
Here, are essential characteristics of Analog Signal
The accuracy of the digital signal is better than that of the analog signal
Analog Digital
An analog signal is a continuous signal that represents physical Digital signals are time separated signals which are generated
measurements. using digital modulation.
It uses a continuous range of values that help you to represent Digital signal uses discrete 0 and 1 to represent information.
information.
Temperature sensors, FM radio signals, Photocells, Light sensor, Computers, CDs, DVDs are some examples of Digital signal.
Resistive touch screen are examples of Analog signals.
The analog signal bandwidth is low The digital signal bandwidth is high.
Analog signals are deteriorated by noise throughout transmission Relatively a noise-immune system without deterioration
as well as write/read cycle. during the transmission process and write/read cycle.
Analog hardware never offers flexible implementation. Digital hardware offers flexibility in implementation.
It is suited for audio and video transmission. It is suited for Computing and digital electronics.
Processing can be done in real-time and consumes lesser It never gives a guarantee that digital signal processing can be
bandwidth compared to a digital signal. performed in real time.
Analog instruments usually have s scale which is cramped at lower Digital instruments never cause any kind of observational
end and gives considerable observational errors. errors.
Analog signal doesn't offer any fixed range. Digital signal has a finite number, i.e., 0 and 1.
Advantages of Analog Signals
Here, are pros/benefits of Analog Signals
Easier in processing
Best suited for audio and video transmission.
It has a low cost and is portable.
It has a much higher density so that it can present more refined information.
Not necessary to buy a new graphics board.
Uses less bandwidth than digital sounds
Provide more accurate representation of a sound
It is the natural form of a sound.
KEY DIFFERENCES:
An analogsignal is a continuous signal whereas Digital signals are time separated signals.
Analog signal is denoted by sine waves while It is denoted by square waves
Analog signal uses a continuous range of values that help you to represent information on the other hand digital signal uses
discrete 0 and 1 to represent information.
The analog signal bandwidth is low while the bandwidth of the digital signal is high.
Analog instruments give considerable observational errors whereas Digital instruments never cause any kind of observational
errors.
Analog hardware never offers flexible implementation, but Digital hardware offers flexibility in implementation.
Analog signals are suited for audio and video transmission while Digital signals are suited for computing and digital electronics.
Key Take away from this UO:
Concept of Analog signal and Digital Signal
Comparison of Analog Signal and Digital Signal.
Study Material
<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU>: <Course Code:22320><Course Name: Digital Techniques><Topic Name:
Number Systems and code>
<UO1a.2.><study Material>
Key words Learning Objective: To convert the given number from one Numbers have positional importance
Number System , number system to another such as Binary, Decimal, octal,
Radix , Decimal , Hexadecimal.
Binary ,
Hexadecimal,
Octal
Name the
number system
used in
Computers.
RADIX or BASE:
In a positional numeral system, the radix or base is the number of unique digits, including the digit zero, used to represent numbers. For
example, for decimal system (the most common system in use today) the radix (base number) is 10, because it uses ten digits i.e. from 0
to 9 in which every digit can have 10 distinct values (0, 1, 2…….9).
The largest value of a digit is always one less than the base: For example, the largest digit in a decimal system is 9 (one less than the
base 10).
The position (place) of every digit represents a different multiple of base i.e. the number have positional importance: For example,
Hence, we can implement a common rule for all the numbering systems, for a general number we have to multiply each of digit by some
There are various types of the number system, the four most common number system types are:
1. Decimal number system (Base-10)
2. Binary number system (Base-2)
3. Octal number system (Base-8)
4. Hexadecimal number system (Base-16)
In this number system each place of a digit represents a different multiple of 10. These multiples are called as weighted
values.
The digits having successive position to the left side of the decimal point have weights of 10 , 10 , 10 , 10 and so on. Similarly,
0 1 2 3
the digits having successive position to the right side of the decimal point have weights of 10 , 10 , 10 and so on. That means,
-1 -2 -3
10 and 10 respectively. Similarly, the digits 2, 4 and 6 have weights of 10 , 10 and 10 respectively.
2 3 -1 -2 -3
Hence, we write it as
1358.246 = (1 × 10 ) + (3 × 10 ) + (5 × 10 ) + (8 × 10 ) + (2 × 10 ) +(4 × 10 ) + (6 × 10 ).
3 2 1 0 -1 -2 -3
Binary Number System
The modern digital systems do not process decimal number rather they work with another number system known as a binary number
system whose radix or base is 2 and its elements or digits will be 0 & 1 only. This system is known as binary number system as its radix
is 2. The digits 0 & 1 of this system are known as bits. This number system finds extensive use in digital electronics.
Characteristics of Binary Numbers System
so on. Similarly, the digit having successive positions to the right of the binary point have weights of 2 , 2 , 2 and so on, means
-1 -2 -3
The left most bit in a given binary number with the highest weight is called as Most significant bit (MSB) whereas the right
most bit in a given binary number with lowest weight is called as least significant bit (LSB).
The binary number system requires a very long string of 1’s and 0’s to represent a decimal number hence it is a drawback of
binary number system.
The table below illustrates the counting from 0 to 15 in binary system with their decimal equivalents
Hence, we write it as
1101.011 = (1 × 2 ) + (1 × 2 ) + (0 × 2 ) + (1 × 2 ) + (0 × 2 ) +
3 2 1 0 -1
(1 × 2 ) + (1 × 2 )
-2 -3
on. Similarly, the digit having successive positions to the right of the octal point have weights of 8 , 8 , 8 and so on, means
-1 -2 -3
Example
3) Represent the octal number 1457.236 in terms of power of 8.
Solution: Integer part of this number is 1457 and fractional part of this number is 0.236. The digits 7, 5, 4 and 1 have weights of 8 , 8 , 8 0 1 2
Hence, we write it as
1457.236 = (1 × 8 ) + (4 × 8 ) + (5 × 8 ) + (7 × 80) + (2 × 8- ) +(3 × 8 ) + (6 × 8 )
3 2 1 1 -2 -3
so on. Similarly, the digit having successive positions to the right of the hexadecimal point have weights of 16 , 16 , 16 and so on, means
-1 -2 -3
Example
4) Represent the Hexadecimal number 6DE in terms of power of 16.
Solution: Integer part of this number is 6DE and there is no fractional part. Therefore digits E, D and 6 have weights of 16 , 16 , and 16
0 1 2
respectively.
Hence, we write it as
6DE = (6 × 16 ) + (13 × 16 ) + (14 × 16 )
2 1 0
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 8 10
9 1001 9 11
10 1010 A 12
11 1011 B 13
12 1100 C 14
13 1101 D 15
14 1110 E 16
15 1111 F 17
The table above shows relationship between decimal, binary, octal, and hexadecimal numbers from 0 to 15.
CONVERSION OF NUMBER SYSTEMS
The conversion of a number from one number system to another is achieved by expanding the given number to its power series and
adding all the terms.
If the given number includes the radix point, then it is necessary to separate the number into an integer part and a fraction part and
then each part should be converted separately.
Conversion from Radix “r” to Decimal System
The general procedure for conversion of a number system to decimal system is given below:
Steps to Follow:
1. Note down the given Number.
2. Write down the weights corresponding to different positions.
3. Multiply each digit in the given number with the corresponding weight to obtain product numbers.
4. Add all the product numbers to get the decimal equivalent.
The following examples demonstrate the conversion of binary, octal and hexadecimal number system to its decimal equivalent:
Ex 1: Convert the binary number 1011.01 to its decimal equivalent.
Solution: 1011.01
= (1 x 2 ) + (0 x 2 ) + (1 x 2 ) + (1 x 2 ) + (0 x 2 ) + (1 x 2 )
3 2 1 0 -1 -2
= 8 + 0 + 2 + 1 + 0 + 1/4
Ans: = (11.25)10
Solution: 314
= (3 x 8 ) + (1 x 8 ) + (4 x 8 )
2 1 0
= 192 + 8 + 4
Ans: = (204)
10
Conversion from Decimal to Other Number System (Binary, octal and Hexadecimal
The general procedure for conversion of a decimal number system to any other system is given below:
Steps to Follow:
1. Note down the given Number. Divide the number by the base ‘r’ until there is nothing left, noting the remainder from each step. List
the remainder values in reverse order from bottom to top to find the equivalent.
2. If the given decimal number consists a decimal point, then we have to first separate out the integer and fractional part. Then convert
them separately to the desired radix and combine the converted parts to obtain the complete converted number.
The following examples demonstrate the conversion of decimal number system to other system
Study Material
<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU>: <Course Code:22320><Course Name: Digital Techniques><Topic
Name: Number Systems and code>
<UO1b.1.><study Material>
Course Expert: Mrs Rita Vora Date: 11/07/2020 Mentor: Mr. K. P. Akole
Co-ordinator: Mrs Nirmala
Kamble
Key words Learning Objective:. Rules :
Binary Addition, Binary To perform binary arithmetic operations: Binary Binary Addition
Subtraction, Binary Multiplication, Addition, Subtraction, Multiplication and Division 0+0=0
Binary Division. 0+1=1
1+0=1
Key Questions Concept Map 1 + 1 = Sum = 0, Carry = 1
Binary Subtraction
Do You know the rules for binary
addition and binary subtraction?
2) (110) -(010)
2 2
1 1 0
-010
1 0 0
Binary arithmetic includes the basic arithmetic operations of addition, subtraction, multiplication and division. Certain rules are to be
applied when these operations are performed on binary numbers.
Binary Addition: Binary addition is performed in the same way as addition in the decimal-system and is, in fact, much easier to master.
Binary addition obeys the following four basic rules:
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.
Binary Subtraction
Subtraction and Borrow, these two words will be used very frequently for the binary subtraction. There are four rules of binary
subtraction
When doing subtracting, it is sometimes necessary to borrow from the next higher-order column. The only it will be necessary to
borrow is when we try to subtract a 1 from a 0. In this case a 1 is borrowed from the next higher-order column, which leaves a 0 in that
column and creates a (10) that is 2 in the column being subtracted. The following examples illustrate binary subtraction.
2
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
Binary Division
Binary division is similar to decimal division. It is called as the long division procedure
Examples-Binary Division
Four Binary arithmetic operations: Binary Addition, Binary Subtraction, Binary Multiplication, Binary Division.
.
Study Material
<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU>: <Course Code:22320><Course Name: Digital Techniques><Topic Name:
Number Systems and code>
<UO1b.2.><study Material>
subtraction
(1110) - (1001)
2 2
2 −1 .
N−1
using 1's
complement.
Solution: 1’s
complement of i)
(1001) is (0110) .
2 2
ii)(1110) 2
+(0110) = 2
Application of 1’s complement method Link to YouTube/ OER/ video
1 0100. Computers
iii) Carry is 1 so Adders https://www.youtube.com/watch?v=kx8DFNf6pQU
add to 0100= Subtractors
0101 Digital Systems
So Answer is
(0101) 2
There is a simple algorithm to convert a binary number into 1’s complement. To get 1’s complement of a binary number, simply invert
the given number. You can simply implement logic circuit using only NOT gate for each bit of Binary number input. Implementation of
logic circuit of 4-bit 1’s complement is given as following below.
Step 3: If final carry is 1 then add it to the result of addition obtained in step 2. The carry is called end around carry. If carry is 1, then the
result of subtraction is (+ve) and in its true form.
Step 4: If the carry produced in step 2 is 0, then the result obtained is (–ve) and in 1’s complement form, so convert it into true form.
Examples where a smaller number is to be subtracted from a larger number:
i)Perform (9) – (4) using 1’s complement method.
10 10
Solution;
(9) = (1001)
10 2
(4) = (0100)
10 2
Minuend- 1 0 0 1
1’s complement of subtrahend 1 0 1 1
Carry over -🡪 1 0 1 0 0
Step 3: Add the final carry + 1
0 1 0 1
Answer is positive and in true form
The Answer is (0101) 2
Carry over🡪 1 0 0 1 1 1 1
0 1 0 0 0 0
ii) (1011.001) – (110.10)
2 2
Solution:
Step 1: 1’s complement of (0110.100) is (1001.011) 2 2
Carry over🡪 1 0 1 0 0 . 1 0 0
0 1 0 0 . 1 0 1
Solution:
Step 1: 1’s complement of (111001) is (000110) . Hence 2 2
Step 2: Minued - 1 0 1 0 1 1
Carry is 0 1 1 0 0 0 1
Step 3: Final carry is 0 so answer is negative and in 1’s complement form
So final answer is -(0011100) (1’s complement of (110001) )
2 2
Solution:
Step 1: 1’s complement of (11010.10) is (00101.01) 2 2
1’s complement method can be used for subtraction of two numbers in corresponding number systems and is simpler than Binary
Subtraction.
Study Material
<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU>: <Course Code:22320><Course Name: Digital Techniques><Topic Name:
Number Systems and code>
<UO1b.3.><study Material>
The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit (LSB) of 1's complement of the number.
Simply invert each bit of given binary number, then add 1 to LSB of these inverted numbers,
Example − Let we are using 5 bits registers. The representation of -5 and +5 will be as follows:
+5 is represented as it is represented in sign magnitude method. -5 is represented using the following steps:
(i) +5 = 0 0101
(ii) Take 2’s complement of 0 0101 and that is 1 1011. MSB is 1 which indicates that number is negative.
MSB is always 1 in case of negative numbers.
Range of Numbers −Fork bits register, positive largest number that can be stored is (2 -1) and negative lowest number that can be
(k-1)
The advantage of this system is that 0 has only one representation for -0 and +0. Zero (0) is considered as always positive (sign bit is 0)
in 2’s complement representation. Therefore, it is unique or unambiguous representation
With the help of subtraction by 2’s complement method we can easily subtract two binary numbers.
Step 3: If the final carry over of the sum is 1, it is dropped, and the result is positive.
Step 4: If there is no carry over, the two’s complement of the sum will be the result and it is negative.
(54) =(110110)
10 2
(22) =(10110)
10 2
Solution:
The numbers of bits in the subtrahend is 5 while that of minuend is 6. We make the number of bits in the subtrahend equal to that of
minuend by taking a `0’ in the sixth place of the subtrahend.
Now, 2’s complement of 010110 is (101101 + 1) i.e.101010. Adding this with the minuend.
Minuend1 1 0 1 1 0
Solution:
iii) (10110) – (110100)
2 2
Solution:
Minuend 1 0 1 1 0
Solution:
Minuend - 1 0 1 0 0 . 0 1
As there is no carry over the result of subtraction is negative and is obtained by writing the 2’s complement of 11000.11.
2’s complement of a binary number is obtained by adding 1 to 1’s complement of that number.
Negative numbers are represented by 2’s complement of their absolute values.
This method is most common method of representing signed integers on computers.
Study Material
<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU>: <Course Code:22320><Course Name: Digital Techniques><Topic
Name: Number Systems and code>
<UO1c. 1><study Material>
Key words Learning Objective: Conversion of Decimal Code to Binary Code, Gray
Code, BCD Code and Excess-3 Code
BCD code To apply code conversion from given number
Excess -3 code system into other specified code such as Gray
Gray code code, Excess-3 code, and ASCII code.
ASCII code
Q1. Convert the following as binary code. The binary code is represented by (3)10 to each code word in 8421.
binary number into Gray the number aswell as alphanumeric letter. Gray code: Itis defined as an ordering of the binary
code and Excess-3 code: Numeric codes are used to represent numbers. number system such that each incremental value
110100 , 1111 Alphanumeric codes are used to represent can only differ by one bit.
Gray code of 110100 is characters: Alphabetic letters and numerals.
101110
ASCII Code: ASCII Code (American Standard Code for
Excess-3 code is Adding
Information Interchange) is a 7-bit code and can
(33) to (52) which is
represent 2 = 128 possible characters and symbols.
10 10
7
0101
Gray code for 1111 is
1000
Excess-3 code is (1111) 2
Application of 1’s complement method Link to YouTube/ OER/ video
=(15) 10.
Computerapplications
Adding (33) to (15) gives
10 10 Digital communication https://nptel.ac.in/courses/108/105/108105132/
(48)
10 Analog to digital converters click on lecture 28
i.e 0100 1000 Error correction in digital communication
Rotary and Optical encoders https://www.tutorialspoint.com/
computer_logical_organization/
binary_codes.htm#:~:text=Error%20Correcting
%20Codes-,Weighted%20Codes,a%20group%20of
%20four%20bits.
Weighted Codes
Non-Weighted Codes
Reflective Codes
Sequential Codes
Alphanumeric Codes
Error Detecting and correcting Codes
Weighted Codes
Weighted binary codes are those binary codes which obey the positional weight principle. Each position of the number represents a
specific weight. Several systems of the codes are used to express the decimal digits 0 through 9. In these codes each decimal digit is
represented by a group of four bits. The examples are Binary and BCD code.
Non-Weighted Codes
In this type of binary codes, the positional weights are not assigned. The examples of non-weighted codes are Excess-3 code and Gray
code.
Alphanumeric codes
The alphanumeric codes are the codes that represent numbers and alphabetic characters. Mostly such codes also represent other
characters such as symbol and various instructions necessary for conveying information. An alphanumeric code should at least
represent 10 digits and 26 letters of alphabet i.e. total 36 items. The following three alphanumeric codes are very commonly used for
the data representation.
In the BCD, with four bits we can represent sixteen numbers (0000 to 1111). But in BCD code only first ten of these are used (0000 to
1001).
The remaining six code combinations i.e. 1010 to 1111 are invalid in BCD.
3 0011
5 0101
So (35) = (00110101)
10 BCD
Steps
Decimal Number − 29 10
Calculating BCD Equivalent. Convert each digit into groups of four binary digits equivalent.
Result
(11101) = (00101001)
2 BCD
Steps
Calculating Decimal Equivalent. Convert each four digits into a group and get decimal equivalent for each group.
Decimal Number − 29 10
Calculating Binary Equivalent −
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7/2 3 1
Step 4 3/2 1 1
Step 5 1/2 0 1
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).
Result
(00101001) = (11101)
BCD 2
BCD needs more number of bits than binary to represent the decimal number. So BCD is less efficient than binary.
Excess-3 code
The Excess-3 code is also called as XS-3 code. It is non-weighted code used to express decimal numbers.
The Excess-3 code words are derived from the 8421 BCD code words by adding (0011) or (3)10 to each code word in 8421
2
It is a sequential code because any code word can be obtained by adding binary 1 to its previous code.
In excess-3 code we get 9’s complement by just complementing each bit hence it is called self -complimenting code. The excess-3
codes are obtained as follows −
For example, to convert 15 to an excess-3 code, first 3 to be added to each digit as shown below .
Steps
(0110) = 6
BCD 10
(9) = (1001)
10 2
Result
(0110) = (1001)
BCD XS-3
Steps
Step 1 -- Subtract (0011) from each 4 bit of excess-3 digit to obtain the corresponding BCD code.
2
1 1 1 1 1
--------------------
BCD = 0 1 1 0 0 1 1 1
Result
(10011010) = (01100111)
XS-3 BCD
Gray code
It is also known as Cyclic Code, Reflected Binary Code (RBC), Reflected Binary (RB) or Grey code – is defined as an ordering of the binary
number system such that each incremental value can only differ by one bit.
In gray code, while traversing from one step to another step only one bit in the code group changes. That is to say that two adjacent
code numbers differ from each other by only one bit.
Gray code is the most popular of the unit distance codes, but it is not suitable for arithmetic operations.
Gray code has some applications in analog to digital converters, as well as being used for error correction in digital communication. Gray
codes are used in rotary and optical encoders.
Gray code to binary code conversion
Steps:
1. To convert Gray code to binary, bring down the most significant digit of the given Gray code number, because, the first digit or the
most significant digit of the Gray code number is same as the binary number.
2. To obtain the successive second binary bit, perform the EX-OR operation between the first bit or most significant digit of binary to the
second bit of the given Gray code.
3. To obtain the successive third binary bit, perform the EX-OR operation between the second bit or most significant digit of binary to
the third MSD (most significant digit) of Gray code and so on for the next successive binary bits conversion to find the equivalent
Example:
Binary code of (01101) Gray
Table shows the 4 bit binary code and 4 bit Gray code for the decimals numbers from 0 to 15.
ASCII Code
ASCII Code(American Standard Code for Information Interchange) is a 7-bit code and can represent 2 = 128 possible characters,
7
This code is sufficient to represent all the standard keyboard characters as well as control functions such as RETURN etc,
Table shows the partial listing of ASCII Code.
For example, ASCII Code for K is (1001011)2.
Key Take away
Classification of codes
BCD and Binary Codes are Weighted Codes
Gray and Excess-3 Codes are Non weighted codes
ASCII is Alphanumeric Code.
Conversion from one code to another.
Study Material
<Program Code: CO/CM/CW/DE/EJ/ET/EN/EX/EQ/IE/IS/IC/MU>: <Course Code:22320><Course Name: Digital Techniques><Topic Name:
Number Systems and code>
<UO1d. 1><study Material>
BCD Code (8421 Code): In BCD 8421 code, each decimal Key Definitions
Solved word digit is represented using a 4-bit binary number. The 4-
Problem bit binary numbers have their weights attached as 8, 4, BCD code: In this code each decimal digit is
2, 1 from MSB to LSB side. Since the weights are represented by a 4-bit binary number.
attached to it comes in the category of weighted
Q1.Add (57) and Numbers greater than 9 are invalid BCD numbers.
codes and is also sequential.
10
BCD is a binary code of the ten decimal digits. It is not a binary equivalent.
In the BCD, with four bits we can represent sixteen numbers (0000 to 1111). But in BCD code only first ten of these are used
(0000 to 1001).
The remaining six code combinations i.e. 1010 to 1111 are invalid in BCD.
BCD Representation
The number 6 is being added to the addition result in the above case instead of any other numbers. It is done to skip the six invalid
states of binary coded decimal that is from 10 to 15 and again return to the BCD codes.