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



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

PostPosted: Wed Mar 07, 2018 2:25 pm    Post subject: (4)bit shuffler/permuter
Subject description: think-along thread
Reply with quote  Mark this post and the followings unread

I already briefly mentioned this in the CMUSE thread, but what I would like is a circuit that has a
4 bit input and with some control signals can create permutations of these 4 bits (one at a time).
If you are unfamiliar with the term permutations it basically just means all the possible ways you
can rearrange the bits. I mainly want to test it with my chromatic melody generator but there are
other uses for it.

4bits has 4!=24 permutations. If the bits are labeled ABCD these are:
ABCD BACD CBAD DBCA
ABDC BADC CBDA DBAC
ACBD BCAD CABD DCBA
ACDB BCDA CADB DCAB
ADCB BDCA CDAB DACB
ADBC BDAC CDBA DABC

I have some ideas on how to achieve this but before I go into that I am curious if someone else can
come up with a nice solution. Using something like a PIC would be very easy btw but I'd like to do it
with logic chips. Although with something like a PIC it would be very simple to implement a CV input
and do all kinds of other things as well.

Instead of permutations it might also be useful to route an input to multiple outputs (like AABC or BDCD).
This would result in 4^4=256 different 'combinations'. A circuit for this would actually be very simple to
make. Just 4 muxes that route 1 of the inputs to 1 of the outputs controlled by 2 bits, so it would need 8
control bits in total.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Fri Mar 09, 2018 5:09 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Steveg



Joined: Apr 23, 2015
Posts: 182
Location: Perth, Australia

PostPosted: Wed Mar 07, 2018 5:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

It is easier to do this with DPDT relays. You set up a bunch of crossovers to gain all the permutations. Each round swaps (or not) a pair of bits. Have a look at Knuth's work on minimal sorting networks and then imagine each sorting node is a crossover controlled by a signal line. You can make a crossover in CMOS using 4053 chips but two chips yields 3 crossovers so you will need a lot of them.
You can cut down on the number of permutations you need by following you permuter with a barrel shifter type arrangement to generate permutations that are just rotations of other permutations. DABC is ABCD rotated right one step. Two 4052s should create a barrel shifter for 4 bits with 2 control lines.
Actually I think I would use 4052s - each pair of chips gets you 2 permutations and their combinations ... You would probably need 4 pairs with 8 control lines.
Back to top
View user's profile Send private message
Steveg



Joined: Apr 23, 2015
Posts: 182
Location: Perth, Australia

PostPosted: Wed Mar 07, 2018 5:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Okay I've done the permutations, you need 3 pairs of 4052s with 6 control lines.
One wired as a barrel shifter.
One that swaps A<->B and C<->D
One that swaps A<->D and B<->C

Instead of the barrel shifter you could use one that swaps A<->C and B<->D you just get a different set of duplicates.
Back to top
View user's profile Send private message
PHOBoS



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

PostPosted: Wed Mar 07, 2018 8:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Steveg wrote:
It is easier to do this with DPDT relays. You set up a bunch of crossovers to gain all the permutations. Each round swaps (or not) a pair of bits. Have a look at Knuth's work on minimal sorting networks and then imagine each sorting node is a crossover controlled by a signal line. You can make a crossover in CMOS using 4053 chips but two chips yields 3 crossovers so you will need a lot of them.

Swapping bits was one of the things I thought about. I wasn't sure how many I needed to swap and which would
be the best bits to swap or in what order so last night I just picked some and drew up a logic table for them.
Code:
   2/3  1/3  2/4  1/2  3/4  1234
--------------------------------
    0    0    0    0    0   ABCD
    0    0    0    0    1   ABDC
    0    0    0    1    0   BACD
    0    0    0    1    1   BADC
    0    0    1    0    0   ADCB
    0    0    1    0    1   ADBC
    0    0    1    1    0   DACB
    0    0    1    1    1   DABC
    0    1    0    0    0   CBAD
    0    1    0    0    1   CBDA
    0    1    0    1    0   BCAD
    0    1    0    1    1   BCDA
    0    1    1    0    0   CDAB
    0    1    1    0    1   CDBA
    0    1    1    1    0   DCAB
    0    1    1    1    1   DCBA

    1    0    0    0    0   ACBD
    1    0    0    0    1   ACDB
    1    0    0    1    0   CABD
    1    0    0    1    1   CADB
