# Up/down sequence counter using 74191

#### Eman_Ali

Joined Nov 28, 2014
5
Hi all, I need to make up/down counter using 74191 that generates the following sequences
9, 8, 7, 6,5,4,9,...
1,2,3,4,5,6,....
The Ic has 4 inputs A,B,C,D. How will I connect my 6-inputs (each of 4-bits ) to the Ic.
Thanks.

#### Attachments

• 39.3 KB Views: 326

#### WBahn

Joined Mar 31, 2012
26,398
First, you need to show YOUR attempt to solve YOUR homework problem.

You also need to express your problem more clearly. You are saying that you have to make a single counter that generates two different sequences. What determines which sequence is produced? Are you supposed to be able to switch between the two sequences at any time by flipping a switch? What?

What are these six four-bit inputs you are talking about. That's 24 bits of input. The IC only has a total of eight input pins, and that's counting the clock.

#### shteii01

Joined Feb 19, 2010
4,644
Each of your numbers is represented by 4 bits (A, B, C, D).
Now it is time to write a truth table. Go ahead and write it out.

#### Eman_Ali

Joined Nov 28, 2014
5
Ok,I have worked on displaying only the first sequence (9,8,7,6,5,4,9..) for now, if the counter output is other than (9 to 4) the digit 9 is loaded. The pin (up/down) is connected high. I used a k-map to simplify the out put Y. Attatched is my attempt. Ive done it on bread board but it only displays (3 then 2). Do you have any suggestions ? Thanks

#### Attachments

• 28.2 KB Views: 261

#### WBahn

Joined Mar 31, 2012
26,398
Things look okay at first glance. Your direction pin isn't "up/down" it is "down/up". It makes a difference. Think of the name as being two different but equivalent names, "down" and "/up". A HI input means that "down" is TRUE and, equivalently, that "NOT up" is TRUE. Avoids a lot of confusion. Also, on your diagrams, be sure that you indicate that the Load signal is active-LO. You can do that with a bubble at the pin or by calling the signal "/load".

Do you have access to an oscilloscope or logic analyzer so that you can look at the signals on the various pins? It may be nothing more than a simple breadboarding error.

#### shteii01

Joined Feb 19, 2010
4,644
Ok,I have worked on displaying only the first sequence (9,8,7,6,5,4,9..) for now, if the counter output is other than (9 to 4) the digit 9 is loaded. The pin (up/down) is connected high. I used a k-map to simplify the out put Y. Attatched is my attempt. Ive done it on bread board but it only displays (3 then 2). Do you have any suggestions ? Thanks
That truth table looks too simple.
Your truth table should have Present State, Next State.

#### Eman_Ali

Joined Nov 28, 2014
5
Unfortunately, I don't, but I have another look on the wiring. Thanks a lot !

#### shteii01

Joined Feb 19, 2010
4,644
Ok, I see your point. I might have been thinking of designing from ground up, but you don't need that, you already have 74191 that does the counting.
So.
1) Select down count.
3) Enable count.
4) You counted down to 4. The next transition from 4 to 3, what happens here? Stop?

#### Eman_Ali

Joined Nov 28, 2014
5
Yes, Do you think its a bread board problem or a problem with the steps of design its self ?

#### WBahn

Joined Mar 31, 2012
26,398
That truth table looks too simple.
Your truth table should have Present State, Next State.
Since he is using a counter, his diagram becomes more generalized in which he has one "state" which includes all counter values for which the counter decrements and another "state" which includes all counter values for which the counter resets.

#### WBahn

Joined Mar 31, 2012
26,398
Ok, I see your point. I might have been thinking of designing from ground up, but you don't need that, you already have 74191 that does the counting.
So.
1) Select down count.
3) Enable count.
4) You counted down to 4. The next transition from 4 to 3, what happens here? Stop?
No, he goes back to 9. This is implied by his first post where he has "9,8,7,6,5,4,9,...". Since the counter has an asynchronous reset, he needs to trap a count value of 3 (which should last for such a short time that it can't be seen on the display, although any circuit looking at the output might well respond to it -- a point that is often overlooked in digital design classes).

#### shteii01

Joined Feb 19, 2010
4,644
Yes, Do you think its a bread board problem or a problem with the steps of design its self ?
How do you generate clock signal?
If you run it slow, you could just hook up led to Q0-Q3 and see your 74191 outputs. Like the first value should be 9. You said that you saw 3, I assume on 7 segment. So you are not really seeing output of 74191. It may or may not matter, I admit. But since you are not getting right result you have to troubleshoot the circuit and it makes sense to start with the first block of the circuit.

#### WBahn

Joined Mar 31, 2012
26,398
Yes, Do you think its a bread board problem or a problem with the steps of design its self ?
Given the quick look I gave it, I think your design is okay. I would look at the implementation. One way to do this, if you can't spot something wrong fairly quickly, is to simplify the design and just feed back, say, Q2 to the /load input and reset the counter to something that has Q2 asserted, such as a value of 7. This should then count 7,6,5,4,(3)7,... where (3)7 means that it goes to state 3 momentarily before going to 7.

#### WBahn

Joined Mar 31, 2012
26,398
How do you generate clock signal?
If you run it slow, you could just hook up led to Q0-Q3 and see your 74191 outputs. Like the first value should be 9. You said that you saw 3, I assume on 7 segment. So you are not really seeing output of 74191. It may or may not matter, I admit. But since you are not getting right result you have to troubleshoot the circuit and it makes sense to start with the first block of the circuit.
Slowing your clock is a very good idea. If you know how, you could even make a single-step circuit so that you get one clock pulse each time you press a button. Something like this really should be one of the first circuits that digital courses have students implement as it is very useful.

#### shteii01

Joined Feb 19, 2010
4,644
Slowing your clock is a very good idea. If you know how, you could even make a single-step circuit so that you get one clock pulse each time you press a button. Something like this really should be one of the first circuits that digital courses have students implement as it is very useful.
We did these circuits in lab and we used frequency generator, so we could slow it down or speed it up pretty much as much as we liked. Made for pretty light show, at times.