Problem 11.
Digital Widgets Co. has introduced a new logic IC consisting of two
comparator cells in a 14-pin package. A comparator cell, as drawn
below, has four inputs and two outputs.
The inputs are labeled An, Bn, Gn+1, and Ln+1, and the outputs are
labeled Gn and Ln. The G and L signals have the meanings "A greater
than B" and "A less than B," respectively. If both G and L are false,
the meaning is A = B. G and L are never both true. Two k-bit numbers
A and B may be compared using a circuit such as the following:
The most significant bits are supplied as Ak-1 and
Bk-1, and the least significant bits are A0 and B0.
The output of a comparison is taken from the G and L outputs of the
lowest-order cell (G0 and L0). Gn+1 and Ln+1 of the highest-order
cell are connected to logical 0 to indicate that the numbers are
assumed to be equal until some difference is found between a pair of
bits Ai and Bi.
If the Gn+1 and Ln+1 inputs indicate that higher-order bits have
established A > B or A < B, then cell n must propagate that
result to Gn and Ln. However, if Gn+1 and Ln+1 indicate that the
higher-order bits are equal, then cell n must compare its bit of A and
B to determine if A > B, A < B, or A = B and must signal that
result appropriately at Gn and Ln.
-
Draw a logic diagram for an implementation of the Digital Widgets
comparator cell.
The equations for Gn and Ln are
____ __
Gn = Gn+1 + Ln+1*An*Bn
____ __
Ln = Ln+1 + Gn+1*An*Bn
If we construct a schematic using INV, AND and OR, the resulting
circuit would have a Tpd of 3 gate delays.
-
Since there is delay associated with the propagation of the G and L
signals through each cell, we could make the comparator work faster
by redesigning the basic cell to compare two bits at a time, halving the number
of stages through which the G and L signals will need to propagate.
Work out expressions for Gn and Ln as functions of Gn+2, Ln+2,
An+1, Bn+1, An, and Bn. Express your answers in the form
____ ____ ____ ____ __
Gn = Gn+2 + Ln+2*(An+1*Bn+1 + (An+1*Bn+1 + An+1*Bn+1)*An*Bn)
____ ____ ____ ____ __
Ln = Ln+2 + Gn+2*(An+1*Bn+1 + (An+1*Bn+1 + An+1*Bn+1)*An*Bn)
-
Given a reasonable implementation of the equations for Gn and Ln
derived in part B, how does the delay from a change in Gn+2
and Ln+2 to the appearance of correct outputs at Gn
and Ln compare with the corresponding delay for a circuit composed
of a cascade of two of the cells developed in part A?
Assume that all A and B inputs remain unchanged throughout.
Note: The reason for our interest in the propagation delay of the G and
L signals, specifically, is that in a chain of N comparators, every
extra gate delay in the G--L path will penalize total performance by N
gate delays. The time it takes for a change in an A or B input to be reflected
in the corresponding G or L output is also important, but improvements here
can at best result in decreasing total delay by some constant amount.
If we expand out either equation for the two-bit-at-a-time cell, we end
up with 4 product terms, two of which involve 5 inputs. If we have
5-input gates in our library, we can implement the two-bit cell with the
same Tpd as the one-bit cell. So Gn and Ln are produced by a two-bit cell
with half the delay as from a cascade of two one-bit cells.
If we restrict ourselves to 4-input gates, this adds one gate delay
to Tpd for the two-bit cell (Tpd = 4), still an improvement over two
one-bit cells (Tpd = 6).
Problem 12.
The Xilinx 4000 series field-programmable gate array (FPGA) can be
programmed to emulate a circuit made up of many thousands of gates;
for example, the XC4025E can emulate circuits with up to 25,000 gates.
The heart of the FPGA architecture is a configurable logic block (CLB)
which has a combinational logic subsection with the following circuit
diagram:
There are two 4-input function generators and one 3-input function
generator, each capable of implementing an arbitrary Boolean function
of its inputs.
The function generators are actually small 16-by-1 and 8-by-1
memories that are used as lookup tables; when the Xilinx device is
"programmed" these memories are filled with the appropriate values so
that each generator produces the desired outputs. The multiplexer
select signals (labeled "Mx" in the diagram) are also set by the
programming process to configure the CLB. After programming, these Mx
signals remain constant during CLB operation.
The following is a list of the possible configurations. For each
configuration indicate how each the control signals should be
programmed, which of the input lines (C1-C4, F1-F4, and G1-G4) are
used, and what output lines (X, Y, or Z) the result(s) appear on.
-
An arbitrary function F of up to four input variables, plus another
arbitrary function G of up to four unrelated input variables, plus a
third arbitrary function H of up to three unrelated input variables.
Let X = F(F1, F2, F3, F4), Z = G(G1, G2, G3, G4), Y = H(C1, C2, C3).
The necessary control signals are:
MA = 1
MB = 1
MC = 0 (select C1)
MD = 1 (select C2)
ME = 2 (select C3)
-
An arbitrary single function of five variables.
Let Y = F(A1, A2, A3, A4, A5). This can be implemented using both
4-input logic functions, and selecting between the two outputs with
the 3-input logic function.
Z=f(A1, A2, A3, A4, 0),
X=f(A1, A2, A3, A4, 1),
Y= Z if A5=0, else Y=X
So Z is calculating F for the case when A5 = 0, X is calculating F for
the case when A5 = 1, and Y is selecting between X and Z with a
multiplexer function. A1-A4 represents F1-F4 and G1-G4 (they're
connected to the same 4 inputs) and A5 represents C1. The necessary
control signals are:
MA = 0
MB = 0
MC = X (value doesn't matter)
MD = X (value doesn't matter)
ME = 0 (select C1)
-
An arbitrary function of four variables together with some functions
of six variables. Characterize the functions of six variables that
can be implemented.
Let Z = G(G1, G2, G3, G4) - any function of 4 variables.
X = F(F1, F2, F3, F4)
Y = H(C1, C2, X) = H(C1, C2, F(F1, F2, F3, F4))
The functions of six variables which can be implemented (along with
the 4-variable function) are all those functions that can be
re-written as a function of 3 variables. The inputs to this function
of three variables must be 2 of the original variables and some
function of the remaining four variables. The necessary control
signals are:
MA = 0
MB = 1
MC = X (value doesn't matter)
MD = 0 (select C1)
ME = 1 (select C2)
-
Some functions of up to nine variables. Characterize the functions of
up to nine variables that can be implemented.
Let
X = F(F1, F2, F3, F4)
Z = G(G1, G2, G3, G4)
Y = H(C1, X, Z) = H(C1, F(F1, F2, F3, F4), G(G1, G2, G3, G4))
The functions of nine variables that can be implemented are all
those functions that can be re-written as a function of 3 variables.
The inputs to this three-variable function will be one of the original
variables, plus two separate functions of 4 variables (these two
4-variable functions will have the remaining 8 original variables as
inputs).
MA = 0
MB = 0
MC = X (value doesn't matter)
MD = X (value doesn't matter)
ME = 0 (select C1)
-
[Optional challenge] Can every function of six inputs be implemented?
If so, explain how. If not, give a 6-input function and explain why
it can't be implemented in the CLB.
The functions of 6 variables which we can implement must be of the form
Y = y(C1, C2, f(F1,F2,F3,F4))
or of the form
Y = y(C1, f(F1, F2, F3, F4), g(G1, G2, G3, G4))
(this second function will have some overlap between C1, F1-4, and
G1-4; some variables will be connected to multiple inputs)
Essentially, the functions we are able to implement are only those for
which we can factor a set of 4 variables out of the equation. For
example, the following function cannot be implemented by the CLB:
Y = A1A2A3A4A5 + A1A2A3A4A6 + A1A2A3A5A6 + A1A2A4A5A6
+ A1A3A4A5A6 +A2A3A4A5A6
This function cannot be broken down into either of the forms mentioned above.