0% found this document useful (0 votes)
7 views51 pages

Unit-1 Material

The document provides an overview of digital systems, focusing on data representation, number systems, and conversions between different bases such as binary, octal, decimal, and hexadecimal. It explains fixed-point and floating-point representations for real numbers, as well as the characteristics and differences between digital and analog systems. Additionally, it includes methods for converting numbers between various systems and details on binary logic circuits and components.
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)
7 views51 pages

Unit-1 Material

The document provides an overview of digital systems, focusing on data representation, number systems, and conversions between different bases such as binary, octal, decimal, and hexadecimal. It explains fixed-point and floating-point representations for real numbers, as well as the characteristics and differences between digital and analog systems. Additionally, it includes methods for converting numbers between various systems and details on binary logic circuits and components.
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
You are on page 1/ 51

DL & CO

UNIT – I: Data Representation: Binary Numbers, Fixed Point Representation. Floating Point Representation.
Number base conversions, Octal and Hexadecimal Numbers, components, Signed binary numbers, Binary codes
Digital Logic Circuits-I: Basic Logic Functions, Logic gates, universal logic gates, Minimization of Logic
expressions. K-Map Simplification, Combinational Circuits, Decoders, Multiplexers

Q) INTRODUCTION ABOUT DIGITAL SYSTEM


A Digital system is an interconnection of digital modules and it is a system that manipulates discrete
elements of information that is represented internally in the binary form.
 Binary is a base-2 number system that uses two states 0 and 1 to represent a number.
 The binary number is traversed from left to right.

Characteristics of Digital systems


 Digital systems manipulate discrete elements of information.
 Discrete elements are nothing but the digits such as 10 decimal digits or 26 letters of alphabets
and so on.
 Digital systems use physical quantities called signals to represent discrete elements.
 In digital systems, the signals have two discrete values and are therefore said to be binary.

Analog systems vs Digital systems

Analog system process information that varies continuously i.e; they process time varying signals
that can take on any values across a continuous range of voltage, current or any physical parameter.

Digital systems use digital circuits that can process digital signals which can take either 0 or 1
for binary system.

Q) Number systems

A number system relates quantities and symbols. In digital system how information is represented is key and
there are different radices, i.e. number bases, that a numbering system can use.

Number Representation:

It can have different base values like: binary (base-2), octal (base-8), decimal (base 10) and hexadecimal
(base 16),here the base number represents the number of digits used in that numbering system. As an
example, in decimal numbering system the digits used are: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. Therefore the digits
for binary are: 0 and 1, the digits for octal are: 0, 1, 2, 3, 4, 5, 6 and 7. For the hexadecimal numbering
system, base 16, the digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.

Binary numbers

Numbers that contain only two digit 0 and 1 are called Binary Numbers.

 Each 0 or 1 is called a Bit, from binary digit.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
 A binary number of 4 bits is called a Nibble.
 A binary number of 8 bits is called a Byte.
 A binary number of 16 bits is called a Word on some systems, on others a 32-bit number is called a
Word while a 16-bit number is called a Halfword.

The binary equivalent for some decimal numbers are given below

Decimal 0 1 2 3 4 5 6 7 8 9 10 11

Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011

Q) Fixed Point and Floating-Point Number Representations

There are two major approaches to store real numbers (i.e., numbers with fractional component) in modern
computing. These are (i) Fixed Point Notation and (ii) Floating Point Notation. In fixed point notation, there
are a fixed number of digits after the decimal point, whereas floating point number allows for a varying
number of digits after the decimal point.
Fixed-Point Representation −
This representation has fixed number of bits for integer part and for fractional part. For example, if given fixed-
point representation is IIII.FFFF, then you can store minimum value is 0000.0001 and maximum value is
9999.9999. There are three parts of a fixed-point number representation: the sign field, integer field, and fractional
field.

We can represent these numbers using:


 Signed representation: range from -(2(k-1)-1) to (2(k-1)-1), for k bits.
 1’s complement representation: range from -(2(k-1)-1) to (2(k-1)-1), for k bits.
 2’s complementation representation: range from -(2(k-1)) to (2(k-1)-1), for k bits.

Example −Assume number is using 32-bit format which reserve 1 bit for the sign, 15 bits for the integer part
and 16 bits for the fractional part.
Then, -43.625 is represented as following:

Where, 0 is used to represent + and 1 is used to represent. 000000000101011 is 15 bit binary


value for decimal 43 and 1010000000000000 is 16 bit binary value for fractional 0.625.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Floating-Point Representation

The floating number representation of a number has two part: the first part represents a signed fixed point
number called mantissa. The second part of designates the position of the decimal (or binary) point and is
called the exponent.

Convert (14.625)10 decimal number to binary number

MSB

Number Base Conversions


NUMBER SYSTEM

Number systems are the technique to represent numbers in the computer system architecture,
every value that you are saving or getting into/from computer memory has a defined number
system.

Computer architecture supports following number systems.

 Binary number system


KITS AKSHAR INSTITUTE OF TECHNOLOGY
DL & CO
 Octal number system
 Decimal number system
 Hexadecimal (hex) number system

BINARY NUMBER SYSTEM

A Binary number system has only two digits that are 0 and 1. Every number (value) represents
with 0 and 1 in this number system. The base of binary number system is 2, because it has only
two digits.

OCTAL NUMBER SYSTEM

Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with
0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has
only 8 digits.

DECIMAL NUMBER SYSTEM