!   1    0    1    0    0   ADBC
!   1    0    1    0    1   ADCB
!   1    0    1    1    0   DABC
!   1    0    1    1    1   DACB
!   1    1    0    0    0   BCAD
!   1    1    0    0    1   BCDA
!   1    1    0    1    0   CBAD
!   1    1    0    1    1   CBDA
    1    1    1    0    0   BDAC
    1    1    1    0    1   BDCA
    1    1    1    1    0   DBAC
    1    1    1    1    1   DBCA


The ones marked with an ! are duplicates that already appear earlier in the table. As you know duplicates
are pretty much unavoidable as for 24 permutations you need at least 5bits (control lines) which gives you
32 permutations so 8 duplicates. The 4053 did indeed seem like a logical choice to do this. I will have a look
at Knuth's work, thanks for the tip.

Quote:
You can cut down on the number of permutations you need by following you permuter with a barrel shifter type arrangement to generate permutations that are just rotations of other permutations. DABC is ABCD rotated right one step. Two 4052s should create a barrel shifter for 4 bits with 2 control lines.

yes, I thought about rotating bits and when I started thinking about it a couple years ago I actually drew up
a schematic. I didn't know it was called a barrel shifter untill now, so I called it a bit rotator. There is a downside
to it though. I didn't mention it but I would like to have it function asynchronous, so without the need
for a clock signal.
wikipedia mentioned a clock cycle but of course it doesn't need a clock. Another thing
I thought about is that half the permutations are mirrored versions, like ABCD & DCBA. So it is possible to
create 12 permutations, and then just swap all the bits to get the other 12.

Steveg wrote:
Okay I've done the permutations, you need 3 pairs of 4052s with 6 control lines.
One wired as a barrel shifter.
One that swaps A<->B and C<->D
One that swaps A<->D and B<->C

Instead of the barrel shifter you could use one that swaps A<->C and B<->D you just get a different set of duplicates.


I drew up a version with 2 pairs + 1 (which can be a 4052 or 4053) and 5 control lines. I translated it from the
tree structure on the left which I got after reading up a bit about how to create permutations. A nice thing
about is that it is rather recursive. To show this more clearly I also drew up a version with some unnecessary
connections. If you would do something like that in code you would put it in a loop and/or function. So just for
fun I also started on a schematic which does just that. It isn't practical, needs more chips and a Clock, but it's
a nice challenge.

Here are the schematics, the permuter ones aren't complete as they have some floating inputs and some pull
down resistors on the other inputs would be needed for a standalone version.
note: X0..X3 are the inputs, Y0..Y3 are the outputs, A..E are the control lines.


Thanks for thinking along Very Happy


4bit rotator.gif
 Description:
 Filesize:  26.14 KB
 Viewed:  302 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

4bit rotator.gif



permuter1b.gif
 Description:
 Filesize:  48.54 KB
 Viewed:  293 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

permuter1b.gif



permuter1c.gif
 Description:
 Filesize:  54.62 KB
 Viewed:  305 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

permuter1c.gif



_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Thu Mar 08, 2018 3:20 am; edited 2 times in total
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: Wed Mar 07, 2018 8:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

hah, I am currently watching some lectures from Stanford University about C++ as one of them was about
permutations, which made me curious about the rest. In the current one about strings there is an example
code which uses the string "Donald Knuth". Laughing

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Wed Mar 07, 2018 8:21 pm; edited 1 time in total
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: Wed Mar 07, 2018 8:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

oh something I forgot to mention. A permuter can of course be used as a barrel shifter. I want to look into it
if it is possible to rearrange it in such a way that it can rotate by connecting a counter to 2 of the control
lines. Maybe that is actually the case already.

_________________
"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: Thu Mar 08, 2018 1:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
oh something I forgot to mention. A permuter can of course be used as a barrel shifter. I want to look into it
if it is possible to rearrange it in such a way that it can rotate by connecting a counter to 2 of the control
lines.

