AND gates & the 4060

happs

Joined Feb 27, 2005
24
Hey peeps

I am just wondering about how to make my own AND gate. In a previous topic, beenthere, pointed out that having a 4060 binary counter reset on count 9 or 10 was not possible because it is a 16 stage counter. I understand now, thanks beenthere, why this is not possible but I was wondering if using an AND gate on Q4 and Q0 (binary 1 and 8) would work ?

I did try it briefly last night ...

I used TWO transistors to build an AND gate from binary 1 and 8 of the 4060, and then to it's RESET ... this didn't work, lol so is my schematic correct ? ...

[attachmentid=453]

In this set up the 7 segment display I have connected up (through a 74LS47) stayed on 0. Is there, therefore, noway to have the 4060 reset on the 9th count, so the 7 segment display goes .. 0,1,2,3,4,5,6,7,8,9 then back to 0,1,2 .. etc.

Is my AND gate correct ?? I kinda guessed at it.

Anyway, anotehr idea I had this morning while musing in bed was that if I could connect the 4060's binary 1 to the count input of a 4017 then I could send the 9th count of the 4017 (or 10th, I can't work out what's correct right now) to the reset of the 4060 ??? !!!! Would that work ?? !!

Heheh, I know I could just buy a different binary counter that would allow me to reset on the 10th count but messing around and doing it this way I think I learn more.

Anyway ..

- Happs

hgmjr

Joined Jan 28, 2005
9,027
Having looked at your AND gate design (thanks for the diagram by the way), I think the problem lies in the way that the transistor works. I understand that you are driving these two transistors from a 3 volt logic signal. Assuming that the transistor on top in your diagram has 3 volts applied to the base when Bit 2^0 goes high then the top transistor is ready to allow current to flow from its collector to its emitter. Then say Bit 2^3 goes high taking the base of the lower transistor to 3 volts.

Since the bases of both the top and bottom transistor are then at the same voltage level, The top transistor is not able to supply any significant current to the collector of the bottom transistor and so for all practical purposes the base-emitter junction is acting like a diode in series with the signal connected to its base.

Most likely the 0.7 volt diode drop across the base-emitter junction of the bottom transistor is not allowing the voltage to rise high enough at its emitter to satify the voltage level that corresponds to a logic high at the input to the reset pin or your circuit would have work to some degree. Allbeit not like you intended.

I have attached a possible solution to your discrete transistor AND gate.

NPN's Q1 and Q2 implement a NOR function while PNP's Q3 and Q4 are inverting stages. What you end up with is a negative logic OR which equates to a positive logic AND gate.

The outputs of Q1 and Q2 will remain low until the inputs to Q3 and Q4 go high simultaneously at which time the outputs of Q1 and Q2 will go high and reset your counter. I think that is the logic scheme you are looking for. It is worth a try anyway.

Your other idea of using standard logic gates will work also. But as you said, it is more fun to take an approach that permits you to gain a deeper understanding of the way circuits work.

Good Luck

[attachmentid=454]

mozikluv

Joined Jan 22, 2004
1,435
hi

here are some of possible configurations of discrete AND GATES

pebe

Joined Oct 11, 2004
626
Originally posted by happs@Mar 6 2005, 07:48 PM
Hey peeps

I am just wondering about how to make my own AND gate. In a previous topic, beenthere, pointed out that having a 4060 binary counter reset on count 9 or 10 was not possible because it is a 16 stage counter. I understand now, thanks beenthere, why this is not possible but I was wondering if using an AND gate on Q4 and Q0 (binary 1 and 8) would work ?.......

- Happs
[post=5887]Quoted post[/post]​
How did you get Q0? According to the data sheet I've got, there isn't a Q0 on a 4060

happs

Joined Feb 27, 2005
24
Originally posted by pebe@Mar 7 2005, 06:33 AM
How did you get Q0? According to the data sheet I've got, there isn't a Q0 on a 4060
[post=5907]Quoted post[/post]​
Sorry, yeh I think I meant Q4 and Q7, pebe.

Thanks for the schematic diagrams, guys. I will try them out in a little while, see what happens, and get back to you. I should really learn more about current and voltage I think, probably resistance would help to! Heheh.

- Alex

pebe

Joined Oct 11, 2004
626
Originally posted by happs@Mar 7 2005, 04:12 PM
Sorry, yeh I think I meant Q4 and Q7, pebe.

Thanks for the schematic diagrams, guys. I will try them out in a little while, see what happens, and get back to you. I should really learn more about current and voltage I think, probably resistance would help to! Heheh.

- Alex
[post=5909]Quoted post[/post]​
Hi happs,
You won't be able to get a 4060 to count to 8 and then reset.
Binary counters use divide-by-2 stages (Flip Flops), with each FF making the next one change state as it goes to zero. So the output from the first (Q1) is the clock pulse divided by 2. The next (Q2) is Q1 divided by 2..... and so on.

So the Q outputs going high give a count of:
Q1=2,Q2=4.Q3=8,Q4=16,Q5=32... and so on