Decimal number system has only ten (10) digits from 0 to 9. Every number (value) represents with
0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number system is 10, because
it has only 10 digits.

HEXADECIMAL NUMBER SYSTEM

A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F. Every
number (value) represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number system. The
base of hexadecimal number system is 16, because it has 16 alphanumeric values. Here A is 10, B
is 11, C is 12, D is 14, E is 15 and F is 16.

Number system Base(Radix) Used digits Example


Binary 2 0,1 (11110000)2
Octal 8 0,1,2,3,4,5,6,7 (360)8
Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10
0,1,2,3,4,5,6,7,8,9,
Hexadecimal 16 (F0)16
A,B,C,D,E,F

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Q) CONVERSIONS
DECIMAL TO OTHER

1. DECIMAL TO BINARY

Decimal Number System to Other Base

To convert Number system from Decimal Number System to Any Other Base is quite easy; you
have to follow just two steps:
A) Divide the Number (Decimal Number) by the base of target base system (in which you want
to convert the number: Binary (2), octal (8) and Hexadecimal (16)).
B) Write the remainder from step 1 as a Least Signification Bit (LSB) to Step last as a Most
Significant Bit (MSB).

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

2. DECIMAL TO HEXADECIMAL

Decimal to Hexadecimal Conversion Result


Example 1
Decimal Number is : (12345)10

Hexadecimal Number
is
(3039)16

Example 2
Decimal Number is : (725)10 Hexadecimal Number
is
(2D5)16
Convert
10, 11, 12, 13, 14, 15
to its equivalent...
A, B, C, D, E, F

BINARY TO OTHER

A) Multiply the digit with 2(with place value exponent). Eventually add all the multiplication
becomes the Decimal number.
1. BINARY TO DECIMAL

2. BINARY TO OCTAL
An easy way to convert from binary to octal is to group binary digits into sets of three, starting
with the least significant (rightmost) digits.

Binary: 11100101 = 11 100 101

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
011 100 101 Pad the most significant digits with zeros if
necessary to complete a group of three.

Then, look up each group in a table:


Binary: 000 001 010 011 100 101 110 111

Octal: 0 1 2 3 4 5 6 7

Binary = 011 100 101


Octal = 3 4 5 = 345 oct

3. BINARY TO HEXADECIMAL

An equally easy way to convert from binary to hexadecimal is to group binary digits into sets of
four, starting with the least significant (rightmost) digits.

Binary: 11100101 = 1110 0101

Then, look up each group in a table:


Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 1000 1001 1010 1011 1100 1101 1110 1111
Hexadecimal: 8 9 A B C D E F

Binary = 1110 0101


Hexadecimal = E 5 = E5 hex

OCTAL TO OTHER

1. OCTAL TO BINARY

Converting from octal to binary is as easy as converting from binary to octal. Simply look up
each octal digit to obtain the equivalent group of three binary digits.

Octal: 0 1 2 3 4 5 6 7
Binary: 000 001 010 011 100 101 110 111

Octal = 3 4 5
Binary = 011 100 101 = 011100101 binary

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
2. OCTAL TO HEXADECIMAL

When converting from octal to hexadecimal, it is often easier to first convert the octal number
into binary and then from binary into hexadecimal. For example, to convert 345 octal into hex:

(from the previous example)

Octal = 3 4 5

Binary = 011 100 101 = 011100101 binary

Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101

Then, look up the groups in a table to convert to hexadecimal digits.

Binary: 0000 0001 0010 0011 0100 0101 0110 0111

Hexadecimal: 0 1 2 3 4 5 6 7

Binary: 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal: 8 9 A B C D E F

Binary = 1110 0101

Hexadecimal = E 5 = E5 hex

Therefore, through a two-step conversion process, octal 345 equals binary 011100101 equals
hexadecimal E5.

3. OCTAL TO DECIMAL

The conversion can also be performed in the conventional mathematical way, by showing each
digit place as an increasing power of 8.

345 octal = (3 * 82) + (4 * 81) + (5 * 80) = (3 * 64) + (4 * 8) + (5 * 1) = 229 decimal

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

HEXA DECIMAL TO THER

Converting from hexadecimal to binary is as easy as converting from binary to hexadecimal. Simply look
up each hexadecimal digit to obtain the equivalent group of four binary digits.

Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 8 9 A B C D E F
Binary: 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal = A 2 D E
Binary = 1010 0010 1101 1110 = 1010001011011110 binary

7’s and 8’s Complement of Octal (Base-8) Number

Simply, 7’s complement of a octal number is the subtraction of it’s each digits from 7. For example, 7’s
complement of octal number 127 is 777 - 127 = 650.
8’s complement of octal number is 7’s complement of given number plus 1 to the least significant bit
(LSB). For example 8’s complement of octal number 320 is (777 - 320) + 1 = 457 + 1 = 460. Please note
that maximum digit of octal number system is 7, so addition of 7+1 will be 0 with carry 1.

Example:

1. Find 7's complement of 402


Note : 7's complement of a number is obtained by subtracting all bits from 777.
7's complement of 402 is
777
-402

375
7’s Complement subtractions:
Method : 1's complement subtraction steps :
1. At first, find 1's complement of the B(subtrahend).
2. Then add it to the A(minuend).
3. If the final carry over of the sum is 1, then it is dropped and 1 is added to the result.
4. If there is no carry over, then 1's complement of the sum is the final result and it is negative.
Example 1:
1. Find Subtraction of 402 and 314 using 7's complement method
Here A = 402, B = 314.
Find A - B = ? using 7's complement
First find 7's complement of B = 314
Note : 7's complement of a number is obtained by subtracting all bits from 777.
7's complement of 314 is
KITS AKSHAR INSTITUTE OF TECHNOLOGY
DL & CO

