ASIC Verification

Monday, April 21, 2008

Sequence Detector - Solution



The solution for the problem is given here.

Friday, April 18, 2008

Sequence Detector

Design a state machine, that outputs a '1' one and only when two of the last 3 inputs are '1'. For example, if the input sequence is 0110_1110 then the output will be 0011_1101. Assume that the input 'x' is a single bit serial line.

Mod - 10 counter

A Mod-10 counter has 10 possible states, in other words it counts from 0 to 9 and rolls over. Let's take a look at how to build a Mod-10 counter.

The first step is to determine how many flip-flops to use. We will use JK FFs for our design. Since we need 10 states, 4 FFs will be required. The trick is to find a way not to use all of those states. There must be a way to force the counter to stop counting at 9 and roll over to 0. This is where an asynchronous inputs come into play. The asynchronous inputs can over-ride the synchronous inputs and force the outputs to either LOW or HIGH.

Looking at the truth table, the counter should run from 0000 to 1001 and roll over to 0000 again. Since the counter has to display 1001, the next binary value 1010 will be used to reset the counter to 0. For a JK FF, we have an asynchronous input called CLEAR, when you assert this, flop's output goes to 0. Since this CLEAR input is active high, we can use AND gate. The 2 FFs where a '1' occurs will be tied to an AND gate and the output will be tied to a CLEAR input. When the counter goes to 1001, the AND gate has a value '1' on its output and will activate the CLEAR inputs of all FFs.



Thursday, April 17, 2008

DAG

Suppose we wanted to add an OAI gate, OAI(A, B,C) = not [(A + B) ⋅C], to the target gate library for our synthesizer. If the synthesizer uses the Directed Acyclic Graph (DAG) covering method for mapping equations to gates, what would be the appropriate primitive DAG (i.e., an equivalent circuit which uses only inverters and 2-input NANDs) for this new gate?

Counter design using FSM

Design a 3-bit counter that counts in binary or in Gray code, depending on the values of a “mode control input”. This synchronous 3-bit counter has a mode control input m. As long as m = 0, the counter steps through the binary sequence 000, 001, 010, 011, 100, 101, 110, 111 and repeats this sequence. As long as m = 1, the counter advances through the Gray code sequence 000, 001, 011, 010, 110, 111, 101, 100 and repeats this sequence. However, it is possible that the mode input changes at any time in any of these sequences.

For example, assume that the mode input is 0 for the first two clock cycles but changes to 1 in the third clock cycle and stays at 1 in the fourth clock cycle. (That is, m goes through the sequence 0, 0, 1, 1.) Then, the output will be 000, 001, 010, 110, 111. In this example, 000 is the initial state. The first two state transitions (000->001->010) occurs in the binary counting mode. Then, because m = 1 from the third clock cycle onwards, the state goes from 010->110->->111, as indicated in the Gray code sequence.

In addition to the mode control input, there is a reset input. This synchronous counter should go to the 000 state if asserted.