I think starting with a barrel shifter is probably the easiest way to make it possible to do this with 2 control lines,
I also like the idea of using the fact that half of the permutations are mirrored versions so I want to make
that possible with 1 control line. Mirroring is of course swapping A<->D and B<->C.
You've already done both things, shifting and mirroring in this version :
Steveg wrote:
Okay I've done the permutations, you need 3 pairs of 4052s with 6 control lines.
One wired as a barrel shifter.
One that swaps A<->B and C<->D
One that swaps A<->D and B<->C

However, I don't like the A<->B and C<->D step as I'd like to keep the same bit at the first place after the barrelshift and
only change it at the mirror stage. After a bit of puzling I think I figured it out. It does produce some duplicates of course
but it makes it very easy to use to shift bits or mirror them.

Rev1.1 uses 6x 4052 and is probably the easiest to understand. Because the last (mirroring) stage only uses half of U5 and U6
it makes it possible to add some extra options.
Rev1.2 makes use of this.
- When CTRL X = 0 and CTRL E = 0, all the outputs are 0
- When CTRL X = 0 and CTRL E = 1, the permuter is disabled and the outputs (Y0..Y3) are the same as the inputs (X0..X3)
- When CTRL X = 1, the permuter is enabled and CTRL E works as the mirror control input.
Rev1.3 works the same as Rev1.1 but with 2x CD4053 and only has 5 chips in total instead of 6.


permuter1_1.gif
 Description:
 Filesize:  60.38 KB
 Viewed:  261 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

permuter1_1.gif



permuter1_2.gif
 Description:
 Filesize:  71.31 KB
 Viewed:  271 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

permuter1_2.gif



permuter1_3.gif
 Description:
 Filesize:  58.14 KB
 Viewed:  286 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

permuter1_3.gif



_________________
"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: Fri Mar 09, 2018 10:44 am    Post subject: Reply with quote  Mark this post and the followings unread

Here's the logic table for Rev1.2

note: I think there is an error in there which might also be in the schematics, will fix it when I found it.
found it and fixed it. (schematics are ok)


Code:
 X  E  D  C  B  A | Y0 Y1 Y2 Y3
 ------------------------------
 0  0  -  -  -  - |  0  0  0  0
 0  1  -  -  -  - | X0 X1 X2 X3
 ------------------------------
 1  0  0  0  0  0 | X0 X1 X2 X3
 1  0  0  0  0  1 | X1 X2 X3 X0
 1  0  0  0  1  0 | X2 X3 X0 X1
 1  0  0  0  1  1 | X3 X0 X1 X2
 ------------------------------
 1  0  0  1  0  0 | X0 X2 X1 X3
 1  0  0  1  0  1 | X1 X3 X2 X0
 1  0  0  1  1  0 | X2 X0 X3 X1
 1  0  0  1  1  1 | X3 X1 X0 X2
 1  0  1  0  0  0 | X0 X1 X3 X2 !a
 1  0  1  0  0  1 | X1 X2 X0 X3 !b
 1  0  1  0  1  0 | X2 X3 X1 X0 !c
 1  0  1  0  1  1 | X3 X0 X2 X1 !d
 1  0  1  1  0  0 | X0 X3 X1 X2 !e
 1  0  1  1  0  1 | X1 X0 X2 X3 !f
 1  0  1  1  1  0 | X2 X1 X3 X0 !g
 1  0  1  1  1  1 | X3 X2 X0 X1 !h
 ------------------------------
 1  1  0  0  0  0 | X3 X2 X1 X0
 1  1  0  0  0  1 | X0 X3 X2 X1
 1  1  0  0  1  0 | X1 X0 X3 X2
 1  1  0  0  1  1 | X2 X1 X0 X3
 ------------------------------
 1  1  0  1  0  0 | X3 X1 X2 X0
 1  1  0  1  0  1 | X0 X2 X3 X1
 1  1  0  1  1  0 | X1 X3 X0 X2
 1  1  0  1  1  1 | X2 X0 X1 X3
 1  1  1  0  0  0 | X2 X3 X1 X0 !c
 1  1  1  0  0  1 | X3 X0 X2 X1 !d
 1  1  1  0  1  0 | X0 X1 X3 X2 !a
 1  1  1  0  1  1 | X1 X2 X0 X3 !b
 1  1  1  1  0  0 | X2 X1 X3 X0 !g
 1  1  1  1  0  1 | X3 X2 X0 X1 !h
 1  1  1  1  1  0 | X0 X3 X1 X2 !e
 1  1  1  1  1  1 | X1 X0 X2 X3 !f
 ------------------------------

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