777-314=463
Now Add this 7's complement of B to A
402+463=1065
The left most bit of the result is called carry and add it to the rest part of the result 065.
065+1=066
So answer is 066

Example 2: Find Subtraction of 342 and 614 using 7's complement method

Here A = 342, B = 614.


Find A - B = ? using 7's complement
First find 7's complement of B = 614

Note : 7's complement of a number is obtained by subtracting all bits from 777.
7's complement of 614 is
777-614=163
Now Add this 7's complement of B to A
342+163=525
Here there is no carry, answer is - (7's complement of the sum obtained 525)

Note : 7's complement of a number is obtained by subtracting all bits from 777.
7's complement of 525 is
777-525=252

So answer is 252

8’s Complement subtractions:

Method : 8's complement subtraction steps :


1. At first, find 8's complement of the B(subtrahend).
2. Then add it to the A(minuend).
3. If the final carry over of the sum is 1, then it is dropped and the result is positive.
4. If there is no carry over, then 8's complement of the sum is the final result and it is negative.

1. Find Subtraction of 402 and 314 using 8's complement method

Here A = 402, B = 314.


Find A - B = ? using 8's complement
First find 8's complement of B = 314

Note : 8's complement of a number is 1 added to it's 7's complement number.


7's complement of 314 is
777-314=463
Now add 1 : 463 + 1 = 464

Now Add this 8's complement of B to A

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
402+464=1066
The left most bit of the result is called carry and it is ignored.

So answer is 066

2. Find Subtraction of 342 and 614 using 8's complement method

Here A = 342, B = 614.


Find A - B = ? using 8's complement
First find 8's complement of B = 614

Note : 8's complement of a number is 1 added to it's 7's complement number.


7's complement of 614 is
777-614=163
Now add 1 : 163 + 1 = 164
Now Add this 8's complement of B to A
342+164=526
Here there is no carry, answer is - (8's complement of the sum obtained 526)
Note : 8's complement of a number is 1 added to it's 7's complement number.
7's complement of 526 is 777-526=251
Now add 1 : 251 + 1 = 252
So answer is 252

9's and 10's Complement

If the number is binary, then we use 1's complement and 2's complement. But in case, when the number is
a decimal number, we will use the 9's and 10's complement. The 10's complement is obtained from the 9's
complement of the number, and we can also find the 9's and 10's complement using the r's and (r-1)'s complement
formula.

9's Complement

The 9's complement is used to find the subtraction of the decimal numbers. The 9's complement of a
number is calculated by subtracting each digit of the number by 9. For example, suppose we have a number 1423,
and we want to find the 9's complement of the number. For this, we subtract each digit of the number 1423 by 9.
So, the 9's complement of the number 1423 is 9999-1423= 8576.

Subtraction using 9's complement

With the help of the 9's complement, the process of subtraction is done in a much easier way.
Generally, we subtract the subtrahend from the minuend, but in a case when we perform subtraction using 9's
complement, there is no need to do the same.

For subtracting two numbers using 9's complement, we first have to find the 9's complement
of the subtrahend and then we will add this complement value with the minuend. There are two possible cases when
we subtract the numbers using 9's complement.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Case 1: When the subtrahend is smaller than the minuend.

For subtracting the smaller number from the larger number using 9's complement, we will find
the 9's complement of the subtrahend, and then we will add this complement value with the minuend. By adding
both these values, the result will come in the formation of carry. At last, we will add this carry to the result
obtained previously.

Case 2: When the subtrahend is greater than the minuend.

In this case, when we add the complement value and the minuend, the result will not come in the
formation of carry. This indicates that the number is negative, and for finding the final result, we need to find the
9's complement of the result.

10's Complement

The 10's complement is also used to find the subtraction of the decimal numbers. The 10's complement of
a number is calculated by subtracting each digit by 9 and then adding 1 to the result. Simply, by adding 1 to its
9's complement we can get its 10's complement value. For example, suppose we have a number 1423, and we
want to find the 10's complement of the number. For this, we find the 9's complement of the number 1423 that is
9999-1423= 8576, and now we will add 1 to the result. So the 10's complement of the number 1423 is
8576+1=8577.

Subtraction using 10's complement

For subtracting two numbers using 10's complement, we first have to find the 10's complement of the
subtrahend, and then we will add this complement value with the minuend. There are two possible cases when we
subtract the numbers using 10's complement.

Case 1: When the subtrahend is smaller than the minuend.

For subtracting the smaller number from the larger number using 10's complement, we will find the 10's
complement of the subtrahend and then we will add this complement value with the minuend. By adding both these

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
values, the result will come in the formation of carry. We ignore this carry and the remaining digits will be the
answer.

Case 2: When the subtrahend is greater than the minuend.

In this case, when we add the complement value and the minuend, the result will not come in the formation
of carry. This indicates that the number is negative and for finding the final result, we need to find the 10's
complement of the result obtained by adding complement value of subtrahend and minuend.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
3. SIGNED NUMBERS

 Digital systems like computer, must be able to handle both positive and negative numbers.
 A signed binary number consists of both sign and magnitude information.
 The sign indicates whether a number is positive or negative.

Representation

There are three forms in which the signed integer (whole numbers) can be represented. They
include,

1. Sign – Magnitude Form – Rarely used


2. 1’s Complement Form
3. 2’s Complement Form – Mostly used

Note:

Sign bit – leftmost bit in a signed binary numbers

 0 for positive, 1 for negative

Sign Magnitude Form


 Here, leftmost bit is the sign bit.
 Remaining bits are magnitude bits.
 Magnitude bits are in true binary.

1’s Complement Form


In this Form, positive numbers are represented the same way as positive sign-magnitude numbers.

Negative numbers, are the 1’s complement of the corresponding positive numbers

(eg)
DL & CO
+25 is represented as,

00011001 → same as sign-magnitude form

-25 is represented as,

11100110 → 1’s complement of +25


2’s Complement Form
 Positive numbers in 2’s complement form are represented as same as in sign-
magnitude and 1’s Complement Form.
 Negative numbers are the 2’s complement of the corresponding positive numbers

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Q) BINARY ARITHMETIC
BINARY ADDITION
The binary addition table is as follows:
A+B SUM CARRY
0+0 0 0
0+1 1 0
1+0 1 0
1+1 0 1
Add (1010)2 and (0011)2
1010 (Augend)
0011 (Addend)

1101 (sum)

The addition manipulated above as follows.


Step 1:The least significant bits are added, i.e. 0+1 =1 with a carry of 0
Step 2: The carry in the previous is added to the next higher significant bits, i.e. 0+1+1= 0 with a carry 1.
Step 3: The carry in the previous is added to the next higher significant bits, i.e. 1+0+0 =1 with a carry 0.
Step 4: The preceding carry is added to the most significant bit i.e. 0+1+0 = 1 with a carry 0.
Thus the sum is 1101.

BINARY SUBTRACTION
The binary subtraction table is as follows:

A-B DIFFERENCE BORROW


0-0 0 0
0-1 1 1
1-0 1 0
1-1 0 0
Subtract (0101)2 from (1011)2
1011 (Minuend)
0101 (Subtrahend)

0110 (Difference)

The steps are described below


Step1: the LSB in the first column are 1 and 1. Hence, the difference is 1 - 1 = 0
Step2: The column, the subtraction is performed as 1 – 0 = 1
Step3: In the third column, the difference is given by 0 – 1 =1
Step 4: In the fourth column (MSB), the difference is given by 0 – 0 = 0 since 1 is borrowed for thirdcolumn.

BINARY MULTIPLICATION
The binary multiplication table is as follows:
A *B PRODUCT
0*0 0
0*1 0

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
1*0 0
1*1 1

 Binary multiplication uses add and shift process


 Binary multiplication is similar to decimal multiplication.

Multiplicand * Multiplier
10110.1x01001.1

101101
101101
000000
000000 Partial Product
101101
000000

011010101.11 (Final product)


The steps are described below

Step 1: The LSB of the multiplier is taken. If multiplier bit is 1, the multiplicand is copied as such and ifthe
multiplier bit is 0 zero is placed in all the bit positions.
Step 2: The next higher significant bit of the multiplier is taken and, the partial product is written with theshift
to the left, as in step 1.
Step 3: step 2 is repeated for all other higher significant bits.
Step 4: The partial product terms are added which gives the actual product of multiplier and themultiplicand.

BINARY DIVISION:
The binary division table is as follows:
A÷B Result
0÷0 Not allowed
0÷1 0
1÷0 Not allowed
1÷1 1

 Binary division uses subtract and shift process


 Binary division is similar to decimal division.
Division by 0 is meaningless

Dividend ÷ Divisor
11011.1÷ 101
101.1 (QUOTIENT) DIVISOR 101
√11011.1 (DIVIDEND)

101

111
101

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

101
101

Q) binary code
Binary codes are codes which are represented in binary system with modification from the original one.
The group of symbols is called as a code. The digital data is represented, stored and transmitted as group of binary
bits. This group is also called as binary code. The binary code is represented by the number as well as alphanumeric
letter.

