0% found this document useful (0 votes)
9 views44 pages

Understanding Number Systems in Digital Circuits

The document provides an overview of number systems, focusing on decimal, binary, octal, and hexadecimal systems, including their bases, digit representations, and conversion methods. It explains the significance of binary in computing and details arithmetic operations on binary numbers. Additionally, it covers techniques like complements for subtraction and error detection in the decimal system.

Uploaded by

segeda6002
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views44 pages

Understanding Number Systems in Digital Circuits

The document provides an overview of number systems, focusing on decimal, binary, octal, and hexadecimal systems, including their bases, digit representations, and conversion methods. It explains the significance of binary in computing and details arithmetic operations on binary numbers. Additionally, it covers techniques like complements for subtraction and error detection in the decimal system.

Uploaded by

segeda6002
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Unit -I : Digital Circuits

Number System: Number System is a method of representing numbers with the help of a set of
symbols and rules; it is a mathematical notation used to represent quantities or values in various
forms.
• Humans understand decimal and computers understand binary, so we have two different
number systems.
• Binary can be long for large amount of data, so there are more systems like octal and
hexadecimal that allow binary sequence to be broken into groups making it less error-
prone and readable compared to binary.

As shown in the above Figure, binary is the foundation of all data representation in computers.
Let’s now explore the different number systems that enable this process.
Number systems provide a structured way to represent numbers, enabling arithmetic operations
and ensuring consistent, understandable notation.
• A number system uses a base (or radix) to represent values.
• The base refers to the number of unique digits, including zero, that a system uses to
represent numbers.
• Each system has its own set of rules for representing.

Types of Number Systems


• Number systems are of various types based on their base value and the number of
allowed digits.

Let's discuss the various types of number systems in detail, along with the solved examples.
Decimal Number System
• The Decimal Number System is the standard system for denoting numbers.
• It is also called the base-10 system.
• Digits used in it are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
• Each digit in the number is at a specific place value that is powers of 10.
• From right to left - units has the place value as 100, Tens has the place value as 101,
Hundreds as 102, Thousands as 103, and so on.
Example:
10285 can be written as
10285 = (1 × 104) + (0 × 103) + (2 × 102) + (8 × 101) + (5 × 100)
10285 = 1 × 10000 + 0 × 1000 + 2 × 100 + 8 × 10+ 5 × 1
10285 = 10000 + 0 + 200 + 80 + 5
10285 = 10285

Binary Number System


• Binary Number System is the number system with base 2.
• The numbers are formed using two digits - 0 and 1.
• Binary number system is very useful in electronic devices and computer systems
because it can be easily performed using just two state i.e. 0 and 1.
• Each digit in the number is at a specific place value that is powers of 2.
• From right to left - as powers of 2 i.e. 20, 21, 22, etc).
• Binary Numbers can be converted to Decimal value by multiplying each digit with the
place value and then adding the result.
Example:
(1011)₂ can be written as
(1011)₂ = 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰
(1011)₂ = 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1
(1011)₂ = 11 (in decimal)
Octal Number System
• Octal Number System is the number system with base 8.
• The numbers are formed using 8 digits i.e. 0, 1, 2, 3, 4, 5, 6, 7.
• Octal number system is useful for representing file permissions in Unix/Linux
operating systems.
• Each digit in the number is at a specific place value that is powers of 8.
• From right to left - as powers of 8 i.e. 80, 81, 82, etc.
• Octal Numbers can be converted to Decimal value by multiplying each digit with the
place value and then adding the result.
Example:
(325)8 can be written as: (325)8 = 3 × 8² + 2 × 8¹ + 5 × 8⁰
(325)8 = 192 + 16 + 5 , (325)8 = 213 (in decimal)
Hexadecimal Number System
• Hexadecimal Number System is the number system with base 16.
• The numbers are formed using 16 digits i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and
F.
• Hexadecimal Numbers are useful for handling memory address locations.
• The digits from 0 to 9 are used as in the decimal system, but the numbers 10 to 15 are
represented using the letters A to F as follows: 10 is represented as A, 11 as B, 12 as
C, 13 as D, 14 as E, 15 as F.
• ii. Place Value: the position of the digit. Each digit in the number is at a specific place
value that is powers of 16. (from right to left - as powers of 16 i.e. 160, 161, 162, etc)
Hexadecimal Number System an be converted to Decimal value by multiplying each digit
with the place value and then adding the result.
Example:
(2F)16 can be written as :(2F)16 = 2 × 16¹ + F × 16⁰
(2F)16 = 2 × 16 + 15 × 1 , (2F)16 = 32 + 15 , (2F)16= 47 (in decimal)

Conversion of one number system into another :


Decimal Number System
A number system is a method for representing numbers, defined by its base or radix. The decimal
number system, also known as base-10, is the number system we use every day for tasks like
counting people, tracking scores, or tallying votes. It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and
9.
In this system, each digit’s value depends on its position in the number. The image below
illustrates this with the number 1234.567:

Positional Breakdown in the Decimal System


Explanation: In the number 1234.567 :
• Starting from the left, 1 is in the thousands place (1 × 10³ = 1000),
• 2 is in the hundreds place (2 × 10² = 200),
• 3 is in the tens place (3 × 10¹ = 30),
• 4 is in the ones place (4 × 10⁰ = 4). After the decimal point, 5 is in the tenths place (5 ×
10⁻¹ = 0.5),
• 6 is in the hundredths place (6 × 10⁻² = 0.06),
• 7 is in the thousandths place (7 × 10⁻³ = 0.007).
Adding these together (1000 + 200 + 30 + 4 + 0.5 + 0.06 + 0.007) gives the total value, 1234.567.
Note : Right most bit is the least significant bit (LSB), and leftmost bit is the most significant bit
(MSB). The table below highlights these positions:

Conversion from Decimal to Other Number Systems


To convert decimal to another base, divide by the target base, record remainders from right to
left until the quotient is 0, then specify the base for each section (binary: base-2, octal: base-8,
hexadecimal: base-16 with A–F for 10–15).
Decimal to Binary Conversion
To see how a decimal number is converted to binary, consider the following example:

Binary numbers use base-2. To convert a decimal number to binary, follow the steps given below:
• Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to binary, hence the divisor will be 2.
• Step 2: The remainder obtained from the division will become the least significant digit
of the new number.
• Step 3: The quotient obtained from the division will become the next dividend and will
be divided by the base i.e. 2.
• Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added to the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the remainders
obtained after each iteration are added to the left of the existing digits.
After all the iterations are over, the last obtained remainder will be termed as the Most Significant
digit.
Decimal to Octal Conversion
Let’s look at an example of converting a decimal number to octal:

Octal numbers use base-8. Here’s the process:


• Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to octal, hence the divisor will be 8.
• Step 2: The remainder obtained from the division will become the least significant digit
of the new number.
• Step 3: The quotient obtained from the division will become the next dividend and will
be divided by base i.e. 8.
• Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added to the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the remainders
obtained after each iteration are added to the left of the existing digits.
Decimal to Hexadecimal Conversion
Here’s an example of converting a decimal number to hexadecimal:

Hexadecimal uses base-16, with digits 0–9 and A–F (where A = 10, B = 11, C = 12, D = 13, E =
14, F = 15). Follow these steps:
• Step 1: Divide the Decimal Number with the base of the number system to be converted
to. Here the conversion is to Hex hence the divisor will be 16.
• Step 2: The remainder obtained from the division will become the least significant digit
of the new number.
• Step 3: The quotient obtained from the division will become the next dividend and will
be divided by base i.e. 16.
• Step 4: The remainder obtained will become the second least significant digit i.e. it will
be added to the left of the previously obtained digit.
Now, the steps 3 and 4 are repeated until the quotient obtained becomes 0, and the remainders
obtained after each iteration are added to the left of the existing digits.
NOTE: If the remainder is 10–15, use A–F (e.g., A = 10, B = 11, C = 12, D = 13, E = 14, F =
15).
Beyond conversions, the decimal system also supports techniques like complements, used in
subtraction and error detection.
9’s and 10’s Complement of Decimal (Base-10) Number
Complements are used in number systems to simplify subtraction and error detection in digital
systems. In the decimal system, the 9’s complement and 10’s complement are commonly used.
Steps to Find 9’s Complement: Steps to Find 10’s Complement:
1. Write the given decimal number. 1. Find the 9’s complement of the
number.
2. Subtract each digit from 9.
2. Add 1 to the least significant digit
Example : 9’s Complement of 2020
(LSB).
9-2=7
Example : 10’s Complement of 2020
9-0=9
• 9’s complement of 2020 = 7979
9-2=7
• Adding 1: 7979 + 1 = 7980
9-0=9
Thus, the 10’s complement of 2020 is 7980
Thus, the 9’s complement of 2020 is 7979.

Binary Number System


The Binary Number System, also known as the base-2 system, uses only two digits, '0' and '1',
to represent numbers. It forms the fundamental basis for how computers process and store data.
This base-2 system is the backbone of how computers process and store information, representing
everything from text to images as sequences of 0s and 1s.
The binary number (11001)₂ corresponds to the decimal number 25.
The word binary is derived from the word "bi," which is Latin for "two". But what makes it so
essential, and how does it work? This article will dive deep into binary numbers, binary decimal
number conversion and vice versa, 1's and 2's complements, and how they are used in computer
systems.
Binary Number Table
Given below is the decimal number and the binary equivalent of that number.
Conversion from Binary to Other Number Systems
Binary numbers use digits 0 and 1 and have a base of 2. Converting a binary number to another
number system involves changing its base. The following outlines the conversion of binary
numbers to other number systems:
Binary to Decimal Conversion
A binary number is converted into a decimal number by multiplying each digit of the binary
numbers 1 or 0 to the corresponding to the power of 2 according to the place value.
Let us consider that a binary number has n digits, B = an-1...a3a2a1a0. Now, the corresponding
decimal number is given as:

Let us go through an example to understand the concept better.


Example: To convert (11101011)2 into a decimal number.

Steps:
• Step 1: Multiply each digit of the Binary number with the place value of that digit, starting
from right to left i.e. from LSB to MSB.
• Step 2: Add the result of this multiplication and the decimal number will be formed.

Binary to Octal Conversion


Binary numbers have a base of 2, while octal numbers have a base of 8. To convert a binary
number to an octal number, the base is changed from 2 to 8.
Example: To convert (11101011)2 into an octal number.
Steps:
•Step 1: Divide the binary number into groups of three digits starting from right to left i.e.
from LSB to MSB.
• Step 2: Convert these groups into equivalent octal digits.
Binary to Hexadecimal Conversion
Binary numbers have a base of 2, while hexadecimal numbers have a base of 16. To convert a
binary number to a hexadecimal number, group the digits appropriately and convert to the
corresponding hexadecimal value.
Example: To convert (1110101101101)2 into a hex number.

Steps:
Step 1: Divide the binary number into groups of four digits starting from right to left i.e.

