##### Document information

1

**COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES
**

**Chapter 4: Combinational Logic
**

**NOTE: For more examples and detailed description of the material in the lecture
notes, please refer to the main textbook:
Digital Design 3rd Edition, By Morris Mano, Publisher Prentice Hall, 3rd Edition
All examples used in the lecture notes are from the above reference.
Combinational Circuits
**

- A combinational circuit consists of input variables, output variables, and logic gates

that transform binary information from the input data to the output.

Combinational

circuit *n* inputs *m* outputs

- A combinational circuit cannot have any storage elements (registers) or any feedback

paths (connections from the output of one gate to the input of a second gate that

directly or indirectly affects the input to the first gate).

- As an example, consider the following combinational circuit with 3 inputs and 2

outputs (*n* = 3, *m* = 2):

*F*’2

* A
B*
* C*
* A
B*
* C*

* A
B*

* A
C*

* B*
* C*

*T*1

*T*2

*T*3

*F*2

*F*1

Docsity.com

2

- If there are more than two levels of gates to generate a function, label the output of

the corresponding gates and determine the Boolean expression for each of them (here,

we have used the labels *T*1, *T *, *T *, and *F*’2 3 2 to find the Boolean expression for *F*1).

231

123

2

1

2

.' ..

...

*TTF
TFT
CBAT
*

*CBAT
CBCABAF
*

+= = =

++= ++=

- By using the properties of Boolean algebra, the expression for will be equal to: 1*F
*

*CBACBACBACBAF *..''..'.'.'.'.1 +++=

- The truth table for the outputs of this combinational circuit can be obtained by using

the above expressions obtained for and , or by using the labeled gate outputs in

the truth table and obtaining

1*F *2*F
*

*CBCABAF *...2 ++=231 *TTF *+= and for different

combinations of the input variables as follows:

*A B C F F*’ *T T T F*2 2 1 2 3 1

0 0 0 0 1 0 0 0 0

0 0 1 0 1 1 0 1 1

0 1 0 0 1 1 0 1 1

0 1 1 1 0 1 0 0 0

1 0 0 0 1 1 0 1 1

1 0 1 1 0 1 0 0 0

1 1 0 1 0 1 0 0 0

1 1 1 1 0 1 1 0 1

Docsity.com

3

[ ][ ]12 *FFCBA *=++- This is in fact the logic circuit for a full adder ( ).

**Design Procedure
**

- Important design constraints include the number of gates, number of inputs to a gate,

propagation time of the signal through the gates, number of interconnections, etc.

**Example
**

- Find a combinational circuit, which converts the binary coded decimal (BCD) to the

excess-3 code for the decimal digits.

**Input BCD Output Excess-3 Code
**

*A B C D w* *x y z
*

0 0 0 0 0 0 1 1

0 0 0 1 0 1 0 0

0 0 1 0 0 1 0 1

0 0 1 1 0 1 1 0

0 1 0 0 0 1 1 1

0 1 0 1 1 0 0 0

0 1 1 0 1 0 0 1

0 1 1 1 1 0 1 0

1 0 0 0 1 0 1 1

1 0 0 1 1 1 0 0

Docsity.com

4

*
X
*

*
*0

*
X
*

*
*0

*
*0

*
*1

*
*1

*
*0

*
*1

*
*1

* CD
AB
*

00

01

00 01 11 10

* D*’ * D*’ * D
*

* C*’ * C
*

*
X
*

*
*1

*
*0

*
X
*

*
X
*

*
X
*

11

10

* B*’

* B*’

* B*

* A*’

* A
*

- Simplified expression: '*Dz *=

*
X
*

*
*1

*
X
*

*
*0

*
*1

*
*1

*
*1

*
*0

*
*0

*
*0

* CD
AB
*

00

01

00 01 11 10

* D*’ * D*’ * D
*

* C*’ * C
*

*
X
*

*
*1

*
*0

*
X
*

*
X
*

*
X
*

11

10

* B*’

* B*’

* B*

* A*’

* A
*

- Simplified expression: ''.. *DCDCy *+=

Docsity.com

5

*
X
*

*
*0

*
X
*

*
*0

*
*1

*
*0

*
*1

*
*1