Joined: Apr 23, 2015
Posts: 182
Location: Perth, Australia

PostPosted: Fri Mar 09, 2018 4:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

Looks good. An impressive set of optimisations there.
Back to top
View user's profile Send private message
PHOBoS



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

PostPosted: Fri Mar 09, 2018 5:07 pm    Post subject: Re: (4)bit shuffler/permuter
Subject description: think-along thread
Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
Instead of permutations it might also be useful to route an input to multiple outputs (like AABC or BDCD).
This would result in 4^4=256 different 'combinations'. A circuit for this would actually be very simple to
make. Just 4 muxes that route 1 of the inputs to 1 of the outputs controlled by 2 bits, so it would need 8
control bits in total.


I drew up a schematic for that too and went a bit insane typing out a logic table for it as well
It's too bad that although the 4052 has 2x 4<>1 muxes that they share the control inputs, otherwise
it could be done with only 2 chips. But it's also useful to add some status LEDs. If you construct the
whole thing like a matrix with the LEDs in a 4x4 grid you can instantly see how things are routed.
This is actually something I would like to do with the permuter as well but I haven't figured out yet
if there is an easy solution for this.

oh and if you're nuts you could of course use the 4051 (8x) and make an 8x8 matrix, which gives you
16777216 routing options. Or if you are completely bonkers you can use the 4067 (16x) which gives
you, well, I am not even going to type how many options that gives Laughing (it would also have 64 control lines)


edit: I noticed some (rather obvious) errors in the logic table, so uploaded a revised version.


4x4 bit matrix.gif
 Description:
 Filesize:  46.06 KB
 Viewed:  296 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

4x4 bit matrix.gif



4x4 bit matrix logic table.txt
 Description:

Download
 Filename:  4x4 bit matrix logic table.txt
 Filesize:  10.8 KB
 Downloaded:  291 Time(s)


_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Thu Mar 15, 2018 7:36 pm; edited 1 time in total
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: Thu Mar 15, 2018 1:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

I took me longer than I expected but I found a solution to add LEDs to the permuter. I don't know if this is the most efficient
way to do it (with logic chips) but I think it should work. Note that it can only be used with either Rev1.1 or Rev1.3 as it
doesn't have an X input for Rev1.2. (I am not sure yet how easy it is to add this)

The idea is to construct the LEDs in 4x4 grid where the rows are the inputs (X0..X3) and the columns are the outputs (Y0..Y3).
Note that the LEDs don't show the actual status of the outputs just how the in/outputs are routed. For the permuter each input
is routed to a different output so there can never be more than 1 LED on in a single row or column. Because of this you could
either use muxes to control rows or columns.

The permuter uses 1 control input (E) to mirror (reverse) the outputs, this can easily be done by using a 1<>8 mux (CD4051)
for each row of LEDs. The LEDs are connected in the order Y0..Y3 to 'outputs' 0..3 and in the reverse order Y3..Y0 to 'outputs'
4..7. This way the A&B inputs are used to turn on 1 of the LEDs in a row and the C input is used to reverse the whole row. So
the C input of all the 4 muxes will be connected to Control input E. This is the part of the schematic that I started with (U8..U11)
but then I got a bit stuck. So I had to shake it loose and it dropped on the floor and I couldn't find it at first and,..
ok enough sillyness.

Somehow I needed to turn the Control inputs A,B,C,D into 4 sets of 2 bits to control the muxes. I could use a 1<>16 mux for
each bit but that would require 8 of them which seemed a bit ridiculous. I typed out some logic tables to see if that woud give
me any ideas. It became a bit clearer after I typed one similar to the one posted above but with inputs and outputs swapped
as this made it easier to see how the ABCD inputs correlate with the Y0..Y3 outputs.

Code:
 E  D  C  B  A  |   X0   |   X1   |   X2   |   X3   |
