# design of counters..pl help!

Discussion in 'Homework Help' started by cutesue, Jan 15, 2012.

1. ### cutesue Thread Starter New Member

Jan 15, 2012
2
0
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.

2. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
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.

Thank you.

3. ### cutesue Thread Starter New Member

Jan 15, 2012
2
0
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.

4. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
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.