Advantages of Binary Code

Following is the list of advantages that binary code offers.


1. Binary codes are suitable for the computer applications.
2. Binary codes are suitable for the digital communications.
3. Binary codes make the analysis and designing of digital circuits if we use the binary codes.
4. Since only 0 and 1 are being used, implementation becomes easy.
Classification of binary codes:
The codes are broadly categorized into following four categories.
 Weighted binary code

 Non-weighted binary code

 Alphanumeric code

 Error detection code

Weighted codes: Weighted binary codes are those binary codes which obey the positional weightprinciple.
Each position of the number represents a specific weight.In negatively weighted codes, some of the weight
assigned to the binary digits must be negative.
• Table below shows some of the positively weighted and negatively weighted codes.

Decimal 8421 2421 5421 5211 64-2-3 84-2-1


Number
0 0000 0000 0000 0000 0000 0000
1 0001 0001 0001 0001 0101 0111
2 0010 0010 0010 0011 0010 0110
3 0011 0011 0011 0101 1001 0101
4 0100 0100 0100 0111 0100 0100

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
5 0101 1011 1000 1000 1011 1011
6 0110 1100 1001 1010 0110 1001
7 0111 1101 1010 1100 1101 1001
8 1000 1110 1011 1110 1010 1000
9 1001 1111 1100 1111 1111 1111

UNWEIGHTED 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