*
*1

*
*0

* CD
AB
*

00

01

00 01 11 10

* D*’ * D*’ * D
*

* C*’ * C
*

*
X
*

*
*0

*
*1

*
X
*

*
X
*

*
X
*

11

10

* B*’

* B*’

* B*

* A*’

* A
*

''..'.'. *DCBDBCBx *++=- Simplified expression:

*
*0

*
X
*

*
*1

*
X
*

*
*1

*
*0

*
*0

*
*0

*
*0

*
*1

* CD
AB
*

00

01

00 01 11 10

* D*’ * D*’ * D
*

* C*’ * C
*

*
X
*

*
*1

*
*1

*
X
*

*
X
*

*
X
*

11

10

* B*’

* B*’

* B*

* A*’

* A
*

*DBCBAw *.. ++= - Simplified expression:

Docsity.com

6

- Using the above simplified expressions in sum of products, one can implement this

combinational circuit using seven AND gates and three OR gates.

- One can use the properties of Boolean algebra to change the expressions in a way that

some of the terms are shared between the output functions to make the

implementation even simpler (fewer gates) as follows:

).( ..

)'.()'.( ''..)'.( ''..'.'.

)'(. ''..

'

*DCBA
DBCBAw
*

*DCBDCB
DCBDCB
DCBDBCBx
*

*DCDC
DCDCy
*

*Dz
*

++= ++=

+++= ++= ++= ++=

+= =

- These expressions can be implemented using four AND gates and four OR gates and

one inverter (we assume that the inputs are available in both normal and complement

forms).

* C*+*D*

* x*

* y*

* w*

* z*

* A
*

* B*

* C*
* D
*

Docsity.com

7

**Binary Adder-Subtractor
**

- A combinational circuit that implements the addition of two bits is referred to as a

half adder.

- A combinational circuit that implements the addition of three bits (two significant bits

and a previous carry) is referred to as a full adder.

- A full adder can be implemented by using two half adders.

- Assuming that *S* and *C* denote the sum and the carry (the higher significant bit in the

binary sum) of the two input variables of a half adder, we will have:

*x y C S
*

0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

*yxC
yx
*

*yxyxS
*

.

'.'.

= ⊕= +=

* S*

* C*

* x*
* y*’

* x*’
* y*

* x*
* y*

* x*
* y* * S*

* C*

Docsity.com

8

- For a full adder, where the third input *z* denotes the carry corresponding to the

addition of the previous lower significant position we have:

*x y z C* *S
*

0 0 0 0 0

0 0 1 0 1

0 1 0 0 1

0 1 1 1 0

1 0 0 0 1

1 0 1 1 0

1 1 0 1 0

1 1 1 1 1

*
*0

*
*1

*
*1

*
*0

*
*0

*
*1

*
*1

*
*0

* yz
x
*

* x*’

* x
*

0

1

00 01 11 10

* z*’ * z*’ * z*

* y*’ * y*

- Simplified expression: or: *zyxzyxzyxzyxS *..''..'.'.'.'. +++= *zyxS *⊕⊕=

Docsity.com

9

*
*0

*
*0

*
*0

*
*1

*
*1

*
*1

*
*0

*
*1

* yz
x
*

* x*’

* x
*

0

1

00 01 11 10

* z*’ * z*’ * z*

* y*’ * y*