from LSB to MSB.
• Step 2: Convert these groups into equivalent hex digits.
Arithmetic Operations on Binary Numbers
We can easily perform various operations on Binary Numbers. Various arithmetic operations on
the Binary number include,
• Binary Addition
• Binary Subtraction
• Binary Multiplication
• Binary Division
Now, let's learn about the same in detail.
Binary Addition
The result of the addition of two binary numbers is also a binary number. To obtain the result of
the addition of two binary numbers, we have to add the digits of the binary numbers digit by
digit. The table below shows the rules of binary addition.

Binary Number (1) Binary Number (2) Addition Carry


0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Example: Find (1101)2 + (1011)2 = ?
1 1 0 1(13 in decimal)
+ 1 0 1 1(11 in decimal)
1 1 0 0 0(24 in decimal)
Binary Subtraction
The result of the subtraction of two binary numbers is also a binary number. To obtain the result
of the subtraction of two binary numbers, we have to subtract the digits of the binary numbers
digit by digit. The table below shows the rule of binary subtraction.
Binary Number (1) Binary Number (2) Subtraction Borrow

0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0

Example: Find (1011)2 - (1110)2 = ?


1 1 1 0(14 in decimal)
− 1 0 1 1(11 in decimal)
0 0 1 1(3 in decimal)
Binary Multiplication
The multiplication process of binary numbers is similar to the multiplication of decimal numbers.
The rules for multiplying any two binary numbers are given in the table.
Binary Number (1) Binary Number (2) Multiplication
0 0 0
0 1 0
1 0 0
1 1 1

Example: Find (101)2 ⨉ (11)2 = ?


Binary Division
The division method for binary numbers is similar to that of the decimal number division method.
Let us go through an example to understand the concept better.
Example: Find (11011)2 ÷ (11)2 = ?

1's and 2's Complement of a Binary Number


• 1's Complement of a Binary Number is obtained by inverting the digits of the binary
number.
Example: Find the 1's complement of (10011)2.
Solution: Given Binary Number is (10011)2
Now, to find its 1's complement, we have to invert the digits of the given number.
To find the 1's complement of a binary number, you simply flip all the bits:
Thus, 1's complement of (10011)2 is (01100)2
• 2's Complement of a Binary Number is obtained by inverting the digits of the binary
number and then adding 1 to the least significant bit.
Example: Find the 2's complement of (1011)2.
Solution: Given Binary Number is (1011)2
To find the 2's complement, first find its 1's complement, i.e., (0100)2
Now, by adding 1 to the least significant bit, we get (0101)2
Hence, the 2's complement of (1011)2 is (0101)2
Uses of the Binary Number System
Binary Number Systems are used for various purposes, and the most important use of the
binary number system is,
• Binary Number System is used in all Digital Electronics for performing various
operations.
• Programming Languages use the Binary Number System for encoding and decoding data.
• Binary Number System is used in Data Sciences for various purposes, etc.
Solved Example of the Binary Number System
Example 1: Convert the Decimal Number (98) 10 into Binary.
Solution:
Thus, Binary Number for (98) 10 is equal to
(1100010)2

Example 2: Convert the Binary Number (1010101)2 to a decimal Number.


Solution:

Example 3: Divide (11110)2 by (101)2. Example 4: Add (11011) 2 and (10100)2.


Solution: Solution:

Hence, (11011)2 + (10100)2 = (101111)2


Example 5: Subtract (11010) 2 and Example 6: Multiply (1110)2 and (1001)2.
(10110)2. Solution:
Solution:

Hence, (11010)2 - (10110)2 = (00100)2


Thus, (1110)2 × (1001)2 = (1111110)2
Example 7: Convert (28)10 into a binary number.
Solution:

Hence, (28)10 is expressed as (11100)2.

Example 8: Convert (10011)2 to a decimal number.


Solution:

Practice Problem Based on Binary Number


Question 1. Convert the decimal number (98)₁₀ into binary.
Question 2. Divide the binary number (11110)₂ by (101)₂
Question 3. Find the 2's complement of the binary number (1011)₂.
Question 4. Multiply the binary numbers (1110)₂ and (1001)₂.
Question 5. Subtract the binary numbers (11010)₂ and (10110)₂.
Question 6. Add the binary numbers (11011)₂ and (10100)₂.
Answer:-
1. (1100010)2, 2. (110)2, 3. (0101)2, 4. (1111110)2, 5. (00100)2, 6. (101111)2
Octal Number System
The octal number system is a base-8 system using digits (0–7): 0, 1, 2, 3, 4, 5, 6, and 7.
For example: 228, 138, 178, etc, are octal numbers.
It is widely used in computer programming as a compact representation of binary numbers, where
each octal digit corresponds to three binary digits.
In this article, we will discuss the Octal Number System, Octal Number System Conversions,
Octal Number System Examples, and Others in detail.
Octal Number System Table
The table below shows the relationship between octal and binary numbers (each octal digit
represents 3 bits in binary):

'OCTAL' is derived from the Latin word 'OCT' which means Eight. The number system with
base 8 and symbols ranging between 0-7 is known as the Octal Number System. Each digit of an
octal number represents a power of 8. It is widely used in computer programming and digital
systems. Octal number system can be converted to other number systems and visa versa.
For example, an octal number (10)8 is equivalent to 8 in the decimal number system, 001000 in
the binary number system and 8 in the hexadecimal number system.
Now, we will learn about the conversion of octal number system to other number systems one by
one.
Conversion from Octal to Other Number Systems
Octal Numbers are represented with digits 0-7 and with base 8. Conversion of a number system
means conversion from one base to another. Following are the conversions of the Octal Number
System to other Number Systems:
Octal to Decimal Conversion
Octal numbers are represented in base 8, but the decimal numbers are of base 10. Hence, to
convert an octal number to a decimal number, the base of that number is to be changed.
Example: (247)8 is to be converted to decimal:
• Step 1: Multiply each digit of the Octal number with the place value of that digit, starting
from right to left i.e. from LSB to MSB.
• Step 2: Add the result of this multiplication and the decimal number will be formed.
Octal to Binary Conversion
Octal numbers are represented in base 8, but the binary numbers are of base 2. Hence, to convert
an octal number to a binary number, the base of that number is to be changed.
Example: (247)8 is to be converted to binary

