1
Combinational Circuit Design

This chapter describes the combinational logic circuits design and their implementation with logic gates, multiplexers, decoders, etc. Combinational circuits are the major block of any digital design or function [1]. So, a detailed overview before the design and analysis of digital circuit with Verilog modules, plays a significant role in hardware optimization to achieve the desired outcomes.

1.1 Logic Gates

Logic gates are very useful when performing a few basic operations in any digital computer system. These logic gates perform many operations in complex circuits and other control systems, e.g., basic operations like AND, OR, and NOT. The functionality of each basic gate as well as the extended version are discussed in this chapter.

AND operation:

It performs the AND operation. The circuit diagram of the N input AND operation is shown in Figure 1.1.

Figure 1.1 Symbol of an AND gate.

The AND gate may have N number of inputs and one output. If the number of inputs are N then N ≥ 2 conditions must be applied for input operation. Digital inputs are applied in terms of A, B, C……N, and the output is Y.

The mathematic equation is given below:

table row cell text Y= A AND  end text straight B text  AND  end text straight C text  AND  end text straight D ....... text AND  end text straight N end cell row cell text = A.B.C.D end text ....... straight N end cell row cell text = ABCD end text ...... straight N end cell end table

The truth table for an AND gate is provided in Table 1.1

Table 1.1 T. Table of AND gate.

I/PO/P
ABY
000
010
100
111

OR operation:

It performs OR operation. The symbol for an OR operation is shown in Figure 1.2.

Figure 1.2 Symbol for an OR gate.

The OR gate may have N number of inputs and one output. If the number of inputs are N then N ≥ 2 conditions must be applied for input operation. Digital inputs are applied in terms of A, B, C……N, and the output is Y.

The mathematic equation is given below:

begin inline style straight Y space equals space AOR space BOR space CORD space........... ORN 1 space space space space equals space straight A plus straight B plus straight C plus straight D....... space plus space straight N end style

The truth table for an OR gate is provided in Table 1.2 .

Table 1.2 Truth table of an OR gate.

I/PO/P
ABY
000
011
101
111

NOT operation:

This is also called an inverter. The symbol for the NOT gate is shown in Figure 1.3. It has a single input device and it generates an inverted output. Table 1.3 describes the truth table of a NOT gate. The mathematical equation is written as:

Figure 1.3 Symbol for a NOT gate.

table row cell text Y= NOT  end text straight A end cell row cell equals straight A with bar on top end cell end table

Table 1.3 Truth table of a NOT gate.

I/PO/P
AY
01
10

1.1.1 Universal Gate Operation

Universal gates are those in which any logical expression can be realized. The NAND and NOR gates are very popular and are widely used for realization of logical expressions. Therefore, these two NAND and NOR gates are used to implement other gates so these are called universal gates.

NAND operation

This is a universal gate. The operation NOT-AND is known as a NAND operation. It has N number of inputs and one output like other basic gates. However, two inputs and one output NAND gate are shown in Figure 1.4. Table 1.4 provides output values of a NAND gate in terms of inputs. The Boolean equation is given below:

Figure 1.4 Symbol for a NAND gate.

straight Y equals text end text stack straight A. straight B with bar on top

Table 1.4 Truth table of a NAND gate.

I/PO/P
ABY
001
011
101
110

NOR operation

This is a universal gate. The operation NOT-OR is known as a NOR operation. It has N number of inputs and one output similar to basic gates. The symbol diagram of two inputs and one output is shown in Figure 1.5. Table 1.5 gives output values of a NOR gate in terms of inputs. The Boolean equation is given below:

Figure 1.5 Symbol for a NOR gate.

straight Y equals text end text stack straight A plus straight B with bar on top

Table 1.5 Truth table of a NOR gate.

I/PO/P
ABY
001
010
100
110

EX-OR Operation

The operation EX-OR is used in many applications. It has N number of inputs and one output like other basic gates. The symbol diagram of two I/P and one O/P is shown in Figure 1.6. Table 1.6 provides the output values of an EX-OR gate in terms of inputs. Its mathematic equation is given below:

Figure 1.6 Symbol for a NAND gate.

straight Y equals text end text stack straight A circled plus straight B with bar on top

Table 1.6 Truth table of a NAND gate.

I/PO/P
ABY
000
011
101
110

1.1.2 Combinational Logic Circuits

This type of circuit depends upon the I/Ps in that particular instant of time. A memory element is not available. A combinational circuit may have a number of sub-systems as shown in Figure 1.7.

