Question about Logic Design

Oct 19, 2006 17 Replies

Hello, I'm trying to build a circuit that has an array of switches (8 switches) and takes in a clock signal and compares the clock signal to my switches one at a time. Then if both the clock signal and the switch are "high" i would like an input signal to be connected to my output. Anything else should result in a break between my input and output signals. I'm having a hard time getting started with this project and was wondering if anyone had any suggestions on how I may accomplish this.



thank you.



You could easily do this with an AND gate (inputs are a switch and the clock signal). Use the output (logical 1 if both switch and input are high) to drive a transistor or mosfet, connecting your input signal to the output.

-J

the signal is from a guitar, the output is to an amplifier. i believe the audio signal from the guitar to be pretty small... millivolts i assume. the clock i'm thinking i will make from a 555 chip, i would like to be able to control the speed of the frequency. i have 8 buttons, when i push a button that button should be "high", my goal is to make something where a clock signal is constantly being compared to these 8 buttons. Whenever my clock signal is a "high" and the button is a "high" i would like the input to be connected to the output, else i would like it to be off. So, if I press all 8 buttons then my output would be an audio signal that is only on when my clock is "high" and it should sound like a stutter. If 1 = connected (sound) and 0 = not connected (no sound) then when all 8 buttons are pressed i should hear 1,1,1,1,1,1,1,1 this should be continuously looping. If the 3rd,4th,6th,7th,8th button are pressed I should hear

0,0,1,1,0,1,1,1 coninuously looping. If i increase my clock speed, then my logic circuit would just loop through these 8 buttons quicker. I'm guessing I'm comparing the clock with each button using an AND function. Audio should only come out if both clock AND button are high.

thank you, i appreciate any suggestions of how to get started with this

Ask the teacher to clarify the assignment for you, since you don't seem to understand it.

Good Luck! Rich

I understand it perfectly. Does my explanation not make sense? ........hmmmm..... sometimes it's hard to convey idea that are in your head by typing them out, which part is confusing?

thanks

Ahhhh, then what you need is some CMOS logic. You need to look for a 4017 which is a something something counter what you stick your clock up and it ripples through it's outputs. Then you need a couple of those quad dual input AND gate things, 4081 or somesuch, of which you connect the clocked outputs of your 4017 to one input and your switchy things to the other one. Then you OR all their outputs together with an OR thing, 4007?, to drive the enable input of one of those CMOS analog gate things that lets your signal through or not as the case may be.

DNA

Much thanks!! I will look into these things you suggest. I greatly appreciate the help!

This part:

Do you simply mean you want to gate a clock by one of 8 switches? Then just run the clock to one side of all of the switches, and take the output from the other side. This can't be what you want, or you wouldn't have asked, but it's impossible to figure out just exactly what it is you want to accomplish, from what you've posted.

Good Luck! Rich

I say, "What do you want to accomplish?"

Imagine your project is done, and I'm an alien that's just landed, and I point at your project and say, "What does that do?"

How would you answer that?

BTW, that quip above (about describing your project to an alien) isn't in the public domain - anyone is welcome to use it under the condition that if anyone asks where it came from, you have to tell them that Rich Grise said it first.

Thanks! Rich

OK. to the alien. This thing takes in an audio signal from a guitar... and it chops it up. It makes the guitar sound like it's stuttering, like it's constantly being switched on and off at a certain tempo which you control the speed of. And futhermore, see those 8 buttons, they allow you to set your own pattern for the guitar to be turned on and off at. Watch hold down an A chord.... (The alien plays an A chord) ok, now let me turn on the device. (The alien hears the A chord stutter at a constant tempo cause all the buttons are pressed) now I'm going to press all the buttons and turn them all off (the alien hears nothing) ok, you don't hear anything because you will only hear a sound for a brief moment while a button is presseed. There are also LEDs above the 8 buttons and you can see them light in a sequential order, they are being scanned by the tempo, if i increase the tempo on the device, the LEDs blink in a sequential oreder at a faster rate, but the only LEDs that blink are the ones that correspond to a button that is pressed (turned on) and only when an LED blinks do you hear the guitar coming out of the amplifier. all buttons pressed = a steady constant stutter. all buttons off = silence, first half button presses = 1/2 a cycle of stutter followed by 1/2 a cycle of silence.... the buttons allow you to set the patterns the guitar will stutter at.