=====================================================
 0  0  0  0  0  |   Y0   |   Y1   |   Y2   |   Y3   |
 0  0  0  0  1  |   Y3   |   Y0   |   Y1   |   Y2   |
 0  0  0  1  0  |   Y2   |   Y3   |   Y0   |   Y1   |
 0  0  0  1  1  |   Y1   |   Y2   |   Y3   |   Y0   |
-----------------------------------------------------
 0  0  1  0  0  |   Y0   |   Y2   |   Y1   |   Y3   |
 0  0  1  0  1  |   Y3   |   Y0   |   Y2   |   Y1   |
 0  0  1  1  0  |   Y1   |   Y3   |   Y0   |   Y2   |
 0  0  1  1  1  |   Y2   |   Y1   |   Y3   |   Y0   |
-----------------------------------------------------
 0  1  0  0  0  |   Y0   |   Y1   |   Y3   |   Y2   |
 0  1  0  0  1  |   Y2   |   Y0   |   Y1   |   Y3   |
 0  1  0  1  0  |   Y3   |   Y2   |   Y0   |   Y1   |
 0  1  0  1  1  |   Y1   |   Y3   |   Y2   |   Y0   |
-----------------------------------------------------
 0  1  1  0  0  |   Y0   |   Y2   |   Y3   |   Y1   |
 0  1  1  0  1  |   Y1   |   Y0   |   Y2   |   Y3   |
 0  1  1  1  0  |   Y3   |   Y1   |   Y0   |   Y2   |
 0  1  1  1  1  |   Y2   |   Y3   |   Y1   |   Y0   |
=====================================================
 1  0  0  0  0  |   Y3   |   Y2   |   Y1   |   Y0   |
 1  0  0  0  1  |   Y0   |   Y3   |   Y2   |   Y1   |
 1  0  0  1  0  |   Y1   |   Y0   |   Y3   |   Y2   |
 1  0  0  1  1  |   Y2   |   Y1   |   Y0   |   Y3   |
-----------------------------------------------------
 1  0  1  0  0  |   Y3   |   Y1   |   Y2   |   Y0   |
 1  0  1  0  1  |   Y0   |   Y3   |   Y1   |   Y2   |
 1  0  1  1  0  |   Y2   |   Y0   |   Y3   |   Y1   |
 1  0  1  1  1  |   Y1   |   Y2   |   Y0   |   Y3   |
-----------------------------------------------------
 1  1  0  0  0  |   Y3   |   Y2   |   Y0   |   Y1   |
 1  1  0  0  1  |   Y1   |   Y3   |   Y2   |   Y0   |
 1  1  0  1  0  |   Y0   |   Y1   |   Y3   |   Y2   |
 1  1  0  1  1  |   Y2   |   Y0   |   Y1   |   Y3   |
-----------------------------------------------------
 1  1  1  0  0  |   Y3   |   Y1   |   Y0   |   Y2   |
 1  1  1  0  1  |   Y2   |   Y3   |   Y1   |   Y0   |
 1  1  1  1  0  |   Y0   |   Y2   |   Y3   |   Y1   |
 1  1  1  1  1  |   Y1   |   Y0   |   Y2   |   Y3   |
=====================================================



Changing Y0..Y3 to the actual bits I needed for the A&B inputs of the muxes resulted in the following logic table. I relabeled
them O..V to prevent any more confusion and also left out Control input E as this has already been taken care of.

Code:
             |   X0   |   X1   |   X2   |   X3   |
 D  C  B  A  |  P  O  |  R  Q  |  T  S  |  V  U  |
==================================================
 0  0  0  0  |  0  0  |  0  1  |  1  0  |  1  1  |
 0  0  0  1  |  1  1  |  0  0  |  0  1  |  1  0  |
 0  0  1  0  |  1  0  |  1  1  |  0  0  |  0  1  |
 0  0  1  1  |  0  1  |  1  0  |  1  1  |  0  0  |
--------------------------------------------------
 0  1  0  0  |  0  0  |  1  0  |  0  1  |  1  1  |
 0  1  0  1  |  1  1  |  0  0  |  1  0  |  0  1  |
 0  1  1  0  |  0  1  |  1  1  |  0  0  |  1  0  |
 0  1  1  1  |  1  0  |  0  1  |  1  1  |  0  0  |
