electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
Can anyone figure out how to make this circuit?
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [9 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
commathe



Joined: Jul 26, 2013
Posts: 153
Location: Beijing
Audio files: 5

PostPosted: Tue Sep 09, 2014 10:49 pm    Post subject: Can anyone figure out how to make this circuit? Reply with quote  Mark this post and the followings unread

I want something that can take in some number of logic highs and output how many there are as a binary number.

Lets say I have 4 separate 1-bit inputs. I want to convert this two a two-bit binary output. If all four inputs are high, then I want to put out 11, if three are high then output 10, if two are high 01, if none are high 00.

Here's where I am getting really stuck though: it needs to be able to do it no matter which inputs are high or low. ANY two inputs have to make it put out 01. ANY 1 input results in 01 out.
Back to top
View user's profile Send private message
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Wed Sep 10, 2014 12:13 am    Post subject: Reply with quote  Mark this post and the followings unread

You could do it straight forward and calculate the terms for the two binary output digits you want. This will likely result in a rather complex circuit with lots of gates.
However, instead of using logic gates you could try to break the two boolean functions down into terms with only two inputs and use 4052 chips to implement it FPGA style. The analog mux inputs could be hard-wired to Vdd/Vss to implement the truth table and the two inputs select the output from it.
Another approach is to do it the analog way. Add the input bits with a resistor network and evaluate the resulting output voltage using comparators.
From your description it is not clear to me what exactly the output should be. There are 0 to 4 HIGHs possible, but with two binary digits you can only represent the numbers 0 to 3. If you can describe what you intend to do with that function, there may be more ideas.
Back to top
View user's profile Send private message
commathe



Joined: Jul 26, 2013
Posts: 153
Location: Beijing
Audio files: 5

PostPosted: Wed Sep 10, 2014 12:28 am    Post subject: Reply with quote  Mark this post and the followings unread

synaesthesia wrote:
Another approach is to do it the analog way. Add the input bits with a resistor network and evaluate the resulting output voltage using comparators.
Yes! Can't believe I didn't think of this! I could just use a summing amp and a few window comparators!

I'm trying to make a sequencer that "adds" together square waves that will make up the rhythym. I have a sequencer that is just a mux so I wanted an output compatible with that.

Ironically I already did the comparator to digital method for another module. Its funny how set you can be on thinking a different problem must have a different answer when often there are a few very useful answers that solve a wide range of problems.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5868
Location: Moon Base
Audio files: 709

PostPosted: Wed Sep 10, 2014 5:57 am    Post subject: Re: Can anyone figure out how to make this circuit? Reply with quote  Mark this post and the followings unread

commathe wrote:
Lets say I have 4 separate 1-bit inputs. I want to convert this two a two-bit binary output. If all four inputs are high, then I want to put out 11, if three are high then output 10, if two are high 01, if none are high 00.


that would give:
DCBA - XY
----------
0000 - 00
0001
0010
0011 - 01
0100
0101 - 01
0110 - 01
0111 - 10
1000
1001 - 01
1010 - 01
1011 - 10
1100 - 01
1101 - 10
1110 - 10
1111 - 11

what should the output be if only 1 input is high ?

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Wed Sep 10, 2014 10:09 am    Post subject: Reply with quote  Mark this post and the followings unread

If you don't mind using chips in the TSSOP24 package, you could just use two 4067 ICs like this. (Showing only the wiring for the truth table that PHOBoS built so far)


Capture.PNG
 Description:
 Filesize:  36.09 KB
 Viewed:  359 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Capture.PNG


Back to top
View user's profile Send private message
commathe



Joined: Jul 26, 2013
Posts: 153
Location: Beijing
Audio files: 5

PostPosted: Wed Sep 10, 2014 6:58 pm    Post subject: Re: Can anyone figure out how to make this circuit? Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
what should the output be if only 1 input is high ?
I was silly and thought "2 bits = 4 values, thus: 2 bits = 1-4" when two bits would only handle three inputs.

Reminds me of a joke:
Q: How do you know someone is a programmer?
A: They start counting from 0

I have never looked into the 4067 before, but I'm going to have to pick up a few now!
Back to top
View user's profile Send private message
RingMad



Joined: Jan 15, 2011
Posts: 428
Location: Montreal, Canada
Audio files: 4

PostPosted: Thu Sep 11, 2014 11:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Nothing useful to say about the circuit, but just an old classic joke to add...

There are 10 types of people in the world: Those who understand binary, and those who don't... Smile

James.
Back to top
View user's profile Send private message Visit poster's website
Cynosure
Site Admin


Joined: Dec 11, 2010
Posts: 1011
Location: Toronto, Ontario - Canada
Audio files: 82

PostPosted: Sat Sep 13, 2014 9:06 am    Post subject: Reply with quote  Mark this post and the followings unread

Use an lm3914 for your comparators. Then you can have 2 modes of opteration by switching between the line and dot display modes.
Back to top
View user's profile Send private message
commathe



Joined: Jul 26, 2013
Posts: 153
Location: Beijing
Audio files: 5

PostPosted: Sun Sep 14, 2014 12:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Cynosure wrote:
Use an lm3914 for your comparators. Then you can have 2 modes of opteration by switching between the line and dot display modes.
Good call! I have a bunch of spares kicking around!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [9 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use