Sunday, April 19, 2009

Gray Counter from D flip flops?

Design a two-bit gray counter with the following state diagram using two D- flip flops with


appropriate logic gates.





I need to know which logic gates I need to put in circuit with my D flip flops in order to make a gray counter (00-%26gt;01--%26gt;11--%26gt;10--%26gt;00...)

Gray Counter from D flip flops?
Let%26#039;s call the two bits b1 and b0. From the state transition table, you can see that b0 (the lower bit) should toggle when the two bits are same, and b1 (the higher bit) should toggle when the two bits are different.





In other words, the two bits can be described as:


- if b0=b1 then b0* (at the next clock cycle) takes the value of NOT b0, else b0* takes the value of b0


- if b0=b1 then b1* (at the next clock cycle) takes the value of b1, else b1* takes the value of NOT b1





Translate the two descriptions into logic gates:


b0* %26lt;-- [(b0 xor b1) and b0] or [not(b0 xor b1) and not(b0)]


b1* %26lt;-- [(b0 xor b1) and not(b1)] or [not(b0 xor b1) and b1]





b0 and b1 are the output (Q) signals of your D flip-flops, and b0* and b1* should be connected to the input (D) signals to the flip-flops. You just need to wire the signals through the gates in the formula. You can save a few gates by using the Q%26#039; (inverted output) signal for not(b0) and not(b1) if they are available. You can also use a single xor gate for all four (b0 xor b1) terms, and branch the result four times.





Sorry I can%26#039;t put a picture here... hope I explained clearly enough.
Reply:How can anybody answer this question, when there is no way to upload schematics to Yahoo answers? You need NAND and NOR gates, but how can I tell you where to stick them???




beauty

No comments:

Post a Comment