- Simplified expression: or: *zyzxyxC *... ++= *zyxyxzyxzyxyxC *).(..'.'... ⊕+=++=

- We will have the following logic circuits:

* x*’
* y*’
* z*
* x*’
* y*
* z*’
* x*
* y*’
* z*’
* x*
* y*
* z*

* S
*

* x*
* y*

* x*
* z*

* y*
* z*

* C*

- Using the second expression given for *S* and *C*, we can implement the full adder with

two half adders and an OR gate as shown below:

* x*
* y*

* z*

* C*

* S*

Docsity.com

10

- One can construct an *n*-bit binary adder with *n* full adders in series, by connecting

each output carry to the input carry of the next higher-order full adder.

- For example, a four-bit binary adder is given below:

FA

* S*3

* A*3 * B*3

* C*0

FA

* S*0

* A*0 * B*0

* C*1

FA

* S*1

* A*1* B*1

* C*2

FA

* S*2

* A*2* B*2

* C*3

* C*4

- For and 10110123 == *AAAAA *00110123 == *BBBBB *, we will have:

**Subscript i: 3 2 1 0
**

Input Carry 0 1 1 0 *Ci
*Augend 1 0 1 1 *Ai
*Addend 0 0 1 1 *B*B*i
*

Sum 1 1 1 0 *Si
*Output Carry 0 0 1 1 *Ci*+1

- Note that in this circuit we have nine inputs and , and

so the implementation of the corresponding circuit using the method of Chapter 3

would require a truth table with rows (if we ignore the input carry since

it must be zero, we will have 256 rows).

,,,,,,,, 32103210 *BBBBAAAA *0*C
*

0*C*5122
9 =

- The signal must propagate through the gates before the correct output sum is

available and the longest propagation delay time in an adder is the time it takes for the

carry to propagate through the full adders.

- The output of each full adder will not settle to its final value until the input carry is

available from the previous stage.

Docsity.com

11

* A Pi i*
* Bi*

* Ci*

* Ci*+1

* Si*

* Gi
*

- For a full adder, the carry propagates through an AND gate and an OR gate which

constitutes two gate levels, which implies that in an *n*-bit adder, the carry propagates

from input to output through 2*n* gate levels.

- Use faster gates with reduced delays.

- Reduce the carry delay time by increasing the equipment complexity properly.

- One of the popular methods for this purpose is to use carry lookahead as follows:

*iii
*

*iii
*

*BAG
BAP
*

.= ⊕=

- and are referred to as carry propagate and carry generate respectively. *iP iG
*

- The output sum and carry can then be written as:

*iiii
*

*iii
*

*CPGC
CPS
*

.1 += ⊕=

+

- We now use iterations to obtain each output carry directly from the input carry

as follows:

1+*iC
*

0*C
*

Docsity.com

12

001230123123233

0012012122333334

0012012122001011222223

001011000111112

0001

.......... ).......(.

......)....(. ...)..(.

.

*CPPPPGPPPGPPGPG
CPPPGPPGPGPGCPGC
*

*CPPPGPPGPGCPPGPGPGCPGC
CPPGPGCPGPGCPGC
*

*CPGC
*

++++= ++++=+=

+++=+++=+= ++=++=+=

+=

- Since all these expressions are in standard form, one can use a two-level circuit to

implement this combinational system.

- A 4-bit adder with a carry lookahead scheme is given below:

* B*3
* A*3

* P*3

* G*3

* B*0
* A*0

* P*0

* G*0

* B*2
* A*2

* P*2

* G*2

* B*1
* A*1

* G*1

* P*1

* C*0 * C*0

Carry Lookahead Generator

* P*0

* P*1 * S*1

* P*2

* S*0

* S*2

* S*3

* C*4* C*4

* C*3

* C*2

* C*1

* P*3

Docsity.com

13

- Binary subtraction can be done by adding to the 2’s complement of *BA *− *A B *

(which can be obtained by adding one to the 1’s complement).

- The logic circuit for a 4-bit adder subtractor is given as follows:

FA

* S*3

* A*3 * B*3

* C*0

FA

* S*0

* A*0 * B*0

* C*1 FA

* S*1

* A*1* B*1

* C*2 FA

* S*2

* A*2* B*2

* C*3

* C*4

* M*

- The mode input controls the output. *M
*

- When *M * is 0, then and the input carry is 0 which means that the output of

the circuit is equal to

*BB *=⊕ 0

plus . *A B
*

'1 *BB *=⊕- When is 1, we have *M * and the input carry is 1, which implies that the

output is equal to plus the 1’s complement of *A B * plus 1. This means that the output

is minus (provided that there is no overflow). *A B
*

- Addition of two *n*-bit numbers which are both positive or both negative, may result in

an overflow, i.e., the result may exceed the capacity of an *n*-bit register. This is shown

for 8-bit registers below:

Carries: 0 1

+70 0 1000110

+80 0 1010000

+150 1 0010110

Docsity.com

14 Carries: 1 0

-70 1 0111010 -80 1 0110000 -150 0 1101010

- In general, an overflow can be detected by applying exclusive-OR operation on the

input carry and output carry of the sign bit position (the leftmost digit).

- Note that if the last two carries were equal, there would be no overflow.

- For example, for the 4-bit adder subtractor, we will have:

* C*4
* C*3

* V*

- If the numbers are unsigned (the numbers are considered positive and the leftmost bit

does not represent the sign), the circuit performs minus if *A B BA *≥ or the 2’s

complement of minus if . *B A BA *≤

- For two unsigned numbers, the output carry of the leftmost bits detects a carry after

addition or a borrow after subtraction.

Carry: 1

70 1000110

80 1010000

150 0010110

**Decimal Adder
**

- The most common way to code a decimal number is binary coded decimal (BCD),

where the decimal number is represented by encoding each digit in binary form.

- Applying two BCD digits to a 4-bit binary adder will result in a number ranging from

0 to 9+9+1=19 as shown in the following table:

Docsity.com

15

**Binary Sum ** **BCD Sum ** **Decimal
**

*K Z*8 *Z*4 *Z*2 *Z*1 * C S*8 *S*4 *S*2 *S*1 *
*

0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 1 0 0 0 0 1 1

0 0 0 1 0 0 0 0 1 0 2

0 0 0 1 1 0 0 0 1 1 3

0 0 1 0 0 0 0 1 0 0 4

0 0 1 0 1 0 0 1 0 1 5

0 0 1 1 0 0 0 1 1 0 6

0 0 1 1 1 0 0 1 1 1 7

0 1 0 0 0 0 1 0 0 0 8

0 1 0 0 1 0 1 0 0 1 9

0 1 0 1 0 1 0 0 0 0 10

0 1 0 1 1 1 0 0 0 1 11

0 1 1 0 0 1 0 0 1 0 12

0 1 1 0 1 1 0 0 1 1 13

0 1 1 1 0 1 0 1 0 0 14

0 1 1 1 1 1 0 1 0 1 15

1 0 0 0 0 1 0 1 1 0 16

1 0 0 0 1 1 0 1 1 1 17

1 0 0 1 0 1 1 0 0 0 18

1 0 0 1 1 1 1 0 0 1 19

- The left side of the table gives the output of a 4-bit binary adder but we want the

output to be in a BCD form.

- From the entries of the table, it can be concluded that a conversion from binary sum

to BCD representation is needed if *K*=1 or *Z*8 and *Z*4 are both equal to 1 or *Z*8 and *Z*2

are both equal to 1.

- The Boolean expression to show the condition for a correction is:

Docsity.com

16

2848 .. *ZZZZKC *++=

- It can be easily seen that a correction can be made by adding 0110 to the binary sum

and providing an output carry for the next stage.

- The following figure shows a BCD adder (the input and the output are BCD digits).

Output carry *C*

*S*8 *S*4 *S*2 *S*1

*
K* 4-bit binary adder

*Z*8 *Z*4 *Z*2 *Z*1

Addend Augend

*
* 4-bit binary adder

Carry in

0

- From this circuit it can be seen that if the output carry (*C*) is equal to 1, binary

number 0110 is added to the binary sum.

- The output carry (*C*) is, in fact, equal to the output carry generated from the bottom

adder.

Docsity.com

17

**Binary Multiplier
**

- Multiplication of binary numbers is similar to the multiplication of decimal numbers

as shown below for a 2-bit binary number:

*B B*B1 B0
*A A*1 0
*A *.* B A *.* B*0 1 0 0

*A *.* B A *.* B* 1 1 1 0
*C C C C*3 2 1 0

- So, multiplication of two 2-bit numbers can be implemented by a combinational

circuit with two half adders as follows:

* B*1

* B*1

HA

HA

* A*0

* A*1 * B*0

* B*0

* C*0* C*1* C*2* C*3

- Assume now that the multiplier has 3 bits and the multiplicand has 4 bits.

Docsity.com

18

*B B B B* B3 B2 B1 B0
*A A A*2 1 0

*A *.* B A *.* B A *.* B A *.* B* 0 3 0 2 0 1 0 0
*A *.* B A *.* B A *.* B A *.* B* 1 3 1 2 1 1 1 0

*A *.* B A *.* B A *.* B A *.* B * 2 3 2 2 2 1 2 0

*C C C C C C C*6 5 4 3 2 1 0

- In this case, we will need two 4-bit adders and 12 AND gates as follows:

* A*1 * B*0* B*1* B*2* B*3

* A*2 * B*0 * B*1 * B*2 * B*3

Addend Augend 4-bit adder

Sum and output carry

Addend Augend 4-bit adder

Sum and output carry

* A*0 * B*0* B*1 * B*2 * B*3

0

* C*0* C*1* C*2* C*3* C*4* C*5 * C*6

Docsity.com

19

- In general, if the multiplier has bits and the multiplicand has *J K * bits, we will need

*K*-bit adders and AND gates and the product will have bits. 1−*J KJ *× *KJ *+

**Magnitude Comparator
**

- A magnitude comparator is a combinational circuit that compares two numbers *A* and

*B* and determines whether *A* > *B*, *A* = *B*, or *A* < *B*.

- Comparison operation should start by comparing the most significant bits of *A* and *B*.

- For example, consider two numbers *A* and *B* as follows:

0123

0123

*BBBBB
AAAAA
*

= =

- Define the following functions (which are the bib-by-bit exclusive-NOR operations

on *A* and *B*):

3,2,1,0 for''.. =+= *iBABAx iiiii *

- It can easily be verified that:

1..........

1..........

1...

0 ' 01231

' 1232

' 233

' 3

' 00123

' 1123

' 223

' 33

0123

=+++⇒<

=+++⇒>

=⇒=

*BAxxxBAxxBAxBABA
*

*BAxxxBAxxBAxBABA
*

*xxxxBA
*

- In the equations for inequalities, the most significant bits (with the same significance)

in the two numbers are compared and if one of them is 1 and the other one is 0, the

comparison is finished and only if they are equal, the next significant bits in the two

numbers will be compared (this is represented by ANDing the ’s with

corresponding terms in the inequalities).

*ix
*

- A 4-bit magnitude comparator logic circuit is given below:

Docsity.com

20

(*A*=*B*)

(*A*>*B*)

(*A*<*B*)

* x*2
* A*2

* B*2

* x*3
* A*3

* B*3

* x*1
* A*1

* B*1

* x*0
* A*0

* B*0

**Decoders
**

- Decoder circuits are used to decode encoded information.

- A decoder is a combinational circuit that has * *inputs and a maximum of outputs. *n n*2

- The truth table for a 3-to-8-line decoder is as follows:

Docsity.com

21

**Inputs Outputs
**

*x y z D D D D D D D D*0 1 2 3 4 5 6 7

0 0 0 1 0 0 0 0 0 0 0

0 0 1 0 1 0 0 0 0 0 0

0 1 0 0 0 1 0 0 0 0 0

0 1 1 0 0 0 1 0 0 0 0

1 0 0 0 0 0 0 1 0 0 0

1 0 1 0 0 0 0 0 1 0 0

1 1 0 0 0 0 0 0 0 1 0

1 1 1 0 0 0 0 0 0 0 1

- The logic circuit for this decoder is shown in the following figure, where each output

represents one of the minterms.

* x*

* y*

* z*

* D*0 = *x*’.*y*’.*z*’

* D*1 = *x*’.*y*’.*z*

* D*2 = *x*’.*y*.*z*’

* D*3 = *x*’.*y*.*z*

* D*4 = *x*.*y*’.*z*’

* D*5 = *x*.*y*’.*z*

* D*6 = *x*.*y*.*z*’

* D*7 = *x*.*y*.*z*

3×8 Decoder

Docsity.com

22

- Sometimes NAND gates are used instead of AND gates to generate complemented

outputs.

- One or more enable inputs are often used in the decoders to control the operation of

the circuit.

- A 2-to-4-line decoder consisting of NAND gates with an enable input is given below:

* A*’

* B*’

* A*’
* B*

* A
B*’

* A
B*

* E
*

* D*0

* D*1

* D*2

* D*3

- The corresponding truth table is as follows:

*E A B D D D D*0 1 2 3

*X X* 1 1 1 1 1

0 0 0 0 1 1 1

0 0 1 1 0 1 1

0 1 0 1 1 0 1

0 1 1 1 1 1 0

- In general, the enable input signal *E* may be activated with a 0 or with a 1.

- Some decoders have more than one enable inputs, which must be equal to a specific

binary number in order to enable the circuit.

Docsity.com

23

- A demultiplexer is a circuit that receives data from a single input line and directs it to

one of the output lines, which is determined by selection lines.

- One can build a demultiplexer by using a decoder with an enable line, as can be seen

in the above example.

- In the above example, *E* is the data input line and *A* and *B* are selection inputs which

determine which output will be the same as the input value *E* (this can easily be seen

from the circuit).

- One can connect multiple decoders with enable lines to build a decoder with a greater

number of outputs.

- For example, two 3-to-8-line decoders with enable lines can be connected to construct

a 4-to-16-line decoder as follows:

*D*8 to *D*15

*D*0 to *D*7
3×8

Decoder

E

3×8 Decoder

E

* x*
* y*
* z*

* w*

- The minterms 0000 to 0111 are generated by the top decoder, while the bottom one

generates minterms 1000 to 1111 as shown below:

Docsity.com

24

**Inputs Outputs
**

*w x y z D D D D D D D D*0 1 2 3 4 5 6 7

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

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

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

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

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

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

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

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

**Inputs Outputs
**

*w x y z D D D D D D D D*8 9 10 11 12 13 14 15

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

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

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

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

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

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

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

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

- In the first table *D * to *D*8 15 are all zero and *D * to *D*0 7 in the second one are all zero

(assuming that the decoder is constructed by AND gates not NAND gates).

- In general, in logic components, enable inputs are used for interconnecting two or

more components.

Docsity.com

25

- Any *n*-input *m*-output combinational logic circuit can be implemented by using an *n*-

to-2*n*-line decoder (to generate different minterms) and *m* OR gates (to generate sum

of products).

- For example, a full adder can be implemented as follows:

∑ ∑ =

=

)7,6,5,3(),,(

)7,4,2,1(),,(

*zyxC
*

*zyxS
*

3×8 Decoder

0 1 2 3 4 5 6 7

22 21 20

* x*

* y*

* z* * C*

* S*

- If the number of minterms in the Boolean expression of a function is more than half

of the number of the outputs of the decoder, it is easier to implement the complement

function and then use a NOR gate instead of an OR gate, which will result in the same

function with smaller number of inputs for the gate.

- If the decoder is implemented by NAND gates, one can use bulb technique and

implement the function with a NAND gate instead of an OR gate in the output of the

decoder.

**Encoders
**

- An encoder’s operation is the inverse operation of a decoder.

- For example, an octal-to-binary encoder is given below:

Docsity.com

26

**Inputs Outputs
**

*D D D D D D D D x y z *0 1 2 3 4 5 6 7

1 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 1

0 0 1 0 0 0 0 0 0 1 0

0 0 0 1 0 0 0 0 0 1 1

0 0 0 0 1 0 0 0 1 0 0

0 0 0 0 0 1 0 0 1 0 1

0 0 0 0 0 0 1 0 1 1 0

0 0 0 0 0 0 0 1 1 1 1

- The corresponding Boolean expressions are:

7654

7632

7531

*DDDDx
DDDDy
DDDDz
*

+++= +++= +++=

- An input priority must be established to guarantee that only one input is encoded (in

case more than one input is turned on).

- Also, a method should be used to indicate if *xyz*=000 is generated from being

equal to 1 or all inputs being equal to zero.

0*D
*

- For example, consider a 4-input priority encoder given below:

**Inputs Outputs
**

*D D D D x y V *0 1 2 3

0 0 0 0 *X X *0

1 0 0 0 0 0 1

*X *1 0 0 0 1 1

*X X *1 0 1 0 1

*X X X *1 1 1 1

Docsity.com

27

- *V *is a valid bit and is set to 1 when at least one of the inputs is equal to 1.

- Each *X* in the output lines represents a don’t-care condition for that output, with the

corresponding inputs.

- *X*’s in the input lines indicate that no matter what those variables are, the output is

going to be the same.

*
*1

*
*1

*
*1

*
*1

*
*1

*
X
*

*
*0

*
*1

*
*1

*
*1

* D*2* D*3
* D*0* D*1

00

01

00 01 11 10

* D*3’ * D*3’* D*3

* D*2’ * D*2

*
*0

*
*0

*
*1

*
*1

*
*1

*
*1

11

10

* D*1’

* D*1’

* D*1

*D*0’

* D*0

- Boolean expression:

32 *DDx *+=

Docsity.com

28

*
*1

*
*1

*
*1

*
*1

*
*1

*
X
*

*
*1

*
*1

*
*0

*
*0

* D*2* D*3
* D*0* D*1

00

01

00 01 11 10

* D*3’ * D*3’* D*3

* D*2’ * D*2

*
*1

*
*0

*
*1

*
*1

*
*0

*
*0

11

10

* D*1’

* D*1’

* D*1

*D*0’

* D*0

- Boolean expression:

'. 213 *DDDy *+=

- The valid bit *V* is simply equal to:

3210 *DDDDV *+++=

- The logic circuit of the above 4-input priority encoder is given below:

Docsity.com

29

* y*

* x*

* V
*

* D*3

* D*2

* D*0

* D*1

**Multiplexers
**

- A multiplexer or data selector is a combinational circuit that chooses one of the inputs

and reproduces the signal on this input at the output terminal.

- A 2-to-1-line multiplexer circuit and its block diagram are shown below:

* I*0

* I*1

* Y
*

* S*

MUX

1

0 * I*0
* Y
*

* I*1

* S*

- *I*0 and *I*1 are the input lines, *S* is the selection line, and *Y* is the output.
*n*- A 2 -to-1-line Multiplexer is in fact a combination of a decoder, 2*n* AND gates, and

one OR gate.

- For example, a 4-to-1-line multiplexer can be build as follows:

Docsity.com

30

2×4 Decoder

0 1 2

3

20

21

* S*0

* S*1

* Y*

* I*0

* I*1

* I*2

* I*3

- One can combine the two-input AND gates with the two-input AND gates in the

decoder and use three-input AND gates instead, as follows:

* I*0

* I*2

* I*1

* Y*

* I*3

* S*1
* S*0

*S S Y *1 0

0 0 *I*0
0 1 *I*1
1 0 *I*2
1 1 *I*3

Docsity.com

31

- The AND gates in fact decode the selection lines *S * to *Sn*-10 and the multiplexer is a

decoder with additional lines (*In*2 0 to *I*2*n*-1 ), each of which goes to one of the AND

gates.

- A multiplexer can have an enable line too.

- Multiplexer circuits can be combined to provide multiple bit selection logic.

- A circuit that selects one of two 4-bit sets of data lines can be provided by using 4 2-

to-1-line multiplexers is given below:

*E* *S Y*3*Y*2*Y*1*Y*0

1 *X *All Zeros

0 0 *A*3*A*2*A*1*A*0
0 1 *B*B3*B*2B *B*B1*B*0B

* A*0
* Y*0

* A*1
* Y*1

* A*2
* Y*2

* A*3
* Y*3

* B*0

* B*1

* B*2

* B*3

* S
*

* E
*

(Select)

(Enable)

Docsity.com

32

- It can easily be verified that if *S*=0, the output lines *Y Y Y Y*0 1 2 3 will be equal to

*A A A*0 1 2*A *, provided the enable line is active (here *E*=0). 3
- I if *S*=1, the output lines *Y Y Y Y * will be equal to *B*0 1 2 3 B0*B*1*B B*3B2B B , provided the enable line

is active (here *E*=0).

- The output lines are all 0’s when *E*=1.

- Since a multiplexer is in fact a decoder with an internal OR gate, one can use a

multiplexer to implement any Boolean function, in a way similar to the method that

was used to implement Boolean functions using a decoder and OR gates.

- For this purpose, the first *n*-1 variables will be used as selection inputs and the

remaining variable together with its complement, 1, and 0 will be used to build data

inputs.

- Look at each pair of rows (2*n*-1 pair of rows) in the truth table and try to see if the

corresponding function values are equal to 0, 1, the last variable in the input columns,

or its complement.

- For example, consider the following Boolean function:

∑= )7,6,2,1(),,( *zyxF *

- This function can be implemented as follows:

*x y* *z F *

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

*F *= *z*

*F *= *z*’

*F *= 0

*F *= 1

Docsity.com

33

*S*0
*S*1
0
1
2
3

4×1 MUX* z*
* z*’
* *0
* *1

*F*

* y*
* x*

- As another example, consider the following Boolean function:

∑= )15,14,13,12,11,4,3,1(),,,( *DCBAF *

- We will have:

*
**n*-1 variables 1 variable

* ***
A B C D F **

** **0 0 0 0 0

0 0 0 1 1

0 0 1 0 0

0 0 1 1 1

0 1 0 0 1

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

*F *= *D*

*F *= *D*

*F *= *D*’

*F *= 0

2*n*-1 pair of rows

*F *= 0

*F *= *D
*

*F *= 1

*F *= 1

Docsity.com

34

*S*0
*S*1
*S*2

0

1

2

3

4

5

6

7

8×1 MUX *F*

* C*
* B*
* A
*

* D
*

* *0

* *1

*n*-1 selection lines

2*n*-1 input lines

**Timing Analysis [2]
**

- A timing analysis is usually necessary for any complex combinational circuit.

- Consider a NOT gate.

* A* * A*’

10% 90%

10% 90%

0 1

*A
*

0 *t*1 *t*2

1 0

*A*’
Rise time

Fall time

Propagation delay

Propagation delay

Docsity.com

35

- We will simply consider a gate delay only (also referred to as propagation delay).

0 1

*A
*

*t*1 *t*2

1 0

*A*’

Propagation delay Propagation delay

*t*0

**Example [2]
**

- Consider the following circuit and find the timing diagram for ideal (no delay) gates.

* z*2

* z*1 * A*
* B*

* C*
* A*

*z*

* A*’

*z*1*
*

*A*’

*C
*

*B
*

*A
*

000

*z*2*
*

010 011 111

*z
*

*t*0 *t*1 *t*2 *t*3 *t*4

- Assume now that each gate has a delay shown on the following figure, and that

*T *>*T *+*T*3 1 2 (when two lines are going through several similar gates, the overall delay

Docsity.com

36

on each line can be quite different from the other one as in reality even similar gates

have different delays).

* A*’

* z*2

* z*1 * A*
* B*

* C*
* A*

*z*

*T*2

*T*3

*T*4

*T*1

000 010 011 111

*z*1*
*

*A*’

*C
*

*B
*

*A
*

*z*2*
*

*z
*

*t t t t t* 0 1 2 3 4

- Hazards are caused by unequal delay times in the signal paths from the input of the

circuit to the input of the gate causing the hazard.

- The glitch shown above is called a static hazard.

- A static hazard is defined to be a momentary output change due to a single variable

change, when no such output change is normally expected.

E

Real output

1

1 0

- Static-1 hazard:

Docsity.com

37

- Static -0 hazard:

0 Expected output 1

Real output 0

- This would not happen in the above circuit if *T *<*T *+*T*3 1 2.

- Dynamic hazard is a change from 1 to 0 to 1 to 0 or 0 to 1 to 0 to 1 in the output of a

gate, when it is expected to change from 1 to 0 or from 0 to 1 due to a change in the

input.

Expected output 1

0 Real output

0 1

- A circuit with no static hazard has no dynamic hazard either.

- Hazards can be prevented by adding additional gates.

- In the above example, the hazard occurs during the transition of *A* from 0 to 1, as

shown in the K-map.

Real output 0 1

1 Expected output 0

* B B*’

* BC
*

*
*0

*
*0

*
*1

*
*1

*
*1

*
*1

*
*1

*
*0

* A
*

* A*’

00 01 11 10

0

* A * 1

Docsity.com

38

- This can be prevented by adding the redundant minterm *B.C* to the Boolean

expression as shown in the K-map with dashed line, and using a redundant gate to

implement that.

* C C*’ * C*’

**
**

**References:
**

[1] Digital Design 3rd Edition, By Morris Mano, Publisher Prentice Hall, 3rd Edition.

[2] Introduction to Logic Design, By S. G. Shiva.

Docsity.com