Figure 1.7 Diagram of a combinational logic circuit.

There are many ways to design these combinational logic circuits. These include:

  1. Boolean expression
  2. Set of statement
  3. Truth table

These designs are used to design combinational logic circuits. However, a number of methods are also available to simplify Boolean function. These include:

  1. Algebraic method
  2. K-map method
  3. Variable entered method
  4. Tabulation method

Standard representation for logical functions

Any logical functions can be represented in terms of their logical variables. Logical variables and their functions are in binary form. There are two standard forms generally being used in circuit designing.

  1. Sum of product (SOP)
  2. Product of sum (POS)

Apart from the form above, other forms are also available to design circuits. However, these forms are conveniently suitable for the design process. This is discussed in more detail in the next subsection.

1.2 Combinational Logic Circuits Using MSI

This subsection describes the simplification and realization of the combinational logic circuits using gates. These methods are used to integrate complex functions in the form of IC. There are many devices are available such as adders, multiplexers, de-multiplexers, decoders, and multipliers.

1.2.1 Adders

An adder is a combinational logic circuit that performs arithmetic sums of binary numbers and produces corresponding outputs.

Half Adder

This is a basic adder that performs arithmetic sums of two inputs and gives the corresponding output in terms of sum and carry. The diagram of a H. adder is shown in Figure 1.8.

Figure 1.8 Block diagram of a H. adder.

A and B are I/Ps and O/Ps and are the sum and carry of the H. adder. The truth table is given in Table 1.7.

Table 1.7 Truth table of a half adder.

ABSUMCARRY
0000
0110
1010
1101

Mathematical expressions for the H. adder are:

table row cell text Sum end text equals straight A with bar on top straight B plus text A end text straight B with bar on top end cell row cell equals A circled plus B end cell row cell text Carry end text equals text AB end text end cell end table

The circuit diagram of the H. adder is shown in Figure 1.9.

Figure 1.9 Circuit diagram of a half adder.

Full Adder

This performs the arithmetic sum of three inputs and gives the corresponding two outputs in terms of sum and carry. A block diagram of the full adder is shown in Figure 1.10. Table 1.8 provides the truth table of a full adder circuit where output variables (Sum, Cout) are expressed in terms of input values.

Figure 1.10 Block diagram of a full adder.

Table 1.8 Truth table of a full adder.

ABCinSumCout
00000
00110
01010
01101
10010
10101
11001
11111

Boolean expressions for the F. adder are:

K-Map for Sum:

B’Ci’nB’CinBCinBCin’
A’
A

K-Map for Cout:

B’Ci’nB’CinBCinBCin’
A’1
A111

Logic diagram of a full adder

text Sum end text equals straight A circled plus straight B circled plus text Cin end text
text Cout end text equals text  AB end text plus text BCin end text plus text Cin  end text straight A

A logical representation of the F. adder is shown in Figure 1.11.

Figure 1.11 Full adder logic block.

Half Subtractor

A half subtractor is a combinational logic circuit that performs the arithmetic difference between two inputs and provides the corresponding output in terms of difference and borrows as shown in Figure 1.12. Table 1.9 provides output variables (Difference, Borrow) of the half subtractor in terms of inputs (A,B).

Figure 1.12 Half subtractor.

Table 1.9 Truth table of the H. subtractor.

ABDifferenceBorrow
0000
0111
1010
1100

Boolean expressions for the H. adder are:

table row cell text Diff = end text straight A with bar on top text B+A end text straight B with bar on top end cell row cell text =A end text circled plus text B end text end cell row cell text Borrow = end text straight A with bar on top straight B end cell end table

Logic diagram of a H. Subtractor

The logical representation of a H. adder is shown in Figure 1.13.

Figure 1.13 Half subtractor logic block.

Full Subtractor

This performs the arithmetic difference of three inputs and gives corresponding two outputs in terms of Diff. and Borrow. A block diagram of the F. subtractor is shown in Figure 1.14. Table 1.10 provides output variables (Difference, Borrow) of the full subtractor in terms of inputs (A,B).

Figure 1.14 Block diagram of the full subtractor.

Table 1.10 Truth table of the full subtractor.

ABBinDiffBorrow
00000
00111
01011
01101
10010
10100
11000
11111

K-Map for Difference:

B’Bin’B’BinBBinBBin’
A’
A

A mathematical equation for the F. subtractor is:

text Diff end text equals straight A circled plus straight B circled plus text Bin end text

K-Map for Borrow:

B’Bin’B’BinBBinBBin’
A’111
A1

The logic diagram of the F. subtractor is shown in Figure 1.15.

text Borrow  end text equals stack text A end text with bar on top text B end text plus stack text A end text with bar on top text B end text subscript text in end text end subscript plus text B end text stack text B end text with bar on top subscript text in end text end subscript

Figure 1.15 Full subtractor logic block.

1.2.2 Multiplexers

This is a type of combinational circuit. It has multiple inputs and a single output and its output depends upon the select lines. Select lines control the processing of the multiplexer which means that whatever the input is will be the output depending on select lines. If N select lines then input lines will be 2 N as shown in Figure 1.16.

Figure 1.16 Block diagram of the multiplexer.

For simplicity of the expression, 4:1 MUX has been explained in the truth table. The truth table for 4:1 MUX is given in Table 1.11.

Table 1.11 Truth table of the 4:1 MUX.

S1S0Y(Output)
00D0
01D1
10D2
11D3

The Boolean expression for Y can be expressed as:

straight Y equals stack straight S subscript 1 with bar on top stack straight S subscript 0 with bar on top straight D subscript 0 plus stack straight S subscript 1 with bar on top straight S subscript 0 straight D subscript 1 plus straight S subscript 1 stack straight S subscript 0 with bar on top straight D subscript 2 plus straight S subscript 1 straight S subscript 0 straight D subscript 3

The logic diagram of a multiplexer is shown in Figure 1.17.

Figure 1.17 Logic diagram of the multiplexer.

Example:

Implement the expression F(A,B,C)=m(0,2,6,7) using a multiplexer.

Solution:There are four variables; therefore, it needs four select lines for the process. And there are four Minterms which means these inputs are connected with logic 1 and the remaining with logic 0. For this implementation, 8:1 MUX is required. The implementation is shown in Figure 1.18.

Figure 1.18 Implementation of function.

Advantages of multiplexers:

  1. Logic circuits can be implemented without simplification of the logic expression.
  2. This reduces the integrated circuit count.
  3. Logic design can be simplified.

1.2.3 De-multiplexer

A de-multiplexer provides 2N outputs for N select lines and a single input. These controls are used to select which O/P line to route the I/P. For example, a 1 × 4 de-multiplexer has one input and four output lines for two select or control lines, as shown in Figure 1.19. Table 1.12 describes the truth table of the de-multiplexer shown in Figure 1.19.

Figure 1.19 Block diagram of the de-multiplexer.

Table 1.12 Truth table of a 1 × 4 de-multiplexer.

S1S0Y3Y2Y1Y0
00000In
0100In0
100In00
11In000

With the help of the truth table, the de-multiplexer output can be expressed as:

A logical representation of the de-multiplexer is shown in Figure 1.20.

Figure 1.20 1 × 4 de-multiplexer using logic gates.

1.2.4 Decoders

This is a type of combinational circuit used to decode binary data. There are several decoders such as the BCD to seven-segment decoder, Decimal to BCD decoder etc. Here, the basic decoder 2:4 is being discussed, as shown in Figure 1.21. Table 1.13 shows the truth table of a 2:4 line decoder.

Figure 1.21 Block diagram of a 2 × 4 decoder.

Table 1.13 Truth table of decoder 2 × 4.

ABD0D1D2D3
001000
010100
100010
110001

The truth table of the decoder is given in Table 1.10.

The Boolean function of the output is given below as:

begin inline style table attributes columnalign left end attributes row cell text D end text subscript text 0 end text end subscript equals straight A with bar on top straight B with bar on top end cell row cell text D end text subscript text 1 end text end subscript equals straight A with bar on top straight B end cell row cell text D end text subscript text 2 end text end subscript equals text A end text straight B with bar on top end cell row cell text D end text subscript text 3 end text end subscript equals text AB end text end cell end table end style

Logic Diagram of Decoder

A logic diagram of the decoder 2 × 4 is shown in Figure 1.22.

Figure 1.22 Logic diagram of a 2 × 4 decoder.

Example:

Implementation of the given functions using a 3:8 decoder.

F subscript 1 equals text end text sum m left parenthesis 0 comma 3 comma 4 right parenthesis comma text end text F subscript 2 equals text end text sum m left parenthesis 2 comma 5 comma 6 comma 7 right parenthesis.

Solution:

Implementation of the above given function is shown in Figure 1.23.

Figure 1.23 Implementation of functions using the decoder.

1.2.5 Multiplier

A multiplier is a type of combinational circuit which is used to multiply binary numbers. There are several multipliers such as the 2-bit multiplier, 4-bit multiplier, etc.

A block diagram of the 2-bit binary multiplier is shown in Figure 1.24. It will abide by the following sequence in binary multiplication.

A1A0
B1B0

Figure 1.24 Block diagram of a 2-bit binary multiplier.

………………………

A1B0A0B0
A1B1A0B1

………………………

P3P2P1P0

Where P0 is the product of two bits only and P1 and P2 will be worked as H. adders, P3 is the carry output. The logic diagram of the 2-bit multiplier is shown in Figure 1.25.

Figure 1.25 Circuit diagram of a 2-bit multiplier.

1.2.6 Comparators

Comparators are the example combinational circuit and can be implemented through a logic gate. Comparators are part of many digital and analog circuits such as ADC to DAC converters, etc. The design of comparators is usually done with the help of a truth table as shown in Table 1.14 for a 2-bit comparator. A 2-bit comparator with input A, B and output Y1(A < B), Y2(A = B) and Y3(A > B) is shown in Figure 1.26.

Figure 1.26 2-bit comparator block.

Table 1.14 Truth table of a 2-bit comparator.

I/PO/P
A1A0B1B0Y1(A < B)Y2(A = B)Y3(A > B)
0000010
0001100
0010100
0011100
0100001
0101010
0110100
0111100
1000001
1001001
1010010
1011100
1100001
1101001
1110001
1111010

We can obtain the out expression for Y1, Y2, and Y3 either by direct implementation with the truth table or by applying K-map reduction techniques.

table row cell straight Y 1 left parenthesis straight A less than straight B right parenthesis equals text end text stack straight A 1 with bar on top straight B 1 plus stack straight A 0 with bar on top text end text stack straight A 0 with bar on top text  B end text 0 plus stack straight A 0 with bar on top text  B end text 1 straight B 0 end cell row cell straight Y 2 left parenthesis straight A equals straight B right parenthesis equals text end text stack straight A 1 with bar on top text end text stack straight A 0 with bar on top text end text stack straight B 1 with bar on top text end text stack straight B 0 with bar on top text end text plus stack straight A 1 with bar on top text end text stack straight A 0 with bar on top text  B end text 1 text end text stack straight B 0 with bar on top text end text plus stack straight A 1 with bar on top text  A end text 0 text end text stack straight B 1 with bar on top straight B 0 plus straight A 1 stack straight A 0 with bar on top B 1 stack straight B 0 with bar on top end cell row cell straight Y 3 left parenthesis straight A & gt semicolon straight B right parenthesis equals text end text stack straight A 1 with bar on top text end text stack straight A 0 with bar on top text end text stack straight B 1 with bar on top text end text stack straight B 0 with bar on top plus stack straight A 1 with bar on top text end text stack straight B 1 with bar on top plus stack straight A 1 with bar on top text  A end text 0 text end text stack straight B 0 with bar on top end cell end table

With the above Boolean expressions, a 2-bit comparator can be implemented using logic gates such as AND, OR, and NOT gate.

1.2.7 Code Converters

There is a different format of presentation for digital data like Binary, Octal, Hexadecimal, Gray code, etc. As per the requirement, any one format can be changed into another format with the help of code converters. Several examples would be decimal-to-binary, binary-to-octal or binary-to-hexadecimal, and binary-to-gray and vice versa. The design of code converters is done using logic gates with the help of a truth table (Table 1.15).

Table 1.15 Octal to Binary converter.

Input in OctalOutput in Binary
I0I1I2I3I4I5I6I7B2B1B0
10000000000
01000000001
00100000010
00010000011
00001000100
00000100101
00000010110
00000001111

Example:
Binary-to-Octal

From Table 1.15, the binary O/P can be derived in terms of I/P as an octal value.

table row cell straight B 2 equals straight I 4 plus straight I 5 plus straight I 6 plus straight I 7 end cell row cell straight B 1 equals straight I 2 plus straight I 3 plus straight I 6 plus straight I 7 end cell row cell straight B 0 equals straight I 1 plus straight I 3 plus straight I 5 plus straight I 7 end cell end table

Therefore, octal-to-binary implementation required the OR gate to obtain binary output in terms of octal as input variables.