--------------------------------------------------
 1  0  0  0  |  0  0  |  0  1  |  1  1  |  1  0  |
 1  0  0  1  |  1  0  |  0  0  |  0  1  |  1  1  |
 1  0  1  0  |  1  1  |  1  0  |  0  0  |  0  1  |
 1  0  1  1  |  0  1  |  1  1  |  1  0  |  0  0  |
--------------------------------------------------
 1  1  0  0  |  0  0  |  1  0  |  1  1  |  0  1  |
 1  1  0  1  |  0  1  |  0  0  |  1  0  |  1  1  |
 1  1  1  0  |  1  1  |  0  1  |  0  0  |  1  0  |
 1  1  1  1  |  1  0  |  1  1  |  0  1  |  0  0  |
==================================================


After staring at it for while I noticed something. If you look at the columns O..V you can see that for every time Control inputs
A & B cycle from 00 to 11 there are 0's and 1's but there are always 2 of both. If for example you look at the column beneath
P you get 0110 for the first cycle (DC=00), 0101 for the second cycle (DC=01), 0110 for the third (DC=10) and 0011 for the
fourth (DC=11). There are only 6 combinations of 1's and 0's that can be made this way: 0011, 0101, 0110, 1001, 1010, 1100.
After I realized this it became clear how to do it.

I used 6 4<>1 muxes (U1..U3) to create the 6 possible combinations. A CD4052 already has 2 4<>1 muxes but they share the
A&B inputs. Since all the A&B inputs need to be wired together anyway this isn't a problem so it only needs 3 chips for this.
What's left is to route one of the outputs of these muxes to the (O..V) inputs of U8..U11 which can be done with, you probably
guessed it, more muxes. 8 4<>1 muxes to be precise. As with U1..U3 the C&D inputs are all connected together so it can be
done with 4 chips (U4..U7).

Let's take a look at the column beneath P again. For the first cycle (DC=00) the order of bits is 0110 which corresponds with
the x 'output' of U2 so that's what it is connected to. For the second cycle (DC=01) the order is 0101 which corresponds with
the y 'output' of U1. The order for the third cycle (DC=10) is 0110 again so that's also connected to the x 'output' of U2. The
order for the fourth cycle (DC=11) is 0011 which corresponds with the x 'output' of U1.


It's still a silly amount of chips especially in combination with the permuter itself. Something like an (E)EPROM would be ideal for
this but I've never used them and I have no idea if they are readily available with the amount of outputs that would be needed
for both circuits, which is a minimum of 12 if you'd still use U8..U11. Of course you could simply use more than 1 if needed. Also
the 4x4 bit matrix I posted above can do all the permutations and much more + control the LEDs with only 4 chips in total.
hmm, I wonder if it would be easier to make some sort of converter, which could be very similar to this circuit for the LEDs, that
can be used in combination with the 4x4 bit matrix.


permuter LEDs 1_0.gif
 Description:
 Filesize:  107.66 KB
 Viewed:  280 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

permuter LEDs 1_0.gif



_________________
"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: Thu Mar 15, 2018 4:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

hmm, I think adding 4 muxes in parallel to route the actual signals would work. I wonder if I can also do
something similar for driving LEDs with the permuter Rev1.3 circuit. I have a gut feeling it can be simplified.


permuter LEDs 1_1.gif
 Description:
 Filesize:  130.8 KB
 Viewed:  237 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

permuter LEDs 1_1.gif



_________________
"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: Fri Mar 16, 2018 4:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

U1, U2, U3 of the Leds for permuter schematic can be replaced with just a single XOR chip. Cool

Quote:
There are only 6 combinations of 1's and 0's that can be made this way: 0011, 0101, 0110, 1001, 1010, 1100

Half of those are actually just the inverse of the other ones: 0011 <> 1100, 0101 <> 1010, 0110 <> 1001. I changed how
U1, U2, U3 are connected so this is easier to see. By doing this only 3 1<>4 muxes would be needed + 3 inverters. Even
better, they can be replaced with 1<>2 muxes. 0011 <> 1100 can be directly derived from Control input B, 0101 <> 1010
can be directly derived from Control input A and 0110 <> 1001 can be done by using an XOR gate. But it gets even better.
The 1<>2 muxes just switch between 1 and 0 so they can be left out completely.

