RTUEE / EC / EEEYr 2019 · Sem 72019

Q9VHDL

Question

16 marks

5. (a) Draw a schematic diagram of data path circuit for multiplier operation. [8]

(b) What problems occur during clock synchronization? Also explain the techniques to avoid them. [8]

Answer

(a) Data Path Circuit for Multiplier Operation

Data Path for Shift-and-Add MultiplierMultiplicand reg (A)Multiplier reg (Q)Accumulator (ACC)AdderShift ACC:Q rightQ0 controls add/no-add

A typical data path for a shift-and-add multiplier operation consists of three registers - a multiplicand register (holding operand A), a multiplier register (holding operand Q, whose least-significant bit Q0 controls whether an addition occurs on each cycle), and an accumulator register (ACC, initially cleared to zero, holding the running partial-product sum) - together with an adder that computes ACC + A whenever the current Q0 bit is '1' (and simply passes ACC through unchanged, equivalently adding zero, when Q0 is '0'), and a shift-right unit that shifts the combined ACC:Q register pair one position to the right after each add/no-add step, bringing the next multiplier bit into the Q0 position for the following cycle while simultaneously shifting the accumulated partial sum into its correct final position.

This shift-and-add data path directly implements the standard multi-cycle binary multiplication algorithm: over N clock cycles (for N-bit operands), the multiplier examines each bit of Q in turn (starting from the least significant), conditionally adding the multiplicand into the accumulator based on that bit's value, then shifting the combined accumulator-multiplier register right by one position - after all N cycles complete, the combined ACC:Q register holds the full 2N-bit product. The control logic driving this data path (not shown in the schematic itself, but implemented as a separate finite state machine, as examined elsewhere in this examination) sequences through the add/shift steps N times and then signals completion, illustrating the classic separation between data path (the registers and arithmetic/shift hardware that actually process the data) and control unit (the FSM that sequences and coordinates the data path's operation over multiple clock cycles) that underlies virtually all multi-cycle digital arithmetic circuit designs.

(b) Clock Synchronization Problems and Avoidance Techniques

Several distinct problems can arise during clock synchronization in digital designs. Metastability occurs when an asynchronous input signal (one not synchronized to the local clock) changes value too close to the active clock edge of a sampling flip-flop, violating its setup or hold time and potentially causing the flip-flop to enter a metastable state (an unstable intermediate voltage level, neither clearly '0' nor '1') for an unpredictable, potentially arbitrarily long resolution time before finally settling to a valid logic level - if this metastable output is sampled by downstream logic before it has resolved, the metastability can propagate further into the design, potentially causing unpredictable, intermittent circuit malfunction. Clock skew (small differences in the exact arrival time of the same clock signal at different flip-flops across the chip, caused by differing clock-network wire delays) can, if large enough, cause a receiving flip-flop's data input to change before or after the intended clock edge relative to the transmitting flip-flop's own clock edge, potentially violating hold or setup time constraints even in an otherwise correctly-designed fully-synchronous circuit. Clock-domain crossing (CDC) issues arise whenever a signal originates in one clock domain (driven by one clock signal) and is sampled by flip-flops in a different clock domain (driven by a different, asynchronous or differently-phased clock), since the receiving domain's sampling flip-flop has no guaranteed safe timing relationship to the signal's actual transition time.

The standard technique to avoid metastability propagation is the synchronizer chain: passing an asynchronous signal through two (or more) cascaded flip-flops clocked by the receiving domain's clock before using the signal anywhere else in that domain, giving any metastable state that occurs at the first flip-flop additional clock cycles (equal to one full clock period per additional synchronizer stage) to resolve to a stable value before it can propagate further into the design, reducing the probability of metastability-induced failure to an acceptably low level for the vast majority of practical digital designs. Clock skew is managed through careful clock-tree design (using a balanced clock distribution network, such as an H-tree structure, specifically designed to deliver the clock signal to all flip-flops with minimal skew) and by including adequate timing margin in the static timing analysis constraints used during synthesis and place-and-route. Clock-domain crossing for multi-bit data (rather than single control signals) requires more elaborate techniques than a simple two-flip-flop synchronizer, such as using a dual-clock asynchronous FIFO (First-In-First-Out buffer, with separate write-clock and read-clock domains, internally using Gray-coded pointers and appropriate synchronizers to safely communicate the FIFO's fill status between the two clock domains) to safely transfer multi-bit data words between clock domains without risk of the receiving domain sampling a partially-updated, inconsistent multi-bit value.

The multiplier data path and the clock-synchronization problems discussed in this question are connected in an important practical way: the shift-and-add multiplier's control FSM, ACC register, and multiplier register all depend on being reliably clocked in a single, well-behaved clock domain, and if any of the multiplier's inputs (the initial operands A and Q, or a start/enable signal) originate from a different, asynchronous clock domain or from an external asynchronous source, the synchronization techniques discussed above (two-flip-flop synchronizer chains for single-bit control signals, or a dual-clock FIFO for safely transferring the multi-bit operand values) would be essential before those signals could be safely used within the multiplier's own internal clock domain, illustrating that clock synchronization concerns are not merely an abstract, separate topic but a practical necessity for the safe operation of exactly this kind of multi-cycle arithmetic datapath whenever it interfaces with signals from outside its own clock domain.

It is also worth noting why the shift-and-add multiplier's data path specifically shifts the combined ACC:Q register pair right, rather than shifting the operands left as some alternative multiplication algorithms do: shifting right after each conditional add allows the accumulator to progressively make room for the growing partial product while simultaneously shifting the not-yet-examined multiplier bits into the Q0 examination position, so that after exactly N shift-and-add cycles, the ACC:Q register pair holds the complete double-width product with no separate final alignment step needed - this right-shifting arrangement is what allows the single combined ACC:Q shift register to serve two purposes at once (holding the growing product in its upper bits, and holding the not-yet-processed multiplier bits in its lower bits), which is a large part of why this particular shift-and-add structure is the standard textbook approach to hardware multiplication rather than one of several equally common alternatives.

Back to Paper