Follow the steps given below:


• Step 1: Write each digit of the octal number separately.
• Step 2: Convert each digit into an equivalent group of three binary digits.
• Step 3: Combine these groups to form the whole binary number.

Octal to Hexadecimal Conversion


Octal numbers are represented in base 8, but the hexadecimal numbers are of base 16. Hence, to
convert an octal number to a hex number, the base of that number is to be changed.
Example: (5456)8 is to be converted to hex

• Step 1: We need to convert the Octal number to Binary first. For that, follow the steps
given in the above conversion.
• Step 2: Now to convert the binary number to Hex number, divide the binary digits into
groups of four digits starting from right to left i.e. from LSB to MSB.
• Step 3: Add zeros before MSB to make it a proper group of four digits(if required)
• Step 4: Now convert these groups into their relevant decimal values.
• Step 5: For values from 10-15, convert it into Hex symbols i.e from A-F
Decimal to Octal Conversion
The image added below shows binary to octal conversion.

To convert a decimal number to an octal number follow these simple steps:


• Step 1: Divide the given decimal number by 8.
• Step 2: Write down the quotient and remainder obtained.
• Step 3: Divide the quotient obtained by 8.
• Step 4: Repeat step 2 and step 3 until the quotient becomes 0.
• Step 5: Write the obtained remainder in reverse order.

Octal Multiplication Table


Octal Multiplication table is added below,
× 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 1 2 3 4 5 6 7
2 0 2 4 6 10 12 14 16
3 0 3 6 11 14 17 22 25
4 0 4 10 14 20 24 30 34
5 0 5 12 17 24 31 36 43
6 0 6 14 22 30 36 44 52
7 0 7 16 25 34 43 52 61

Solved Examples on Octal Numbers System


Example 1: What is Decimal Equivalent of 11218?
Example 2: Convert 278 into the binary number.

Example 3: Find the octal equivalent of 10010012.

Example 4: Represent 1238 as a Decimal Number.

Practice Questions on Octal Number System


Question 1: Convert 12110 to an octal number.
Question 2: What is Octal Value of 1000100002?
Question 3: Find the Decimal Equivalent of 558.
Question 4: Convert 12F16 to Octal number.
Question 5: What will be the binary value of 578?
Answer Key: 171 , 420, 45, 457, 101111
Hexadecimal Number System
The Hexadecimal system is a base-16 number system that plays an important role in computing
and digital systems. It uses sixteen symbols to represent values:

Hexadecimal Number System Table


Place Value of Digits in the Hexadecimal Number System
The numbers in the hexadecimal number system have weightage in powers of 16. The power of
16 increases as the digit is shifted towards the left of the number. This is explained by the
example as,

Conversion from Hexadecimal to Other Number Systems


Conversion of a number system means conversion from one base to another. Following are the
conversions of the Hexadecimal Number System to other Number Systems:
Hexadecimal to Decimal Conversion: To convert a hexadecimal number to decimal (base-10),
multiply each digit by its corresponding power of 16 and sum the results.
Example: To convert (8EB4)16 into a decimal value
• Step 1: Write the decimal values of the symbols used in the Hex number i.e. from A-F
• Step 2: Multiply each digit of the Hex number with its place value. Starting from right to
left i.e. LSB to MSB.
• Step 3: Add the result of multiplication and the final sum will be the decimal number.

Hexadecimal to Binary Conversion: Each hexadecimal digit corresponds to a 4-bit binary


sequence. Convert each digit individually and combine.
Example: (B2E)16 is to be converted to binary

• Step 1: Convert the Hex symbols into their equivalent decimal values.
• Step 2: Write each digit of the Hexadecimal number separately.
• Step 3: Convert each digit into an equivalent group of four binary digits.
• Step 4: Combine these groups to form the whole binary number.

Hexadecimal to Octal Conversion: Convert hexadecimal to binary, group the binary digits into
sets of three (right to left), and convert each group to its octal equivalent.
Example: (B2E)16 is to be converted to hex
• Step 1: We need to convert the Hexadecimal number to Binary first. For that, follow the
steps given in the above conversion.
• Step 2: Now to convert the binary number to an Octal number, divide the binary digits
into groups of three digits starting from right to left i.e. from LSB to MSB.
• Step 3: Add zeros before MSB to make it a proper group of three digits(if required)
• Step 4: Now convert these groups into their relevant decimal values.

Decimal to Hexadecimal Conversion : Divide the decimal number by 16 repeatedly, noting


remainders, until the quotient is 0. Read remainders in reverse order, using A–F for 10–15.

Facts About Hexadecimal Numbers


• Hexadecimal is a number system with a base value of 16.
• Hexadecimal numbers use 16 symbols or digital values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C,
D, E, F.
• A, B, C, D, E, and F represent 10, 11, 12, 13, 14, and 15 in single-bit form.
• If you see an "0x" as a Prefix, it indicates the number is in Hexadecimal. For example,
0x3A
• The position of each digit in a Hexadecimal number has a weight of 16 to the power of its
position.
Solved Examples on Hexadecimal Number System
Example 1: Convert Hexadecimal 1A5 to Decimal
Solution:

Example 2: Convert Decimal 315 to Hexadecimal.


Solution:
Example 3: Convert (1F7)16 to Octal.
Solution:

Example 4: Convert (A7B)16 to decimal.

Practice Questions on Hexadecimal Number System


Question 1: Convert the hexadecimal number 2A to binary.
Question 2: Convert the binary number 110110 to hexadecimal.
Question 3: Add the hexadecimal numbers 1F and A3. Provide the result in hexadecimal.
Question 4: Subtract the hexadecimal number B6 from D9. Provide the result in hexadecimal.
Question 5: Multiply the hexadecimal number 7E by 3. Provide the result in hexadecimal.
Answer Key : 1. 101010 2. 36 3.C2 4.23 5.17A
Binary Coded Decimal (BCD) Addition
BCD or Binary Coded Decimal is a coding scheme used to represent decimal number (0 to 9) in
the form of binary digits of a group of 4-bits. Binary coded decimal is the simplest form to
convert decimal numbers into their equivalent binary format. Although, binary coded decimal or
BCD is not the same as the normal binary representation.
In binary coded decimal (BCD) coding scheme, each decimal digit is represented as a group of 4-
bit binary number. For a multi-digit decimal number, each digit of the decimal number is
encoded separately in the BCD.
As we know, a 4-bit binary number can represent 16 decimal digits, but in binary coded decimal,
BCD codes 1010, 1011, 1100, 1101, 1110, and 1111 equivalent to decimal 10, 11, 12, 13, 14, and
15 are considered illegal combinations.
Decimal to Binary Coded Decimal Truth Table
The following is the truth table representing binary coded decimal (BCD) equivalent of decimal
digits from 0 to 9
Decimal Digit Binary Coded Decimal Code
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

Let's now understand how to convert a given decimal number into its equivalent binary coded
decimal.
Example: Decimal to Binary Coded Decimal Conversion
The following example shows how a decimal number is converted to a BCD code ?
Convert (125)10 into its equivalent binary coded decimal (BCD) code.

Decimal number 1 2 5

BCD Weights 8 4 2 1 8 4 2 1 8 4 2 1

BCD Code 0 0 0 1 0 0 1 0 0 1 0 1

Hence, the binary coded decimal for (125)10 is (0001 0010 0101).
Binary Coded Decimal Addition
Binary coded decimal addition follows the rules of binary arithmetic, however there are some
extra things that require to be taken care of. The BCD addition of two BCD numbers is
performed as per the following steps
• Step 1 Perform addition of two BCD numbers by following the rules of binary addition.
• Step 2 If the result or sum is a 4-bit binary number which is less than or equal to 9, then
the sum is a valid BCD number.
• Step 3 If the sum is a 4-bit number that is greater than 9 or if a carry is generated, then it
is an invalid sum.
• Step 4 To obtain the corrected result/sum, add 6 (0110) to the 4-bit invalid sum. If a carry
is generated when 6 is added, then propagate and add this carry to the next 4-bit group.
This step is done to skip the six illegal BCD codes (i.e. 1010, 1011, 1100, 1101, 1110, and
1111).

Rules of Binary Addition


The following are the rules used to perform binary addition of two binary digits
First Bit Second Bit Result
0 0 0 + 0 = 0; no carry
0 1 0 + 1 = 1; no carry
1 0 1 + 0 = 1; no carry
1 1 1 + 1 = 0; carry = 1

After getting the knowledge of BCD addition and rules of binary addition, let us now consider
some solved examples to understand the BCD addition in detail.
Example 1
Perform the addition 30 + 15 in BCD scheme.
Solution : Given decimal numbers and their equivalent BCD representation is,
(30)10 = (0011 0000)BCD
(15)10 = (0001 0101)BCD
The BCD addition of the given numbers is as below

30 0011 0000

+ 15 + 0001 0101

45 0100 0101

Example 2
Perform addition 678 + 535 in Binary Coded Decimal.
Solution : Given decimal numbers and their BCD representation is,
• (678)10 = 0110 0111 1000
• (535)10 = 0101 0011 0101
The BCD addition is as below

678 0110 0111 1000

+ 535 + 0101 0011 0101

1213 1011 1010 1101 (All are illegal codes)

+ 0110 0110 0110 (Add 0110 to each)

1 0001 1 0000 1 0011 (Propagate carry)

+1 1 1

0001 0010 0001 0011 (Corrected Sum = 1213)

Tutorial Problems
• Find the sum of BCD numbers (0001 1001) and (0100 1000).
• Find the sum of decimal number 25 and 35 in BCD.

Conclusion
In conclusion, BCD addition is performed by adding individual digits of the decimal numbers
represented in 4-bit binary groups starting from the right most digit. If the sum term is not an
illegal BCD code and there is no carry output, then no correction is required. If the sum term is
an illegal BCD code or if a carry is produced, then 6 (0110) is added to the sum term of the group
to correct the result.
Logic gates :

• Logic gates are the switches that turn ON or OFF depending


on what the user is doing!
• They are the building blocks for how computers work.
• Logic gates turn ON when a certain condition is true, and OFF when the
condition is false
– They check whether or not the information they get follows a certain
rule
• They either spit out the answer true (ON) or false (OFF)
– Remember: True= ON = 1 & False = OFF=0

Example :
Let’s say a certain logic two
numbers are equal
The rule would be “is equal”
If the two input numbers are
equal, it will go into its ON
position, indicating true

If they are not equal, it will go


into its OFF position,
indicating false