Example: Excess three code and Gray code.

 Excess-3 code is also known as XS-3 code.


 Excess-3 code is a non-weighted code that is derived from the 8421 BCD code.
 Every number on the 8421 code is incremented by 0011 to achieve the XS-3 code.
 3 is the decimal equivalent of 0011, hence the name XS-3.

Here is a table showing how Excess-3 code is derived from 8421 BCD code.

Decimal BCD XS Code


(+0011)

0 0000 0011

1 0001 0100

2 0010 0101

3 0011 0110

4 0100 0111

5 0101 1000

6 0110 1001

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Decimal BCD XS Code
(+0011)

7 0111 1010

8 1000 1011

9 1001 1100

For example, in 8421BCD code, 1001 the weights of 1, 0, 0, 1 (from left to right) are 8, 4, 2 and 1respectively. The
codes 8421BCD, 2421BCD, 5211BCD are all weighted codes.

Gray Code

It is the non-weighted code and it is not arithmetic codes. That means there are no specific weights assigned to the bit
position. It has a very special feature that, only one bit will change each time the decimal number is incremented as
shown in fig. As only one bit changes at a time, the gray code is called as a unit distance code. The gray code is a
cyclic code. Gray code cannot be used for arithmetic operation.

Application of Gray code

 Gray code is popularly used in the shaft position encoders.


 A shaft position encoder produces a code word which represents the angular position of the shaft.

Alpka⭲umcíic codcs
Computers work with only 0’s and 1’s. However, there is a need for more advanced forms of communication with
machines. This is why alphanumeric code is important. It includes 26 characters for the letters of the alphabet, and
10 more for symbols like !@#$%^&.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Alphanumeric code represents both numbers and alphabetical characters. The most common types of
alphanumeric code are EBCDIC and ASCII.

EBCDIC

EBCDIC stands for Extended Binary Coded Decimal Interchange Code. EBCDIC code is an 8-bit code
that is mainly used in IBM mainframe and IBM midrange computer operating systems.

ASCII

ASCII stands for American Standard Code for Information Interchange. ASCII code is a 7-bit code used
in smaller computers. ASCII code represents the numbers from 0 to 9, ninety-five upper and lowercase letters
of the alphabet, punctuation marks, and a blank space. In total, ASCII encodes 128 characters.

Error detection codes (Parity code)

When data or instructions are electronically transmitted, there is a chance of errors during data transmission
in the form of scrambling or corruption of data. In order to avoid this, error-detecting codes are utilized.

An error detection code attaches additional data to a message before sending and this determines whether the
message was corrupted during data transmission.

A parity code is an error detection code where an extra bit (called a parity bit) is attached to the message to
make the number of 0’s and 1’s either even or odd depending on the type of parity.

Q) Logic gates
• Logic gates are the fundamental building blocks of digital systems.
• Logic gates are electronic circuits because they are made up of a number of electronic devices and
components.
• Inputs and outputs of logic gates can occur only in 2 levels. These two levels are termed HIGH and
LOW, or TRUE and FALSE, or ON and OFF or simply 1 and 0.
Types of Logic Gates
A logic gate is a digital gate that allows data to be manipulated. Logic gates, use logic to determine whether
or not to pass a signal. Logic gates, on the other hand, govern the flow of information based on a set of
rules.
The logic gates can be classified into the following major types:
1. Basic Logic Gates
There are three basic logic gates:
1. AND Gate
2. OR Gate
3. NOT Gate
2. Universal Logic Gates
KITS AKSHAR INSTITUTE OF TECHNOLOGY
DL & CO
In digital electronics, the following two logic gates are considered as universal logic gates:
1. NOR Gate
2. NAND Gate
3. Derived Logic Gates
The following two are the derived logic gates used in digital systems:
1. XOR Gate
2. XNOR Gate
Let us now discuss each of these types of logic gates in detail one-by-one.
AND Gate
In digital electronics, the AND gate is one of the basic logic gate that performs the logical multiplication of
inputs applied to it. It generates a high or logic 1 output, only when all the inputs applied to it are high or
logic 1. Otherwise, the output of the AND gate is low or logic 0.
Properties of AND Gate:
 AND gate can accept two or more than two input values at a time.
 When all of the inputs are logic 1, the output of this gate is logic 1.

The logic symbol of a two input AND gate is shown in the following figure.

Input Output

A B A AND B

Z=A.B 0 0 0

OR Gate 0 1 0
An OR gate have the following two properties:
 It can have two or more input lines at a time.
1 0 0
 When all of the inputs to the OR gate are low or logic 0, the
output of it is low or logic 0.
Z=A+B 1 1 1

Input Output

A B A OR B

0 0 0

0 1 1

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Input Output

1 0 1

1 1 1

NOT Gate
 The output of a NOT gate is complement or inverse of the input applied to it.
 NOT gate takes only one output.

Input Output

A NOT A

0 1

NOR Gate 1 0
Thus, it can be expressed as, NOR Gate = OR Gate + NOT Gate
A NOR gate is an OR gate followed by a NOT gate.
 A NOR gate can have two or more inputs and gives an output.
 A NOR gate gives a high or logic 1 output only when its all inputs are low or logic 0.

C=nput Output
A B A NOR B

0 0 1

0 1 0

1 0 0

1 1 0

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

NAND Gate
The NAND gate is also represented as a combination of two basic logic gates namely, AND gate and NOT
gate. Hence, it can be expressed as
NAND Gate = AND Gate + NOT Gate
 NAND gate can take two or more inputs at a time and produces one output based on the combination of