I guess that with all those muxes I almost forgot you can also do things with logic gates. Laughing


2 to 6 line simplified.gif
 Description:
 Filesize:  134.4 KB
 Viewed:  222 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

2 to 6 line simplified.gif



_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Sat Mar 17, 2018 2:18 pm; edited 1 time in total
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: Fri Mar 16, 2018 7:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
I wonder if it would be easier to make some sort of converter, which could be very similar to this circuit for the LEDs, that
can be used in combination with the 4x4 bit matrix.

Using the same method I came up with a circuit. It is indeed very similar and it just needs to convert the 5 Control lines to
8 bits but unlike the muxes that drive the LEDs the 4x4 bit matrix doesn't have the mirror function built in. It's not as simple
as reversing the bits so instead of 1<>4 muxes, 1<>8 muxes are needed. U1, U2, U3 can of course be replaced with a single
XOR chip and U4..U11 can be reduced to 6 chips. I am currently trying to figure out if I can reduce the chip count further by
using more logic gates.

here' s the logic table I used
Code:
|                   PERMUTER                   |     4X4 BIT MATRIX     |
|                                              |                        |
| Y0 Y1 Y2 Y3 | X  E  D  C  B  A | X0 X1 X2 X3 | H  G  F  E  D  C  B  A |
=========================================================================
| X0 X1 X2 X3 | 1  0  0  0  0  0 | Y0 Y1 Y2 Y3 | 1  1  1  0  0  1  0  0 |
| X1 X2 X3 X0 | 1  0  0  0  0  1 | Y3 Y0 Y1 Y2 | 0  0  1  1  1  0  0  1 |
| X2 X3 X0 X1 | 1  0  0  0  1  0 | Y2 Y3 Y0 Y1 | 0  1  0  0  1  1  1  0 |
| X3 X0 X1 X2 | 1  0  0  0  1  1 | Y1 Y2 Y3 Y0 | 1  0  0  1  0  0  1  1 |
|----------------------------------------------|------------------------|
| X0 X2 X1 X3 | 1  0  0  1  0  0 | Y0 Y2 Y1 Y3 | 1  1  0  1  1  0  0  0 |
| X1 X3 X2 X0 | 1  0  0  1  0  1 | Y3 Y0 Y2 Y1 | 0  0  1  0  1  1  0  1 |
| X2 X0 X3 X1 | 1  0  0  1  1  0 | Y1 Y3 Y0 Y2 | 0  1  1  1  0  0  1  0 |
| X3 X1 X0 X2 | 1  0  0  1  1  1 | Y2 Y1 Y3 Y0 | 1  0  0  0  0  1  1  1 |
|----------------------------------------------|------------------------|
| X0 X1 X3 X2 | 1  0  1  0  0  0 | Y0 Y1 Y3 Y2 | 1  0  1  1  0  1  0  0 | !a
| X1 X2 X0 X3 | 1  0  1  0  0  1 | Y2 Y0 Y1 Y3 | 1  1  0  0  1  0  0  1 | !b
| X2 X3 X1 X0 | 1  0  1  0  1  0 | Y3 Y2 Y0 Y1 | 0  0  0  1  1  1  1  0 | !c
| X3 X0 X2 X1 | 1  0  1  0  1  1 | Y1 Y3 Y2 Y0 | 0  1  1  0  0  0  1  1 | !d
|----------------------------------------------|------------------------|
| X0 X3 X1 X2 | 1  0  1  1  0  0 | Y0 Y2 Y3 Y1 | 1  0  0  1  1  1  0  0 | !e
| X1 X0 X2 X3 | 1  0  1  1  0  1 | Y1 Y0 Y2 Y3 | 1  1  1  0  0  0  0  1 | !f
| X2 X1 X3 X0 | 1  0  1  1  1  0 | Y3 Y1 Y0 Y2 | 0  0  1  1  0  1  1  0 | !g
| X3 X2 X0 X1 | 1  0  1  1  1  1 | Y2 Y3 Y1 Y0 | 0  1  0  0  1  0  1  1 | !h
=========================================================================
| X3 X2 X1 X0 | 1  1  0  0  0  0 | Y3 Y2 Y1 Y0 | 0  0  0  1  1  0  1  1 |
| X0 X3 X2 X1 | 1  1  0  0  0  1 | Y0 Y3 Y2 Y1 | 0  1  1  0  1  1  0  0 |
| X1 X0 X3 X2 | 1  1  0  0  1  0 | Y1 Y0 Y3 Y2 | 1  0  1  1  0  0  0  1 |
| X2 X1 X0 X3 | 1  1  0  0  1  1 | Y2 Y1 Y0 Y3 | 1  1  0  0  0  1  1  0 |
|----------------------------------------------|------------------------|
| X3 X1 X2 X0 | 1  1  0  1  0  0 | Y3 Y1 Y2 Y0 | 0  0  1  0  0  1  1  1 |
| X0 X2 X3 X1 | 1  1  0  1  0  1 | Y0 Y3 Y1 Y2 | 0  1  1  1  1  0  0  0 |
| X1 X3 X0 X2 | 1  1  0  1  1  0 | Y2 Y0 Y3 Y1 | 1  0  0  0  1  1  0  1 |
| X2 X0 X1 X3 | 1  1  0  1  1  1 | Y1 Y2 Y0 Y3 | 1  1  0  1  0  0  1  0 |
|----------------------------------------------|------------------------|
| X2 X3 X1 X0 | 1  1  1  0  0  0 | Y3 Y2 Y0 Y1 | 0  0  0  1  1  1  1  0 | !c
| X3 X0 X2 X1 | 1  1  1  0  0  1 | Y1 Y3 Y2 Y0 | 0  1  1  0  0  0  1  1 | !d
| X0 X1 X3 X2 | 1  1  1  0  1  0 | Y0 Y1 Y3 Y2 | 1  0  1  1  0  1  0  0 | !a
| X1 X2 X0 X3 | 1  1  1  0  1  1 | Y2 Y0 Y1 Y3 | 1  1  0  0  1  0  0  1 | !b
|----------------------------------------------|------------------------|
| X2 X1 X3 X0 | 1  1  1  1  0  0 | Y3 Y1 Y0 Y2 | 0  0  1  1  0  1  1  0 | !g
| X3 X2 X0 X1 | 1  1  1  1  0  1 ! Y2 Y3 Y1 Y0 | 0  1  0  0  1  0  1  1 | !h
| X0 X3 X1 X2 | 1  1  1  1  1  0 | Y0 Y2 Y3 Y1 | 1  0  0  1  1  1  0  0 | !e
| X1 X0 X2 X3 | 1  1  1  1  1  1 | Y1 Y0 Y2 Y3 | 1  1  1  0  0  0  0  1 | !f
=========================================================================




I quite like this version. The 4x4 bit matrix could be use standalone and the permuter converter might be fun by itself too.
Another nice thing is that the signals now only pass through a single mux each. Although I plan on using it for digital signals
they are analog muxes. With the signals passing through a single mux it would not be very difficult to make them useful for
negative voltages so it could be used for a modular synth as well.


4x4 bit matrix converter v1_0.gif
 Description:
 Filesize:  121.76 KB
 Viewed:  224 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

4x4 bit matrix converter v1_0.gif



_________________
"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: Fri Mar 16, 2018 7:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

here's the version with reduced chip count.


4x4 bit matrix converter v1_1.gif
 Description:
 Filesize:  91.96 KB
 Viewed:  258 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

4x4 bit matrix converter v1_1.gif



_________________
"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 Mar 17, 2018 6:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

And then there where 6 chips left.
I don't think I can reduce it any further.

Just to be clear, this is meant to be used in combination with the 4x4 bit matrix
to give it the same functionality as permuter V1.1 & V1.3 but with LEDs.


4x4 bit matrix converter v1_2.gif
 Description:
 Filesize:  70.62 KB
 Viewed:  236 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

4x4 bit matrix converter v1_2.gif



_________________
"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 [16 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