But we learned before that computers only think of things in terms of ON and OFF,
which to them is 1 and 0
So a computer wouldn’t take an input of 5 or 6 – all of the information need to be 0s and
1s
Reminder:
Input refers to the information you give the logic gate, and output refers to what it
spits out!
Let’s try this example again, keeping this rule in mind!
NOT gate truth table :

Input Output

A Y=
A
0 1
1 0

AND gate Truth Table :

Input Output
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1

OR gate Truth Table :

Input Output
A B Y=A+
B
0 0 0
0 1 1
1 0 1
1 1 1
LOGIC GATES USING SWITCH

NOT GATE USING SWITCH


NOT gate is different from above gate in such a manner, we need only 1 input, that’s why we are
using only 1 button (input device). And for output LED is used. We connect buttons
in parallel for NOT Gate. NOT gate is also known as a logic inverter.
• Here, when you press the button it means input logic is “1”, In that case LED will not
glow means output is logic “0”.
• And, when you don’t press the button it means input logic is “0”, In that case LED
will glow means output is logic “1”.
Reason resistor connected before button because voltage needs to drop at some resistance to flow
current. If we connect the resistor after the button then as you press the button the battery is short
circuited.
So we can say our circuit follows the NOT gate truth table.

NOT Gate using Switch


AND GATE USING SWITCH
As we know 2 input AND gate needs, 2 input device, that’s why we are using 2 button (input
device). And we need an output device that is LED. We connect buttons in series for AND Gate.
• So when both buttons are not pressed it means input logic is “0 and 0”, In that case LED
will not glow.
• When any button is not pressed, the LED will not glow, it means the logic is “0 and 1” or “1
and 0”.
• Only when both buttons get pressed logic are “1 and 1”, LED will glow as seen in image
below. So we can say our circuit follows the AND gate truth table.
OR GATE USING SWITCH
Similarly, we know 2 input OR gate needs, 2 input devices, that’s why we are using 2 buttons
(input device). And we need an output device that is LED. We connect buttons in parallel for OR
Gate.
• Here, when both buttons are unpressed it means input logic is “0 and 0”, In that case LED will
not glow.
• When any button is pressed, the LED will glow, it means the logic is “0 and 1” or “1 and 0”.
• And, when both buttons get pressed, the logic is “1 and 1”, the LED will glow as seen in the
image below.
So we can say our circuit follows the OR gate truth table.

OR Gate using Switch


Universal gates : NAND and NOR
NAND gate and NOR gate can be termed as universal logic gates since any arbitrary Boolean
function can be implemented using NAND gate or NOR gate alone. This makes NAND and NOR
universal gates for developing every other digital logic gates in the technological world.
NAND Gate
A NAND gate is a combination of an AND gate followed by a NOT gate. It outputs a 0 only
when all its inputs are 1; otherwise, it outputs 1.
Symbol and Truth Table

NOR Gate
A NOR gate is a combination of an OR gate followed by a NOT gate. It outputs a 1 only
when all its inputs are 0; otherwise, it outputs 0.
Symbol and Truth Table
Realizing Basic Gates Using NAND and NOR
1) NOT gate using NAND gate

2) AND gate using NAND gate


Truth Table:
A B Z=A
AND B
0 0 0
0 1 0
1 0 0
1 1 1

3) OR gate using NAND gate


Truth Table:
A B OUTPUT
= A OR B
0 0 0
0 1 1
1 0 1
1 1 1

4) NOR gate using NAND gate


Truth Table:
A B Z = A NOR B
0 0 1
0 1 0
1 0 0
1 1 0
Implementing Basic Gates using NOR Gate
We will see Implementing Basic Gates using NOR Gate :
1) NOT Gate (Inverter) using NOR gate Circuit: Connect both inputs of a NOR gate to the
same input signal.
Truth Table:

A OUTPUT
(NOT A)
0 1
1 0

2) AND gate using NOR gate : Circuit: Use three NOR gates. First, connect each input to a
NOR gate and then connect their outputs to the inputs of another NOR gate.
Truth Table:

A B OUTPUT
Y = A AND B
0 0 0
0 1 0
1 0 0
1 1 1

3) OR gate using NOR gate : Circuit: Use a combination of NOR gates, with the final gate
configured as a OR gate.
Truth Table:

A B OUTPUT
= A OR B
0 0 0
0 1 1
1 0 1
1 1 1

4) NAND gate using NOR gate


Truth Table:

A B OUTPUT
Y = A NAND B
0 0 0
0 1 0
1 0 0
1 1 1
Special Purpose Gates : (EX-OR, EX-NOR) X-OR, X-NOR
An XOR gate is a difference detector. It produces a HIGH (1) output only when its inputs are
different from each other.
An XNOR gate is an equality detector. It produces a HIGH (1) output only when its inputs are
the same.

X-OR gate :
“XOR” an abbreviation for “Exclusively-OR.” The simplest XOR gate is a two-input digital
circuit that outputs a logical “1” if the two input values differ, i.e., its output is a logical “1” if
either of its inputs are 1, but not at the same time (exclusively).

Input Output
A B Y= A XOR B
0 0 0
0 1 1
1 0 1
1 1 0

X-OR gate using NAND gate

Truth Table:

A B OUTPUT
= A XOR B
0 0 0
0 1 1
1 0 1
1 1 0

X-OR gate using NOR gate

Truth Table:

A B OUTPUT
= A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
X-NOR gate :
X-NOR gate using NAND gate
Truth Table:

A B OUTPUT
= A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1

X-NOR gate using NOR gate


Truth Table:

A B OUTPUT
= A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1

Applications of Universal Logic Gates