inputs applied.
 NAND gate produces a low or logic 0 output only when its all inputs are high or logic 1.

Input Output

A B A NAND B

0 0 1

0 1 1

1 0 1

1 1 0

XOR Gate

XOR gate, which is used in digital circuits to perform modulo sum. It is also referred to as Exclusive OR gate or Ex-
OR gate. The XOR gate can take only two inputs at a time and give an output. The output of the XOR gate is high
or logic 1 only when its two inputs are dissimilar.

 It can accept only two inputs at a time. There is nothing like a three or more input XOR gate.

 The output of the XOR gate is logic 1 or high, when its inputs are dissimilar.

XOR gate - 𝑍=𝐴⊕𝐵Z=A⊕B

Z is the output variable, and A and B are the input variables.

This expression can also be written as follows:

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Input Output

A B A XOR B

0 0 0

0 1 1

1 0 1

1 1 0

XNOR Gate

It is also called the Ex-NOR or Exclusive NOR gate. It is a combination of two logic gates namely,
XOR gate and NOT gate. Thus, it can be expressed as,

XNOR Gate = XOR Gate + NOT Gate

The output of an XNOR gate is high or logic 1 when its both inputs are similar. Otherwise the
output is low or logic 0.
Here is the boolean expression of the XNOR gate.

We can also write this expression as follows:

Here, the A and B are inputs and Y is the output .

Input Output

A B A XNOR B

0 0 1

0 1 0

1 0 0
KITS AKSHAR INSTITUTE OF TECHNOLOGY
DL & CO

Input Output
1 1 1

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Q) Minimization using Algebraic Manipulation


The process of simplifying the algebraic expression of a Boolean function is called minimization. Minimization is
important since it reduces the cost and complexity of the associated circuit. For example, the function.
Common Laws used in algebraic manipulation:

Q) K-Map (Karnaugh Map)

In many digital circuits and practical problems, we need to find expressions with minimum variables
We can minimize Boolean expressions of 3, 4 variables very easily using K-map without using any Boolean algebra
theorems.
K-map can take two forms:
1. Sum of product (SOP)
2. Product of Sum (POS)
Steps to Solve Expression using K-map
1. Select the K-map according to the number of variables.
2. Identify minterms or maxterms as given in the problem.
3. For SOP put 1’s in blocks of K-map respective to the minterms (0’s elsewhere).
KITS AKSHAR INSTITUTE OF TECHNOLOGY
DL & CO
4. For POS put 0’s in blocks of K-map respective to the max terms (1’s elsewhere).
5. Make rectangular groups containing total terms in power of two like 2,4,8 ..(except 1) and try to cover as
many elements as you can in one group.
6. From the groups made in step 5 find the product terms and sum them up for SOP form.
SOP FORM
1. K-map of 3 variables

K-map SOP form for 3 variables

Z= ?A,B,C(1,3,6,7)

From red group we get product term—


A’C
From green group we get product term—
AB
Summing these product terms we get- Final expression (A’C+AB)
2. K-map for 4 variables

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

K-map 4 variable SOP form


F(P,Q,R,S)=?(0,2,5,7,8,10,13,15)
From red group we get product term—
QS
From green group we get product term—
Q’S’
Summing these product terms we get- Final expression (QS+Q’S’).
POS FORM
1. K-map of 3 variables

K-map 3 variable POS form


F(A,B,C)=?(0,3,6,7)

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

From red group we find terms


A B
Taking complement of these two
A' B'
Now sum up them
(A' + B')
From brown group we find terms
BC
Taking complement of these two terms
B’ C’
Now sum up them
(B’+C’)
From yellow group we find terms
A' B' C’
Taking complement of these two
ABC
Now sum up them
(A + B + C)
We will take product of these three terms : Final expression –
(A' + B’) (B’ + C’) (A + B + C)
2. K-map of 4 variables

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

K-map 4 variable POS form


F(A,B,C,D)=?(3,5,7,8,10,11,12,13)

From green group we find terms


C’ D B
Taking their complement and summing them
(C+D’+B’)
From red group we find terms
C D A’
Taking their complement and summing them
(C’+D’+A)

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
From blue group we find terms
A C’ D’
Taking their complement and summing them
(A’+C+D)
From brown group we find terms
A B’ C
Taking their complement and summing them
(A’+B+C’)
Finally we express these as product –
(C+D’+B’).(C’+D’+A).(A’+C+D).(A’+B+C’)

Q) Combinational Circuit
Definition of Combinational Circuit
Combinational circuits are specially designed using multiple interconnected logic gates such that the output will
be generated by computing the logical combinations of the present input only.
Features of Combinational Circuit
 In this output depends only upon present input.
 It’s Speed is fast.
 Easy designed.
 There is no feedback between input and output.
 It is time independent.
 Elementary building blocks are Logic gates.
 Used for both arithmetic and boolean operations.

combinational circuits are used which are discusses below:


Types of Logic Circuits: There are two types of Digital circuits depending on their output and memory used:
(i) Combinational circuit, and
(ii) Sequential circuit
A combinational circuit consists of logic gates whose outputs at any time are determined from only
the present combination of inputs and they have no memory.
Combinational Circuits: These circuits are developed using AND, OR, NOT, NAND, and NOR logic gates. These
logic gates are building blocks of combinational circuits. A combinational circuit consists of input variables and
output variables. Since these circuits are not dependent upon previous input to generate any output, so are
combinational logic circuits. A combinational circuit can have an n number of inputs and m number of outputs. In

