Chapter 6

Page 120

The circuit for the four status flags is

Page 123

Instead of selecting one output line like the decoder in Figure 6-8, a BCD to seven-segment decoder selects several of the seven output lines for each 4-bit BCD input.

We start with a truth table that shows which segments are activated to display the numeral, 0 – 9, corresponding to the four xi BCD bits.

Digit x3 x2 x1 x0 a b c d e f g
0 0 0 0 0 1 1 1 1 1 1 0
1 0 0 0 1 0 1 1 0 0 0 0
2 0 0 1 0 1 1 0 1 1 0 1
3 0 0 1 1 1 1 1 1 0 0 1
4 0 1 0 0 0 1 1 0 0 1 1
5 0 1 0 1 1 0 1 1 0 1 1
6 0 1 1 0 1 0 1 1 1 1 1
7 0 1 1 1 1 1 1 0 0 0 0
8 1 0 0 0 1 1 1 1 1 1 1
9 1 0 0 1 1 1 1 1 0 1 1

The functional relationship between the four inputs and each of the seven outputs can be expressed as a sum of minterms.

a(x) = ∑(0,2,3,5,6,7,8,9)
b(x) = ∑(0,1,2,3,4,7,8,9)
c(x) = ∑(0,1,3,4,5,6,7,8,9)
d(x) = ∑(0,2,3,5,6,8)
e(x) = ∑(0,2,6,8)
f(x) = ∑(0,4,5,6,8,9)
g(x) = ∑(2,3,4,5,6,8,9)

We’ll use Karnaugh maps to simplify the functions for each of the seven segments. a(x) = x1 ∨ x3 ∨ (¬x0 ∧ ¬x2) ∨ (x0 ∧ x2)

b(x) = ¬x2 ∨ (¬x0 ∧ ¬x1) ∨ (x0 ∧ x1)

c(x) = x0 ∨ ¬x1 ∨ x2

d(x) = x3 ∨ (¬x0 ∧ ¬x2) ∨ (x1 ∧ ¬x2) ∨ (¬x0 ∧ x1) ∨ (x0 ∧ ¬x1 ∧ x2)

e(x) = (¬x0 ∧ ¬x2) ∨ (¬x0 ∧ x1)

f(x) = x3 ∨ (¬x0 ∧ ¬x1) ∨ (¬x0 ∧ x2) ∨ (¬x1 ∧ x2)

g(x) = x3 ∨ (¬x0 ∧ x1) ∨ (x1 ∧ ¬x2) ∨ (¬x1 ∧ x2)

This leads to a circuit for our decoder.

Page 132

We start with a truth table that shows the relationship of x compared to y. (Remember that GT and LT refer to signed values.)

x1 x0 y1 y0 EQ GT LT
0 0 0 0 1 0 0
0 0 0 1 0 0 1
0 0 1 0 0 1 0
0 0 1 1 0 1 0
0 1 0 0 0 1 0
0 1 0 1 1 0 0
0 1 1 0 0 1 0
0 1 1 1 0 1 0
1 0 0 0 0 0 1
1 0 0 1 0 0 1
1 0 1 0 1 0 0
1 0 1 1 0 0 1
1 1 0 0 0 0 1
1 1 0 1 0 0 1
1 1 1 0 0 1 0
1 1 1 1 1 0 0

We can specify the connections in the PLD for our comparator directly from the truth table.