Maker Pro
Maker Pro

40 second down counter with 193

mattkesner

Apr 13, 2012
6
Joined
Apr 13, 2012
Messages
6
I am attempting to make a 40-0 down counter using a 74ls193. My problem is when the circuit counts down it goes 32,31,29 and skips 30. It does this on every time there is a 0. Any solutions are helpful and there are no restrictions on chips.
 

GreenGiant

Feb 9, 2012
842
Joined
Feb 9, 2012
Messages
842
have you tried a different 74ls193?

how fast is your clock speed?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Unless I'm misreading what you're saying, your major problem is that the 74LS193 can only count 16 states (15 down to 0).

This either means you have 2 of them or 1 misunderstanding.

If you have 2 of them, then presumably you have connected them together correctly to borrow/carry?

Also, presumably you're looking at the binary output (not decoding them to a pair of 7 segment displays -- if you were doing this you'd be using a pair of 74LS192s).

So....

Show me the 6 bits that correspond to 40, and the values you get as you decrement the counter.

I'd be expecting something like

1 0 1 0 0 0 (where 1 is a logic high, 0 is logic low)
1 0 0 1 1 1
1 0 0 1 1 0
.
.
.

edit: and show me the schematic.
 

mattkesner

Apr 13, 2012
6
Joined
Apr 13, 2012
Messages
6
i am using 2 193s and yes they are connected to carry. My problem is that i can not get the ones place on the 40 second timer to ever go to 0. It always goes 35, 34, 33, 32, 31, 29. Skipping 30. It does this every time. Any help will be greatly appreciated.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
OK, you need to show us the schematic you've used. And if this is on a breadboard, an image of that too.
 

mattkesner

Apr 13, 2012
6
Joined
Apr 13, 2012
Messages
6
5
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
It looks like when the least significant counter reaches binary 0000, it triggers the most significant counter to decrement, and at the same time loades bin 1001(9) into the least significant counter. So after you have a 3 and 1(31), the 1 goes to zero, and you would expect a 3 and 0 (30), but it immediately does the decrement and load, so a 2 for the decrement and a 9 for the load(29). (Yeah, skipping the 30)

The circuit is watching for the 0000 with the 4-way AND (U3A:74LS20N) You want to do the decrement and the load after the 0000 has passed. (I see now that the 74LS20N is actually a NAND)

It looks like from the 74LS193N datasheet that when it gets a down trigger and it's at 0000 it goes to 1111. I am thinking that you should be watching for the 1111 to show up and then decrease the most significant digit and load the 1001. (9)

Wait... I was just about to tell you to invert the 4 singals to the 74LS20N, but I see you have them inverted already. Maybe you already thought of this.

But I just realized that the 74LS20N is a NAND not an AND, and now I'm getting confused.

I think maybe you just need to remove the 4 invertors. (4 x 74LS04N)

Just make sure the "decrement", and "load" happen when the 74LS193N is at 1111 rather than 0000.
-t
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
It looks like when the least significant counter reaches binary 0000, it triggers the most significant counter to decrement, and at the same time loades bin 1001(9) into the least significant counter. So after you have a 3 and 1(31), the 1 goes to zero, and you would expect a 3 and 0 (30), but it immediately does the decrement and load, so a 2 for the decrement and a 9 for the load(29). (Yeah, skipping the 30)

In which case, the trivial answer is to load 1010 (10) rather than 1001 (9).

Incidentally if it was stated that the counters are working in BCD rather than binary, this would have been something that may have been suggested very quickly.

In addition, it is possible that a BCD counter may have been suggested (a 4510 for example) to make the whole thing a lot easier
 

mattkesner

Apr 13, 2012
6
Joined
Apr 13, 2012
Messages
6
It looks like when the least significant counter reaches binary 0000, it triggers the most significant counter to decrement, and at the same time loades bin 1001(9) into the least significant counter. So after you have a 3 and 1(31), the 1 goes to zero, and you would expect a 3 and 0 (30), but it immediately does the decrement and load, so a 2 for the decrement and a 9 for the load(29). (Yeah, skipping the 30)

The circuit is watching for the 0000 with the 4-way AND (U3A:74LS20N) You want to do the decrement and the load after the 0000 has passed. (I see now that the 74LS20N is actually a NAND)

It looks like from the 74LS193N datasheet that when it gets a down trigger and it's at 0000 it goes to 1111. I am thinking that you should be watching for the 1111 to show up and then decrease the most significant digit and load the 1001. (9)

Wait... I was just about to tell you to invert the 4 singals to the 74LS20N, but I see you have them inverted already. Maybe you already thought of this.

But I just realized that the 74LS20N is a NAND not an AND, and now I'm getting confused.

I think maybe you just need to remove the 4 invertors. (4 x 74LS04N)

Just make sure the "decrement", and "load" happen when the 74LS193N is at 1111 rather than 0000.
-t

I tried removing the inverters and for some reason the ones place now resets at 7 or in other words it goes 39, 38, 29, 28.
 

mattkesner

Apr 13, 2012
6
Joined
Apr 13, 2012
Messages
6
In which case, the trivial answer is to load 1010 (10) rather than 1001 (9).

Incidentally if it was stated that the counters are working in BCD rather than binary, this would have been something that may have been suggested very quickly.

In addition, it is possible that a BCD counter may have been suggested (a 4510 for example) to make the whole thing a lot easier

i am unfamiliar with BCD counters
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
BCD is just binary coded decimal. Your using a BCD to 7-segment convertor. The 74SL47N. (not a counter, just converotor) A BCD counter counting down from hex10 would skip 0F, 0E, 0D, 0C, 0B, and 0A and land on hex09. Counting up skipping those same hex numbers. The value is still stored as hex, but counts as if it was decimal. They might be what you need instead of using binary coded binary to count in decimal. I noticed one thing while trying to look up the datasheet on the 74LS193N. The 74LS192N is BCD, so it might be easy to swap the 193's for 192's. I think they have a carry output that would make it east to trigger the carry event that you are doing manually. (Although, I wasn't sure I actually was looking at the datasheet for your exact chip. There was something unclear about the designation. Extra letters. I looked at "SN74LS193N3" More experienced people would probably know whether they were looking at the right thing.)

Apart from switching to a new chip...
Is there a way to activate the clock one cycle at a time and look at the logic level at these displayed locations and see what they are when the counter shows 38 and again when it switches to 29?
toomanyNANDsandINVERTORs.jpg

Just to try and see why this is happening.
--tim
edit:
My thinking is that the U3A NAND should not be triggering the "Decrement and Load" unless all 4 inputs are are 1111 (or 0000. The NANDing and INVERTing is still messing me up a bit.) But certainly not on 0111 or 1000. Not on a 7!!! :)
:endEdit
edit2:Got a link to the datasheet on the 193's?:endEditTwo
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Yes, once you realise that what you're doing has a name, finding easier solutions becomes... easier.

edit: having said that, since you may have built this up and don't want to re-design it. Just changing the preload to 1010 rather than 1001 should fix the problem you report here.
 

vikki

Dec 10, 2013
1
Joined
Dec 10, 2013
Messages
1
you should give borrow out to load....... by doing this you get 30 :) and your problem is permanently solved :)
 
Last edited:
Top