KITS AKSHAR INSTITUTE OF TECHNOLOGY


combinational circuits, the output at any time is a direct function of the applied external inputs.
DL & CO

A sequential circuit consists of logic gates whose outputs at any time are determined
from both the present combination of inputs and previous output. That means sequential circuits use
memory elements to store the value of previous output.
Combinational circuit is a circuit in which we combine the different gates in the circuit, for
example encoder, decoder, multiplexer and demultiplexer. Some of the characteristics of
combinational circuits are following −

 The output of combinational circuit at any instant of time, depends only on the levels present
at input terminals.
 The combinational circuit do not use any memory. The previous state of input does not have
any effect on the present state of the circuit.
 A combinational circuit can have an n number of inputs and m number of outputs.

Block diagram

We’re going to elaborate few important combinational circuits as follows.

Half Adder

Half adder is a combinational logic circuit with two inputs and two outputs. The half adder
circuit is designed to add two single bit binary number A and B. It is the basic building block for
addition of two single bit numbers. This circuit has two outputs carry and sum.

Block diagram

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Truth Table

Circuit Diagram

Full Adder

Full adder is developed to overcome the drawback of Half Adder circuit. It can add two one-bit
numbers A and B, and carry c. The full adder is a three input and two output combinational
circuit.

Block diagram

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Truth Table

Circuit Diagram

N-Bit Parallel Adder

The Full Adder is capable of adding only two single digit binary number along with a carry
input. But in practical we need to add binary numbers which are much longer than just one bit.
To add two n-bit binary numbers we need to use the n-bit parallel adder. It uses a number of full
adders in cascade. The carry output of the previous full adder is connected to carry input of the
next full adder.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


4 Bit Parallel Adder DL & CO

In the block diagram, A0 and B0 represent the LSB of the four bit words A and B. Hence Full
Adder-0 is the lowest stage. Hence its Cin has been permanently made 0. The rest of the
connections are exactly same as those of n-bit parallel adder is shown in fig. The four bit parallel
adder is a very common logic circuit.

Block diagram

N-Bit Parallel Subtractor

The subtraction can be carried out by taking the 1’s or 2’s complement of the number to be
subtracted. For example we can perform the subtraction (A-B) by adding either 1’s or 2’s
complement of B to A. That means we can use a binary adder to perform the binary subtraction.

4 Bit Parallel Subtractor

The number to be subtracted (B) is first passed through inverters to obtain its 1’s complement.
The 4-bit adder then adds A and 2’s complement of B to produce the subtraction.
S3 S2 S1 S0represents the result of binary subtraction (A-B) and carry output Cout represents the
polarity of the result. If A > B then Cout = 0 and the result of binary form (A-B) then Cout = 1
and the result is in the 2’s complement form.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Block diagram

Half Subtractors

Half subtractor is a combination circuit with two inputs and two outputs (difference and borrow).
It produces the difference between the two binary bits at the input and also produces an output
(Borrow) to indicate if a 1 has been borrowed. In the subtraction (A-B), A is called as Minuend
bit and B is called as Subtrahend bit.

Truth Table

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Circuit Diagram

Full Subtractors

The disadvantage of a half subtractor is overcome by full subtractor. The full subtractor is a
combinational circuit with three inputs A,B,C and two output D and C’. A is the ‘minuend’, B is
‘subtrahend’, C is the ‘borrow’ produced by the previous stage, D is the difference output and C’
is the borrow output.

Truth Table

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Circuit Diagram

Multiplexers

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.

Block diagram

Multiplexers come in multiple variations


KITS AKSHAR INSTITUTE OF TECHNOLOGY
DL & CO
 2 : 1 multiplexer
 4 : 1 multiplexer
 16 : 1 multiplexer
 32 : 1 multiplexer

Block Diagram

Truth Table

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Demultiplexers

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 comes in multiple variations.

 1 : 2 demultiplexer
 1 : 4 demultiplexer
 1 : 16 demultiplexer
 1 : 32 demultiplexer

Block diagram

Truth Table

Decoder

A decoder is a combinational circuit. It has n input and to a maximum m = 2n outputs. Decoder


is identical to a demultiplexer without any data input. It performs operations which are exactly
opposite to those of an encoder.
KITS AKSHAR INSTITUTE OF TECHNOLOGY
DL & CO
Block diagram

Examples of Decoders are following.

 Code converters
 BCD to seven segment decoders
 Nixie tube decoders
 Relay actuator

2 to 4 Line Decoder

The block diagram of 2 to 4 line decoder is shown in the fig. A and B are the two inputs where D
through D are the four outputs. Truth table explains the operations of a decoder. It shows that
each output is 1 for only a specific combination of inputs.

Block diagram

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Truth Table

Logic Circuit

Encoder

Encoder is a combinational circuit which is designed to perform the inverse operation of the
decoder. An encoder has n number of input lines and m number of output lines. An encoder
produces an m bit binary code corresponding to the digital input number. The encoder accepts an
n input digital word and converts it into an m bit another digital word.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Block diagram

Examples of Encoders are following.

 Priority encoders
 Decimal to BCD encoder
 Octal to binary encoder
 Hexadecimal to binary encoder

Priority Encoder

