# [Solved] AND as logic switch?

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by johnyradio, Aug 9, 2017.

Tags:

Joined:
Jun 16, 2012
Messages:
29
Likes:
0
Hi

Based on the logic table for AND gates, i should be able to use either as a simple digital switch. That is, say input 1 is running at 40khz, and input 2 is 1 Hz. Then, every second, our output should toggle between 0 for half a second, then 40kHz for half a second. Correct?
http://www.electronics-tutorials.ws/boolean/bool_1.html

I'm not getting that in this falstad. What am i doing wrong?
http://tinyurl.com/y92bwo98

thx!

2. ### jpanhaltWell-Known MemberMost Helpful Member

Joined:
Jun 21, 2006
Messages:
5,903
Likes:
502
Location:
Cleveland, OH, USA
ONLINE
Your signals are 40 Hz (not kHz) and 1 Hz. The timing changes about every 25 ms, which seems about right.

Joined:
Jun 16, 2012
Messages:
29
Likes:
0
My bad, changed to 40kHz.
http://tinyurl.com/y9v6uml8

What i'm seeing does not make sense to me. I should see a 40kHz signal that lasts for 1/2 second, then no signal for 1/2 second, then repeat.

Right?

Why 25ms?

thx

Last edited: Aug 9, 2017

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### jpanhaltWell-Known MemberMost Helpful Member

Joined:
Jun 21, 2006
Messages:
5,903
Likes:
502
Location:
Cleveland, OH, USA
ONLINE

40 Hz is 25 ms per cycle.

Just did an LTSpice simulation. Same result:

Note, since the logic is AND, when either input is off, the output is off. And as expected, when the 1 Hz is on, the output will switch on and off at 40 kHz. That is what you are seeing (I suspect), if you zoom in on your time scale.

John

Joined:
Jun 16, 2012
Messages:
29
Likes:
0
Not seeing that. Just seeing continuous oscillation at output.

Can you check this? I zoomed in.
http://tinyurl.com/y78psgqh

where does your sim go further to the right?

thx

Last edited: Aug 9, 2017
7. ### jpanhaltWell-Known MemberMost Helpful Member

Joined:
Jun 21, 2006
Messages:
5,903
Likes:
502
Location:
Cleveland, OH, USA
ONLINE
You have to run your simulation longer. I ran your simulation and it switched from 40 kHz pulses to off and visa versa every 500 ms.

I only posted a snippet at the change from pulses to off. It repeats, if one runs the simulation longer.

8. ### jpanhaltWell-Known MemberMost Helpful Member

Joined:
Jun 21, 2006
Messages:
5,903
Likes:
502
Location:
Cleveland, OH, USA
ONLINE
Your simulation does exactly the same as mine did:

Why would you expect it to be any different?