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
bit shuffler
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [7 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
synaesthesia



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

PostPosted: Thu Oct 30, 2014 1:04 pm    Post subject:  bit shuffler
Subject description: Any ideas how to generate bit permutations?
Reply with quote  Mark this post and the followings unread

Sometimes I have to generate sequences to control part of a circuit that are more interesting than what you get from a simple counter. For example, instead of generating the outputs 0 1 2 3 4 5 6 7 from a 3-bit counter, I want something like 0 2 4 6 1 3 5 7. What I did so far is using a 4053 to switch the bits, like in the first schematic. Any input is switched to two outputs BUT the corresponding one. So you will never get 0 1 2 3 4 5 6 7 as the output, which is ok. This approach has a significant drawback however. For some permutations, bits are not mixed but duplicated. Many of the resulting sequences have repetitions because of that. For example, when using S1,2,3 = 000 you get the sequence 0 6 1 7 0 6 1 7. The part 0 6 1 7 repeats, and the values 2,3,4,5 are missing.

Because I am using all possible 3-bit numbers as input, I can improve that a bit by inverting some of the bits before switching them. In the second circuit I use 3 XORs for that. This gives me 3 more controls to select the sequence and should results in a total of 64 possible output sequences. Haven't tried that yet however.

To really mix bits without duplication you could use a 4053 like in the third schematic, here for two bits only. You would need several of them to mix the inputs values to any sequence. But I wonder if there are simpler ways to do this, even if not all possible permutations are generated. So I am sharing this to get some feedback about your ideas.


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

BitMixer.PNG


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



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

PostPosted: Fri Oct 31, 2014 12:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thinking a bit longer about this, I realized that you cannot get any sequence by just mixing the bits. When you only swap bits, there are only 6 possible combinations:
Quote:
A B C
B A C
A C B
B C A
C B A
C A B

Those will produce exactly 6 sequences.
Quote:
0 1 2 3 4 5 6 7
0 1 4 5 2 3 6 7
0 2 1 3 4 6 5 7
0 4 1 5 2 6 3 7
0 4 2 6 1 5 3 7
0 2 4 6 1 3 5 7
0 4 1 5 2 6 3 7
0 2 1 3 4 6 5 7

So It will take a bit more than just bit swapping.
Back to top
View user's profile Send private message
synaesthesia



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

PostPosted: Fri Oct 31, 2014 1:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

Combining the XOR idea and the bit swap using two switches from a 4053 results in this. First bits are selectively inverted, then the two lower ones are mixed, then the two upper ones, and finally the two outer ones. That results in the following 64 sequences without repetitions:
Quote:
0 1 2 3 4 5 6 7 , 1 0 3 2 5 4 7 6 , 2 3 0 1 6 7 4 5 , 3 2 1 0 7 6 5 4 , 4 5 6 7 0 1 2 3 , 5 4 7 6 1 0 3 2 , 6 7 4 5 2 3 0 1 , 7 6 5 4 3 2 1 0 ,
0 1 4 5 2 3 6 7 , 1 0 5 4 3 2 7 6 , 4 5 0 1 6 7 2 3 , 5 4 1 0 7 6 3 2 , 2 3 6 7 0 1 4 5 , 3 2 7 6 1 0 5 4 , 6 7 2 3 4 5 0 1 , 7 6 3 2 5 4 1 0 ,
0 2 1 3 4 6 5 7 , 2 0 3 1 6 4 7 5 , 1 3 0 2 5 7 4 6 , 3 1 2 0 7 5 6 4 , 4 6 5 7 0 2 1 3 , 6 4 7 5 2 0 3 1 , 5 7 4 6 1 3 0 2 , 7 5 6 4 3 1 2 0 ,
0 4 1 5 2 6 3 7 , 4 0 5 1 6 2 7 3 , 1 5 0 4 3 7 2 6 , 5 1 4 0 7 3 6 2 , 2 6 3 7 0 4 1 5 , 6 2 7 3 4 0 5 1 , 3 7 2 6 1 5 0 4 , 7 3 6 2 5 1 4 0 ,
0 4 2 6 1 5 3 7 , 4 0 6 2 5 1 7 3 , 2 6 0 4 3 7 1 5 , 6 2 4 0 7 3 5 1 , 1 5 3 7 0 4 2 6 , 5 1 7 3 4 0 6 2 , 3 7 1 5 2 6 0 4 , 7 3 5 1 6 2 4 0 ,
0 2 4 6 1 3 5 7 , 2 0 6 4 3 1 7 5 , 4 6 0 2 5 7 1 3 , 6 4 2 0 7 5 3 1 , 1 3 5 7 0 2 4 6 , 3 1 7 5 2 0 6 4 , 5 7 1 3 4 6 0 2 , 7 5 3 1 6 4 2 0 ,
0 4 1 5 2 6 3 7 , 4 0 5 1 6 2 7 3 , 1 5 0 4 3 7 2 6 , 5 1 4 0 7 3 6 2 , 2 6 3 7 0 4 1 5 , 6 2 7 3 4 0 5 1 , 3 7 2 6 1 5 0 4 , 7 3 6 2 5 1 4 0 ,
0 2 1 3 4 6 5 7 , 2 0 3 1 6 4 7 5 , 1 3 0 2 5 7 4 6 , 3 1 2 0 7 5 6 4 , 4 6 5 7 0 2 1 3 , 6 4 7 5 2 0 3 1 , 5 7 4 6 1 3 0 2 , 7 5 6 4 3 1 2 0

Bit shuffler isn't a good name for this. It is about generating sequences and could be used in two ways:
Feed a high frequency to a 3-bit counter and the outputs to IN, and another frequency to a 6-bit counter and the outputs to S. Then you would have an interesting waveform modifier, although with a pretty small resolution.
Or feed IN and S with a 9-bit counter and use the OUT signals for a melody generator that repeats after 512 notes.


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

BitMixer2.PNG


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



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Sat Nov 01, 2014 6:30 am    Post subject: Re: bit shuffler
Subject description: Any ideas how to generate bit permutations?
Reply with quote  Mark this post and the followings unread

synaesthesia wrote:
To really mix bits without duplication you could use a 4053 like in the third schematic, here for two bits only. You would need several of them to mix the inputs values to any sequence.

That was my initial idea, having a bunch of muxes with all inputs attached to all of them and some extra control logic.
That was before I found out that the CD4053 actually has seperate control for all 3 muxes. And then you posted the first version Very Happy

synaesthesia wrote:
Thinking a bit longer about this, I realized that you cannot get any sequence by just mixing the bits. When you only swap bits, there are only 6 possible combinations:

I was thinking about a 4 bit version so that would give 24 permutation, but you're correct there are more possibilities.

synaesthesia wrote:
Combining the XOR idea and the bit swap using two switches from a 4053 results in this. First bits are selectively inverted, then the two lower ones are mixed, then the two upper ones, and finally the two outer ones. That results in the following 64 sequences without repetitions

Shocked that's brilliant Very Happy I gotta do some tests with that setup.
I wonder if the CD4035 can be useful somehow, it's a 4 bit shiftregister with parallel inputs.

_________________
"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
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Sat Nov 01, 2014 7:51 am    Post subject: Reply with quote  Mark this post and the followings unread

hmm , I 'm not entirely sure yet (trying to understand the circuit) but shouldn't the Y outputs be swapped ?

btw it looks like this might become useful for another circuit I sketched up, a switch matrix Smile

_________________
"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: Sat Nov 01, 2014 2:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yep, you are right PHOBoS. The schematic had an error. Started over and drew it again.


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

BitMixer3.PNG


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



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Sat Nov 01, 2014 2:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

heh, what you drew in the bottom corner is what I was drawing myself to figure it out how the circuit works. Very Happy
(and how I noticed it probably wasn't correct). I was wondering if there's some kind of logic way (with gates) to achieve
the same thing. This is probably the easiest option though.

_________________
"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
Display posts from previous:   
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [7 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