• Computer processors: NAND or NOR gates serves as the basic building block
for microprocessors and other ICs incorporating complex functionalities.
• Simple logic circuits: Universal gates enable any Boolean function to be computed using
the gate of a single type in the circuitry design.
• Programmable logic devices (PLDs): FPGAs for instance, incorporate logic functions
based on look-up tables which are constructed from for NAND or NOR gates defined by
the customer.
• Minimalist circuit design: It becomes possible for engineers to develop circuits containing
the fewest components as they can design circuits with the help of only NAND or NOR
gates.
• Universal gates can be wired together to form standard digital subcircuits such as
arithmetic circuits like adder circuits, circuits for decoding and
encoding, multiplexer and demultiplexer circuits etc.
• The controllability of inputs and scalability of outputs enable the subsequent logic for
addition, flip flops, and memory etc.
Conclusion
From this article we can understand why NAND and NOR gates are considered to be unique in
the realm of digital logic design, as they are reversible. From the above simple implementation of
the universal gate, it was clear that all the gates such as NOT, AND, OR, XOR AND XNOR and
any other Boolean logic function can be implemented. To be able to perform all of the basic
logical operations with just one gate type also makes integrated circuit fabrication easier and
requires fewer parts.
Multiplexer & Demultiplexer :
Multiplexers
Introduction : Block Diagram : (n:1 Multiplexer)
Multiplexer is a special type of combinational
circuit. There are n-data inputs, one output and m
select inputs with 2m = n. It is a digital circuit
which selects one of the n data inputs and routes it
to the output. The selection of one of the n inputs
is done by the selected inputs. Depending on the
digital code applied at the selected inputs, one out
of n data sources is selected and transmitted to the
single output Y. E is called the strobe or enable
input which is useful for the cascading. It is
generally an active low terminal that means it will
perform the required operation when it is low.

2:1 multiplexer Truth Table

Enable(E) = 1

S1 Y(Output)
0 T1
1 T2

4:1 Multiplexer
The 4 : 1 multiplexer has 4 inputs and 2
control signals.
Truth Table
Enable(E) = 1

S1 S2 Y(Output)
0 0 T1
0 1 T2
1 0 T3
1 1 T4
8 : 1 multiplexer
The 8 : 1 multiplexer has 8 inputs and 3
control signals.
Truth Table:
Enable(E) = 1

S1 S2 S3 Y(Output)
0 0 1 T1
0 1 0 T2
0 1 1 T3
0 1 1 T4
1 0 1 T5
1 1 0 T6
1 1 1 T7
1 1 1 T8

Similarly16 : 1 multiplexer has 16 inputs


We can also implement a 8 : 1 multiplexer by
and 4 control signals.
chaining two 4 : 1 multiplexers as shown
It can be implemented with two 8 : 1
multiplexers:
It can also be implemented with five 4 : 1
multiplexers:

Applications of Multiplexers
• Transmission from the Computer System of a Satellite - Multiplexer is used to transmit
the data signals from the computer system of a spacecraft or a satellite to the ground
system by using a GSM satellite.
• Computer Memory - Multiplexers are used in computer memory to maintain a huge
amount of memory in the computers, and also to reduce the number of copper lines
required to connect the memory to other parts of the computer.
• Telephone Network - In telephone networks, multiple audio signals are integrated on a
single line of transmission with the help of a multiplexer.
Demultiplexers
Introduction
A demultiplexer performs the reverse operation of a multiplexer i.e. it receives one input and
distributes it over several outputs. It has only one input, n outputs, m select input. At a time only
one output line is selected by the select lines and the input is transmitted to the selected output
line. A de-multiplexer is equivalent to a single pole multiple way switch as shown in fig.
Demultiplexers in multiple variations.
1 : 2 demultiplexer 1: 4 demultiplexer

Truth table S1 S0
1 : 8 demultiplexer - 1 : 16 demultiplexer – A 1 : 16 demultiplexer
can be implemented using two 1 : 8
demultiplexers.

Applications of Demultiplexers
• Arithmetic Logic Unit - The output of the ALU is fed as an input to the De-multiplexer,
and the output of the demultiplexer is connected to a multiple register. The output of the
ALU can be stored in multiple registers.
• Serial to Parallel Converter - In this technique, serial data is given as an input to the De-
multiplexer at a regular interval, and a counter is attached to the demultiplexer at the
control input to detect the data signal at the output of the demultiplexer. When all data
signals are stored, the output of the demux can be read out in parallel.

Working of 1:4 demultiplexer can be understood using simple logic gates as shown below.
FLIP-FLOP
The flip-flop is a circuit that maintains a state until directed by input to change the state. A basic
flip-flop can be constructed using four-NAND or four-NOR gates. A flip-flop is popularly known
as the basic digital memory circuit. It has its two states as logic 1(High) and logic 0 (Low) states.
• A flip-flop is a sequential circuit which consists of a single binary state of information or
data.
• The digital circuit is a flip-flop which has two outputs and are of opposite states. It is also
known as a Bistable Multivibrator.
Types of Flip-Flops :
• SR Flip Flop • JK Flip Flop
• D Flip Flop • T Flip Flop

Logic diagrams and truth tables of the different types of flip-flops are as follows:
S-R Flip Flop
In the flip flop, with the help of preset and Block Diagram of S-R Flip Flop
clear when the power is switched ON, the
states of the circuit keeps on changing, that is
it is uncertain. It may come to set(Q=1) or
reset(Q’=0) state. In many applications, it is
desired to initially set or reset the flip flop that
is the initial state of the flip flop that needs to
be assigned. This thing is accomplished by the
preset(PR) and the clear(CLR).