does that make sense?

OK. to the alien. This thing takes in an audio signal from a guitar... and it chops it up. It makes the guitar sound like it's stuttering, like it's constantly being switched on and off at a certain tempo which you control the speed of. And futhermore, see those 8 buttons, they allow you to set your own pattern for the guitar to be turned on and off at. Watch hold down an A chord.... (The alien plays an A chord) ok, now let me turn on the device. (The alien hears the A chord stutter at a constant tempo cause all the buttons are pressed) now I'm going to press all the buttons and turn them all off (the alien hears nothing) ok, you don't hear anything because you will only hear a sound for a brief moment if the button is on (for a brief moment while the clock or tempo passes through that button, the tempo goes through each button in order and if a button is on it will play a sound). There are also LEDs above the 8 buttons and you can see them light in a sequential order, they are being scanned by the tempo, if i increase the tempo on the device, the LEDs blink in a sequential oreder at a faster rate, but the only LEDs that blink are the ones that correspond to a button that is pressed (turned on) and only when an LED blinks do you hear the guitar coming out of the amplifier. all buttons pressed = a steady constant stutter. all buttons off = silence, first half button presses = 1/2 a cycle of stutter followed by 1/2 a cycle of silence.... the buttons allow you to set the patterns the guitar will stutter at.

does that make sense?

OK. to the alien. This thing takes in an audio signal from a guitar... and it chops it up. It makes the guitar sound like it's stuttering, like it's constantly being switched on and off at a certain tempo which you control the speed of. And futhermore, see those 8 buttons, they allow you to set your own pattern for the guitar to be turned on and off at. Watch hold down an A chord.... (The alien plays an A chord) ok, now let me turn on the device. (The alien hears the A chord stutter at a constant tempo cause all the buttons are pressed) now I'm going to press all the buttons and turn them all off (the alien hears nothing) ok, you don't hear anything because you will only hear a sound for a brief moment if the button is on (for a brief moment while the clock or tempo passes through that button, the tempo goes through each button in order and if a button is on it will play a sound). There are also LEDs above the 8 buttons and you can see them light in a sequential order, they are being scanned by the tempo, if i increase the tempo on the device, the LEDs blink in a sequential oreder at a faster rate, but the only LEDs that blink are the ones that correspond to a button that is pressed (turned on) and only when an LED blinks do you hear the guitar coming out of the amplifier. all buttons pressed = a steady constant stutter. all buttons off = silence, first half button presses = 1/2 a cycle of stutter followed by 1/2 a cycle of silence.... the buttons allow you to set the patterns the guitar will stutter at.

does that make sense?

OK. to the alien. This thing takes in an audio signal from a guitar... and it chops it up. It makes the guitar sound like it's stuttering, like it's constantly being switched on and off at a certain tempo which you control the speed of. And futhermore, see those 8 buttons, they allow you to set your own pattern for the guitar to be turned on and off at. Watch hold down an A chord.... (The alien plays an A chord) ok, now let me turn on the device. (The alien hears the A chord stutter at a constant tempo cause all the buttons are pressed) now I'm going to press all the buttons and turn them all off (the alien hears nothing) ok, you don't hear anything because you will only hear a sound for a brief moment if the button is on (for a brief moment while the clock or tempo passes through that button, the tempo goes through each button in order and if a button is on it will play a sound). There are also LEDs above the 8 buttons and you can see them light in a sequential order, they are being scanned by the tempo, if i increase the tempo on the device, the LEDs blink in a sequential oreder at a faster rate, but the only LEDs that blink are the ones that correspond to a button that is pressed (turned on) and only when an LED blinks do you hear the guitar coming out of the amplifier. all buttons pressed = a steady constant stutter. all buttons off = silence, first half button presses = 1/2 a cycle of stutter followed by 1/2 a cycle of silence.... the buttons allow you to set the patterns the guitar will stutter at.

does that make sense?

Kinda - it sounds like you've got a bank of switches, with the signal trundling down the line, gated on or off as it goes by each switch.

Like, you want your switches to determine duty cycle:

ex. 1: switch bank: 0 0 0 0 0 0 0 1 _ signal: ________________| |____

ex. 2: swtich bank: 1 1 1 1 1 1 1 1 ________________ signal: _| |_____

Something like that?

