design of counters..pl help!

Thread Starter

cutesue

Joined Jan 15, 2012
2
can u plz tell me how to solve this question..
Please design a counter that counts the number of times the
number “5” appears in an 4-bit input stream. The I/O are as follows:
NumberIn : 4-bits wide (input)
Start: Reset counter and overflow flag to zero while start is high (input)
Count: 8-bit unsigned count (of the number of “5”s that have occurred since start went
low (output)
Overflow: Goes high if count overflows (count is unsigned, so you only need to monitor
the adder carry out) and stays high until start is re-asserted.

Design this functional unit down to the logic (gate) level. An adder is required – you can represent
this as a “+” unit – no need to design its detail. There is no need to optimize the design.
The only flip-flop you can use is a D flip-flop, and its clock input can only be connected
to “clock”. You can NOT use a flip-flop with preset or clear. Muxes and adders can be
drawn as single blocks, you do not have to design their internal structure.
 

Georacer

Joined Nov 25, 2009
5,182
Welcome and welcome to AAC!

The Homework Help section rules ask that you post the work you have done so far so we can see it and find where you went wrong, or suggest better approaches. We will not do all your work for you, no matter how little time is left before it must be submitted.

If you are in doubt about how to structure your post and what to include please read this thread: http://forum.allaboutcircuits.com/showthread.php?t=3002

Thank you.
 

Thread Starter

cutesue

Joined Jan 15, 2012
2
I have some ideas.. but i am not sure. Please check this and help me out.
serial input -> (4 bit serial to parallel converter driven by a clock)
these parallel outputs given to a 16-1 multiplexer as select lines ; the input to mux being all zeroes except input line 5(which is 5v dc).
this output line is given as the input to a counter(made from D flip flops)

start is NAND with sum and carry to make it always zero when start is high?
but i am doubtful because the question is not supposed to be this simple.
 

Georacer

Joined Nov 25, 2009
5,182
Don't think so complicated. You want to "see" only the fives or the 0101. Use some inverters and an AND gate to recognize that input and feed it into an 8 bit synchronous counter.
 
Top