Circuit Diagram and Truth Table of S-R Flip Flop


Given Below is the Diagram of S-R Flip Flop with its Truth Table
Operations of S-R Flip Flop
Given Below is the Operations of S-R Flip Flop
• Case 1(PR=CLR=1): The asynchronous inputs are inactive and the flip flop responds
freely to the S,R and the CLK inputs in the normal way.
• Case 2(PR=0 and CLR=1):This is used when the Q is set to 1.
• Case 3(PR=1 and CLR=0):This is used when the Q’ is set to 1.
• Case 4(PR=CLR=0): This is an invalid state.
Characteristics Equation for SR Flip Flop
QN+1 = QNR' + SR'

J-K Flip Flop


In JK flip flops, The basic structure of the flip flop which consists of Clock (CLK), Clear (CLR),
Preset (PR).
Block Diagram of J-K Flip Flop

Circuit Diagram and Truth Table of J-K Flip Flop


Operations of J-K Flip Flop
Given Below is the Operations of J-K Flip Flop
• Case 1 (PR=CLR=0 ):This condition is in its invalid state.
• Case 2 (PR=0 and CLR=1):The PR is activated which means the output in the Q is set to
1. Therefore, the flip flop is in the set state.
• Case 3 (PR=1 and CLR=0):The CLR is activated which means the output in the Q’ is set
to 1. Therefore, the flip flop is in the reset state.
• Case 4 (PR=CLR=1):In this condition the flip flop works in its normal way whereas the
PR and CLR gets deactivated.

Race Around Condition in J-K Flip Flop


When the J and K both are set to 1, the input remains high for a longer duration of time, then the
output keeps on toggling. Toggle means that switching in the output instantly i.e. Q=0, Q’=1 will
immediately change to Q=1 and Q’=0 and this continuation keeps on changing. This change in
output leads to race around condition.
Characteristics Equation for JK Flip Flop
QN+1 = JQ'N + K'QN

D Flip Flop
The D Flip Flop Consists a single data input(D), a clock input(CLK),and two outputs: Q and Q'
(the complement of Q).
Block Diagram of D Flip Flop

Circuit Diagram and Truth Table of D Flip Flop


Given Below is the Diagram of D Flip Flop with its Truth Table
Operation of the D Flip-Flop
Given Below is the operation of D Flip-Flip
• Case 1 (PR=CLR=0):This conditions is represents as invalid state where both
PR(present) and CLR(clear) inputs are inactive.
• Case 2 (PR=0 and CLR=1):This state is set state in which PR is inactive (0) and CLR is
active(1) and the output Q is set to 1.
• Case 3 (PR=1 and CLR=0):This state is reset state in which PR is active (1) and CLR is
inactive (0) and the complementary output Q' is set to 1.
• Case 4 (PR=CLR=1):In This state the flip flop behaves as normal, both PR and CLR
inputs are active(1).
Characteristics Equation for D Flip Flop
QN+1 = D

T Flip Flop
The T Flip Flop consists of data input (T), a clock input (CLK), and two outputs: Q and Q' (the
complement of Q).
Block Diagram of T Flip Flop
Given Below is the Block Diagram of T Flip Flop
Circuit Diagram and Truth Table of T Flip Flop
Given Below is the Circuit Diagram and Truth Table of T Flip Flop

Operation of the T Flip-Flop


Given Below is the Operation of T Flip-Flop
• Case 1 (T=0):In this condition the flip-flop remains in its current state regardless of clock
input,Also the Output Q will remain unchanged unit the value of T will not change.
• Case 2 (T=1):In this condition the flip flop will change when T input is 1,At each rising or
falling edge of the clock signal the output Q will be in complementary state.
Characteristics Equation for T Flip Flop
QN+1 = Q'NT + QNT' = QN XOR T

Conversion for Flip Flops


The Excitation Table of the Flip Flop can be given as
EXCITATION TABLE:

Steps To Convert from One Flip Flop to Other


Let there be required flipflop to be constructed using sub-flipflop:
1. Draw the truth table of the required flip-flop.
2. Write the corresponding outputs of sub-flipflop to be used from the excitation table.
3. Draw K-Maps using required flipflop inputs and obtain excitation functions for sub-
flipflop inputs.
4. Construct a logic diagram according to the functions obtained.
Convert SR To JK Flip Flop
The Table for the SR To JK is given as

Excitation Functions and Logic Diagram


Function and Logic Diagram for the conversion is given below

Convert SR To D Flip Flop


Excitation Functions and Logic Diagram
Function and Logic Diagram for the conversion is given below

Applications of Flip-Flops
These are the various types of flip-flops being used in digital electronic circuits and the
applications of Flip-flops are as specified below.
Counters: The Flip Flop are used in the Counter Circuits for Counting pulse or events.
Frequency Dividers: The Flip Flop are used in Frequency Dividers to divide the frequency of a
input signal by a specific factor.
Shift Registers: The Shift registers consist of interconnected flip-flops that shift data serially.
Storage Registers: The Storage Resistor uses Flip Flop to store data in binary information.
Bounce elimination switch: The Flip Flop are used in Bounce elimination switch to eliminate
the contact bounce.
Data storage: The Flip Flop are used in the Data Storage to store binary data temporarily or
permanently.
Data transfer: The Flip Flops are used for data transfer in different electronic parts.
Latch: The Latches are the Sequential circuit which uses Flip Flop for temporary storage of data
Registers: The Registers are mode from the array of flip flop which are used to store data
temporarily.
Memory: The Flip Flops are the main components in the memory unit for data storage.

You might also like