Thanks, Rich

No - I thought the same thing a while back, until I read Genome's post and the answer from the op. The op wants to poll the switches sequentially. See Genome's post: It's a 4017 job, with each

4017 output going to an AND through the pusbutton. Other input of the AND goes to the clock that drives the 4017. Then, all the AND's are ORed and the output of the OR drives whatever he wants as output.

I think the above captures the idea Genome posted and what it seems the OP wants.

The reason the 4017 output is ANDed with the clock is to give the op the "stutter" he wants. The duty cycle is fixed, not selectable by the pushbuttons. I believe he wants the clock frequency to be adjustable.

Ed

Late at night, by candle light, "panfilero" penned this immortal opus:

OK, now I get what you're on about. A 555 clock generator, 4017 ring counter, a bunch of diodes in series with the switches and a pulldown (10k) to make a wired AND into an analog switch should do.

. +------+ +--------+ . | 555 | | | diodes switches . | |--------|CK Q0|--->|------ \\------+ . +------+ | | | in ---+ . | 4017 Q1|--->|-------\\------+ | . | | | +---------+ . | Q2|--->|-------\\------+ | | . | | | | 4066 | . | etc| ---+-----| analog | . | | | | switch | . | Q8|--+ - | | . | | | | | +---------+ . | RST|--+ | | 10k | . | | | | +---- out . +--------+ - . | . GND

This is rather simplified, you'll have to work out the details yourself. I'm certain someone will totally demolish it or come up with about 281 improvements.

It's also likely someone will suggest a PIC.

- YD.

Remove HAT if replying by mail.

You need three basic components: a binary counter, an 8-to-1 data selector, and an analog switch. A sample schematic is shown below. Enter the part numbers in the box at

formatting link
to retrieve the datasheets. I leave the analog switch selection up to you. Any positive edge triggered binary counter will do, 7HCT161 or 74HCT163 are good choices, and the counter is allowed to free run and roll over the least three bits without any complicated control required. The operation will be self-evident after you familiarize yourself with the datasheets. The circuit deviates from your arbitrary requirement on clock polarity by enabling the switch when the CLK is low rather than high, and this so the switch is blanked during the selector and counter transitions. As for the 555 CLK source, it would be best to use the CMOS 555 configured in the standard 50% duty configuration. See the LMC555 or TLC555 data sheets for details. View in a fixed-width font such as Courier.

. . . . analog switch . . audio in >-------o/o------+--->

. ^ | . control | [10k] . 1= ON | | . 0= OFF | --- . | /// . | . | . | . | . | . | . +5V 74HCT151 | . | -------------- | . +--o/o--+----------------|D0 | | . | | | | | . | | | | | . +--o/o--|-+--------------|D1 | | . | | | | | | . | | | | | | . +--o/o--|---+------------|D2 | | . | | | | | | | . | | | | | Y|----' . +--o/o--|-----+----------|D3 | . | | | | | | | . | | | | | | W|-N/C . +--o/o--|-------+--------|D4 | . | | | | | | | | . | | | | | | | | . +--o/o--|---------+------|D5 | . | | | | | | | | | . | | | | | | | | | . +--o/o--|-----------+----|D6 | . | | | | | | | | | | . | | | | | | | | | C |--------. . '--o/o--|-------------+--|D7 | | . | | | | | | | | | B |------. | . | | | | | | | | | _ | | | . R=10K R R R R R R R R | G A |----. | | . | | | | | | | | -------------- | | | . +-+-+-+-+-+-+-' | | | | . | | | | | . --- | | | | . /// | | | | . | | | | . | | | | . | | | | . OFF- - - - | | | | . . . . | | | | | | . . . | | | | . ON- - - - - | 74HCT161 | | | . | --------- | | | . | | | | | | . CLK IN >--------------+----|CP Q0|--' | | . | | | | . .----|PE Q1|----' | . | | | | . +----|TE Q2|------' . | |___ | . +----|SPE | . | | | . +5V>---+----|P0 | . | | | . +----|P1 | . | | | . +----|P2 | . | | | . '----|P3 | . --------- . . . .

Back when i was in grade school, this was taught in grade school, nowdays this seems to be college material. Such the degradation in standards.

JosephKK Gegen dummheit kampfen die Gotter Selbst, vergebens.   --Schiller

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required