On the 4060 the outputs Q1 to Q3 are not brought out to pins so the first count you can get at is divide-by-16.

If you need to reset at a count of 8 (Q3) then I think the only binary counter to do that is a 4024. That is a 7 stage counter giving outputs from Q1 thru Q7.

If you use that, wiring reset to Q3 will give a count 0 to 7 with reset at 8.
If you want to include 8 then use your 2 transistor AND gate connected to Q1 and Q3 to give reset at the count of 9.

You can get it to reset wherever you like with gates. eg. ANDing Q3 and Q5 will reset at acount of 40

I hope that helps.

happs

Joined Feb 27, 2005
24
Hi Pebes,

Thanks for the message I see what you're saying now and have given up on that little project! Heheh I think I have ordered a 4024 to be here tomorrow so I'll make a new circuit with that.

All you guy's help is really appreciated and I am very thankful for it. It's cool to have somewhere that I can come to to boucne ideas of people and help if I need it. You have been great

- Happs

Originally posted by pebe@Mar 7 2005, 04:36 PM
Hi happs,
You won't be able to get a 4060 to count to 8 and then reset.
Binary counters use divide-by-2 stages (Flip Flops), with each FF making the next one change state as it goes to zero. So the output from the first (Q1) is the clock pulse divided by 2. The next (Q2) is Q1 divided by 2..... and so on.

So the Q outputs going high give a count of:
Q1=2,Q2=4.Q3=8,Q4=16,Q5=32... and so on

On the 4060 the outputs Q1 to Q3 are not brought out to pins so the first count you can get at is divide-by-16.

If you need to reset at a count of 8 (Q3) then I think the only binary counter to do that is a 4024. That is a 7 stage counter giving outputs from Q1 thru Q7.

If you use that, wiring reset to Q3 will give a count 0 to 7 with reset at 8.
If you want to include 8 then use your 2 transistor AND gate connected to Q1 and Q3 to give reset at the count of 9.

You can get it to reset wherever you like with gates. eg. ANDing Q3 and Q5 will reset at acount of 40

I hope that helps.
[post=5913]Quoted post[/post]​

hgmjr

Joined Jan 28, 2005
9,027
pebe,

Do you think this circuit would work for happs?

The only thing that he would have to consider is that the frequency of his input clock would have to be 16 times the frequency he wanted the 7-segment display to change at. For example, if he needed the display to count seconds he would need to use a 16 Hertz clock.

I took the extra precaution of ANDing the inverted clock signal to minimize the possible brief display of the pattern for decimal 10 (binary 1010).

[attachmentid=460]

pebe

Joined Oct 11, 2004
626
Originally posted by hgmjr@Mar 8 2005, 12:51 PM
pebe,

Do you think this circuit would work for happs?

The only thing that he would have to consider is that the frequency of his input clock would have to be 16 times the frequency he wanted the 7-segment display to change at.  For example, if he needed the display to count seconds he would need to use a 16 Hertz clock.

I took the extra precaution of ANDing the inverted clock signal to minimize the possible brief display of the pattern for decimal 10 (binary 1010).
[attachmentid=460]
[post=5925]Quoted post[/post]​
hgmjr,
I didn't look at happs's earlier thread when I answered before. Now I see he needs to reset on a couint of 10.

Your circuit should be OK when running the clock at x16, as you say. I don't think your second AND gate is necessary because when the count of 10 is reached, the reset will operate in nanoseconds and you will never see it count to 10. Just AND the 2 and 8.

hgmjr

Joined Jan 28, 2005
9,027
Terrific. Thanks for the feedback pebe.

Happs,

If you decide to fiddle with your original circuit a little more before you tackle the new one, You should be able to use either a single AND-gate device (the second one is not needed as pebe pointed out) or use the discrete version I posted earlier and get a few more miles out of your breadboard. That is if you haven't ripped it up already.

Is this stuff fun or what?

happs

Joined Feb 27, 2005
24
Hey guys

Thanks for the suggestions and help. I havn't demolished the circuit yet, I have it on one side of the breadboard still I recieved some AND gates in the post today and will develop your ideas into the circuit later All your help is really cool and you're being an invaluable source of information so thankyou all for that

I have been working on a light sensing circuit last night and today which works pretty well now I have refined it! I noticed that the circuit responded to light in a linear fassion, ie. If it's in semi-dim light then the LED will respond respectively; only partly lit, I got around this by adding a 555 monostable circuit to it and this smooths out the on/off signal really well. Hopefully, I will make something of it in the next month or so by using it to control some motors and build a primative robot that goes towards light. I have made the circuit, using the 555 timer, so in one state (high) a red LED is lit, and in the other state (low) a green LED is lit. I am thinking of wiring up some motors so when it is the low state the robot turns around in a full 360o circle and if light falls on the photo-transistor, while it is turning, the robot stops turning and begins to move forward.

I think, from what I have read, stepper motors are what I should use. That's something that I will have to learn in the next month I guess.

- Alex