This is a special type of encoder. Priority is given to the input lines. If two or more input line are
1 at the same time, then the input line with highest priority will be considered. There are four
input D0, D1, D2, D3 and two output Y0, Y1. Out of the four input D3 has the highest priority and
D0 has the lowest priority. That means if D3 = 1 then Y1Y1 = 11 irrespective of the other inputs.
Similarly if D3 = 0 and D2 = 1 then Y1 Y0 = 10 irrespective of the other inputs.

Block diagram

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Truth Table

Logic Circuit

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Sequential circuits: A sequential circuit is specified by a time sequence of inputs, outputs, and internal states. The
output of a sequential circuit depends not only on the combination of present inputs but also on the previous
outputs. Unlike combinational circuits, sequential circuits include memory elements with combinational circuits.

Some examples are counters and shift registers.


 The memory elements are circuits capable of storing binary information.
 The binary information stored in these memory elements at any given time defines the state of the
sequential circuit at that time.
 The external output of a sequential circuit depends both on the present input and the previous output
state.
 The next state of the memory elements also depends on the external input and the present state of the
external output.
 Some sequential circuits may not contain combinational circuits, but only memory elements.

Q) Decoder
Decoder is a combinational circuit that has ‘n’ input lines and maximum of 2n output lines
2 to 4 Decoder
Let 2 to 4 Decoder has two inputs A1 & A0 and four outputs Y3, Y2, Y1 & Y0. The block diagram of 2 to 4 decoder is
shown in the following figure.

One of these four outputs will be ‘1’ for each combination of inputs when enable, E is ‘1’. The Truth table of 2 to
4 decoder is shown below.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Enable Inputs Outputs

E A1 A0 Y3 Y2 Y1 Y0
0 x x 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0

From Truth table, we can write the Boolean functions for each output as
Y3=E.A1.A0𝑌3=𝐸.𝐴1.𝐴0
Y2=E.A1.A0′𝑌2=𝐸.𝐴1.𝐴0′
Y1=E.A1′.A0𝑌1=𝐸.𝐴1′.𝐴0
Y0=E.A1′.A0′𝑌0=𝐸.𝐴1′.𝐴0′
Each output is having one product term. So, there are four product terms in total. We can implement these four
product terms by using four AND gates having three inputs each & two inverters. The circuit diagram of 2 to 4
decoder is shown in the following figure.

Therefore, the outputs of 2 to 4 decoder are nothing but the min terms of two input variables A1 & A0, when
enable, E is equal to one. If enable, E is zero, then all the outputs of decoder will be equal to zero.
Similarly, 3 to 8 decoder produces eight min terms of three input variables A2, A1 & A0 and 4 to 16 decoder
produces sixteen min terms of four input variables A3, A2, A1 & A0.

Multiplexer
A multiplexer is a combinational circuit that has many data inputs and a single output, depending on control or
select inputs. For N input lines, log2(N) selection lines are required, or equivalently, for input lines, n
selection lines are needed. Multiplexers are also known as “N-to-1 selectors,” parallel-to-serial converters, many-
to-one circuits, and universal logic circuits. They are mainly used to increase the amount of data that can be sent
over a network

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Types of Mux
The Mux can be of different types based on input.two major types of mux which are
 2×1 Mux
 4×1 Mux

2×1 Multiplexer
The 2×1 is a fundamental circuit which is also known 2-to-1 multiplexer that are used to choose one signal from two
inputs and transmits it to the output. The 2×1 mux has two input lines, one output line, and a single selection line. It
has various applications in digital systems such as in microprocessor it is used to select between two different data
sources or between two different instructions.
Block Diagram of 2:1 Multiplexer with Truth Table
Given Below is the Block Diagram and Truth Table of 2:1 Mux. In this Block Diagram where I0 and I1 are the input
lines ,Y is the output line and S0 is a single select line.

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Block Diagram of 2:1 Multiplexer with Truth Table

The output of the 2×1 Mux will depend on the selection line S0,
 When S is 0(low), the I0 is selected
 when S0 is 1(High), /1 is selected
Logical Expression of 2×1 Mux
Using the Truth Table ,the Logical Expression for Mux can be determined as

Circuit Diagram of 2×1 Multiplexers


Using truth table the circuit diagram can be given as
Circuit Diagram of 2×1 Multiplexers
Using truth table the circuit diagram can be given as

Circuit Diagram of 2×1 Mux

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO
Circuit Diagram of 2×1 Multiplexers
Using truth table the circuit diagram can be given as

Circuit Diagram of 2×1 Mux


Circuit Diagram of 2×1 Mux
4×1 Multiplexer
The 4×1 Multiplexer which is also known as the 4-to-1 multiplexer. It is a multiplexer that has 4 inputs and a single
output. The Output is selected as one of the 4 inputs which is based on the selection inputs.
Block Diagram of 4×1 Multiplexer
In the Given Block Diagram I0, I1, I2, and I3 are the 4 inputs and Y is the Single output which is based on Select
lines S0 and S1.

The output of the multiplexer is determined by the binary value of the selection lines
 When S1S0=00, the input I0 is selected.
 When S1S0=01, the input I1 is selected.
 When S1S0=10, the input I2 is selected.
 When S1S0=11, the input I3 is selected.
 Truth Table of 4×1 Multiplexer

KITS AKSHAR INSTITUTE OF TECHNOLOGY


DL & CO

Circuit Diagram of 4×1 Multiplexers

 Using truth table the circuit diagram can be given as


Multiplexer can act as universal combinational circuit. All the standard logic gates can be
implemented with multiplexers.

KITS AKSHAR INSTITUTE OF TECHNOLOGY

You might also like