1.2.8 Decimal to BCD Encoder

This is a type of priority encoder used to convert decimal to BCD number. It takes inputs in the form of numerals between 0 to 9 and gives corresponding BCD output. It works like switches; the response of the 1 or 0 turning them ON or OFF switch mode. Table 1.16 gives output values (BCD) in terms of input values.

Table 1.16 Truth table of a decimal to BCD encoder.

InputOutput
D9D8D7D6D5D4D3D2D1D0Y3Y2Y1Y0
00000000010000
00000000100001
00000001000010
00000010000011
00000100000100
00001000000101
00010000000110
00100000000100
01000000001000
10000000001001

From Table 1.16, the BCD O/P can be represented in terms of I/P as a decimal value.

table attributes columnalign left end attributes row cell straight Y 3 equals straight D 8 plus straight D 9 end cell row cell straight Y 2 equals straight D 4 plus straight D 5 plus straight D 6 plus straight D 7 end cell row cell table row cell straight Y 1 equals straight D 2 plus straight D 3 plus straight D 6 end cell row cell Y 0 equals straight D 1 plus straight D 3 plus straight D 5 plus straight D 7 end cell end table end cell end table

Therefore, decimal to BCD encoder implementation requires the OR gate to obtain BCD output in terms of decimal as input variables.

Review Questions

Q1 Design and implement the given function using logic gates at gate level model:

text F end text equals straight A with bar on top BC plus text A end text straight B with bar on top plus text CD end text

Q2 Implement the following functions using NAND only.

straight F left parenthesis straight a comma straight b comma straight c right parenthesis equals sum straight m left parenthesis 1 comma 2 comma 3 right parenthesis

Q3 Implement the following multiple output function using a suitable decoder.

table row cell straight F subscript 1 left parenthesis text A,B,C,D end text right parenthesis equals sum straight m left parenthesis 0 comma 4 comma 7 comma text end text 10 right parenthesis end cell row cell straight F subscript 2 left parenthesis text A,B,C end text right parenthesis equals sum straight m left parenthesis 1 comma 5 comma 6 right parenthesis end cell end table

Q4 Implement the following multiple output function using a suitable multiplexer.

straight F left parenthesis straight A comma straight B comma straight C right parenthesis equals sum straight m left parenthesis 1 comma 2 comma 6 comma 7 right parenthesis

Q5 Implement the given function using 4 × 1 multiplexer:

text end text F subscript 1 equals sum to the power of text ? end text end exponent m left parenthesis 1 comma 3 comma 4 comma 5 right parenthesis

Multiple Choice Questions

Q1 Select the correct representation of given function

f left parenthesis A comma B comma C right parenthesis equals sum to the power of text ? end text end exponent 1 comma 2 comma 4 comma 5 comma 7
  1. A’B’C + A’BC’ + A’B’C’ + AB’C + ABC
  2. A’B’C + A’BC’ + AB’C’ + AB’C + ABC
  3. A’B’C + A’BC’ + AB’C’ + AB’C + ABC’
  4. A’B’ + A’BC’ + AB’C’ + AB’C + ABC

Q2 Select the correct representation of given function

f left parenthesis A comma B comma C right parenthesis equals product to the power of text ? end text end exponent left parenthesis 1 comma 2 comma 4 comma 5 right parenthesis
  1. A’B’C’ + A’BC + ABC’ + ABC
  2. A’B’C + A’BC’ + AB’C’ + ABC
  3. A’B’C + A’BC’ + AB’C’ + ABC
  4. AB’ + A’BC’ + AB’C’ + ABC

Q3 Select the option which does not match with

f left parenthesis A comma B comma C right parenthesis equals sum to the power of text ? end text end exponent 1 comma 2 comma 4 comma 6
  1. F=πM(0,3,5,7)
  2. F = a’b’c + a’bc’ + ab’c’ + abc’
  3. F = a’bc + a’bc’ + ab’c’ + abc’
  4. Option a and b

Q4 How many 4 × 1 multiplexers are required to implement 16 × 1 multiplexer?

  1. 4
  2. 6
  3. 5
  4. 6

Q5 The output of a logic gate is 1 when all its input are at logic 0, gate is

  1. NAND, EXOR
  2. OR, EXNOR
  3. AND, EXOR
  4. NOR, EXNOR

Reference

  1. [1] Morris, M.M., and Ciletti, M.D. (2018). Digital Design. Upper Saddle River, NJ: Pearson.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.248.119