# Mod 32 Counter by 5 Logic Cicuit

Discussion in 'The Projects Forum' started by beleg, May 14, 2016.

1. ### beleg Thread Starter New Member

May 14, 2016
5
0
Hey guys I need help on my project.
I need a counter that counts with a push of a button and displays it in a 7 segment display.It must count by 5 up to 32 like this:0, 5,10, 15, 20, 25, 30, 3, 8, 13, 18, 23 28 01, ... I created a simulation works just fine. However, I was not able to build a physical circuit. Can anyone draw a blueprint for me , so i can build a physical circuit. Here is my logisim simulation:http://www.mediafire.com/download/hxbb554l9aa7y58/BLG231E-Project.circ

2. ### AnalogKid Distinguished Member

Aug 1, 2013
4,685
1,297
Last edited: May 14, 2016
3. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
There is just one sequence. It is counting by five modulo 32. 30 + 5 ≡ 35 ≡ 3 (mod 32). Similarly, 28 + 5 ≡ 33 ≡ 1 (mod 32).

The sequence consists of 32 values given by

5·n mod 32 where n = {0, 1, 2, ..., 29, 30, 31}

When n = 31, 5·31 ≡ 155 ≡ 27 (mod 32). Upon adding five more you are at 32 ≡ 0 (mod 32) and the sequence repeats.

4. ### AnalogKid Distinguished Member

Aug 1, 2013
4,685
1,297
One approach would be a binary counter as one input to a binary adder, with a constant 5 as the other input.

ak

5. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
Please post a screen shot of your Logisim schematic here. Don't force people to go out to some third party site and download and open what may or may not be a safe file. Also keep in mind that only a fraction of members will even have Logisim, so a screen shot of the schematic is far more useful to many more people.

If your simulation works but your physical build doesn't, then generally either the physical build isn't faithful to the schematic or the schematic is sloppy and leaves out important details (details that the simulator isn't sensitive to or doesn't rigorously enforce). It's hard to tell which is more likely until we see the schematic.

6. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
That's probably the most obvious and quickest approach and a very good starting point. Since the second input IS constant, significant circuit simplifications can be made if device count minimization is important.

7. ### beleg Thread Starter New Member

May 14, 2016
5
0
I am sorry you are very right. How inconsiderate of me. Here is schematic :
and but it is not applicable since there are splitters. What I want from you is a design works as simulation but pretty much like this :

I mean with microchips.

8. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
First off, you are NOT going to get us to do YOUR homework for you. If that is what you are looking for then you are wasting everyone's time.

We will look at YOUR attempts and point things out for YOU to consider and then revise YOUR work accordingly.

One of the first things you need to take into account is that simulators often allow you to leave unused inputs floating. They shouldn't, but they often do. The real world isn't nearly as forgiving. You NEVER leave CMOS inputs floating. This can not only result in errant behavior, but can physically destroy the chips. You MUST tie ALL unused outputs to an appropriate logic level, either HI or LO, depending on the function of that input. You SHOULD leave unused outputs disconnected (they will be driven to a defined state by the internal circuitry of the chip and if you tie it hard to the wrong level it will contend with that level, again possibly leading to errant behavior and or physical damage, though most modern chips will limit the current to avoid damage).

9. ### beleg Thread Starter New Member

May 14, 2016
5
0
Please forgive WBahn. You misunderstood me and its my fault, because i believe I have not told my problem clearly.
You have to understand me I am new to these topics. Yes it is my course's ending project but I am not trying to you to do MY homework.
Let me rephrase my problem. I designed a circuit in Logisim that fits my requirements but since I am not familiar with microchips i was not able to create the circuit physically. In fact the second picture that i used in my previous comment was my attempt to it. The problem of my design is not resseting after 31 . In simulation it was pretty easy to solve since I set adder to five bits. I am asking help to fix this design to reset after 31:

10. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
What do you mean by "resetting after 31"?

If it is a mod-32 counter that is counting by five then the state following 31 is 4.

11. ### AnalogKid Distinguished Member

Aug 1, 2013
4,685
1,297
By resetting he means roll over.

GopherT likes this.
12. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
If that circuit is your attempt thus far, how are you expecting it to count by five? It looks like it is configured as just a normal BCD counter (aside from all of the floating inputs, which may prevent it from counting at all).

What is your plan to count by five? You said that you have it working in the simulator, so that must be with some other circuit than the one you are posting here.

13. ### beleg Thread Starter New Member

May 14, 2016
5
0
No both of them works just fine by counting five. I just want to physical one to have mod 32.

14. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
Please explain how that circuit counts by five. What would you do differently to make it count by one?