 So, last time what we were looking at was delta network and I had not given the formal definition so far, but we actually I was trying to give the fundamental reasoning why a delta network is going to be delta network. And I told you that when I am actually take connecting the inputs or the outputs from the previous stage and since the output this is being selected based on a certain digit in the address. So, if I am going to select all the inputs if any one input is being select from say some value x and if I choose from some other value y now then there is going to be a problem actually because this onward path will be decided by a different set of digits. So, same digit cannot be used to reach to the same output actually same combination of digits it is not possible. So, all the inputs this is x then this also has to be x and wherever you are connecting this also has to be x this also has to be x that is the condition which need to be satisfied. So, if you can build up a banyan network with this condition you will get a digit controlled routing network or delta network. So, for that 8 by 8 case I think that is what we were discussing last time. So, I had drawn something, but something like this. So, now this is 0 this is 1. So, I can actually take connect in any way I want I need to build up only a multiplexer tree that is very important I should not be able to isolate I should not land up with a situation where from a input you are not able to reach to all the outputs that condition should never happen. So, there has to be a demultiplexer tree. So, with 0 for example, I can connect here 1 I can connect here I can do whatever way I want actually. So, I am just connecting something arbitrary actually and from here there are again two things these are again two I can connect in any fashion I wish something like this. So, I am just making an arbitrary demultiplexer tree and based on the delta network. So, next one which I will take this will also have not two outputs I can actually use these or I can use this system material for me as far as I am going to share a multiplexer tree it is fine. So, for example, I can actually choose when I am connecting here it is connected to 0. So, this 1 cannot come here remember because then it is not going to be delta network. So, I have to connect only a 0 here and a 1 here. So, this leaves to me only one choice, but maybe I can actually connect this is 0. So, I connect this thing here and I am able to cover up these three. So, part of the multiplexer tree from here is this these two I have not covered actually so far. So, for covering these two I have to choose from these actually from any one of these two or I can choose this one. So, if I choose this these are like 4x 4 by 4 this will be another 4 by 4 and then mapping. So, I can do it another way around also. So, for example, if I choose this one. So, this one cannot be connected to these two because then I would not be able to form a demultiplexer tree. I have to connect this meant to only these two conditions these two no other option. So, there is a 0 and there is a 1. So, this one is connected to 1. So, this one has to go to here if it has to be delta network. I am just creating a random topology I have not replanned it I am just doing it here in the class just to show as an example how does it work. So, the next one is this because this two has been already covered for this this and this was not there this is also 0. So, this will also be 0 you can check actually if I put certain number the 0 from here 0 here and a 0 here if all three digits are 0 I will always land up with that box any one of these four inputs all three 0s will always give I will come to this output that is only map which is possible. If I put 0 0 1 I will take 0 here 0 and this will be 0 0 1. So, I am actually assuming there are three bits B 2 will be used for routing here B 1 will be here and B 0 will be here I can now expand for the other one. So, there is a 0 and there is a 1 I have to build up a demultiplexer tree I can choose this one. Now, remember this is taking input from 1. So, if I choose this one option for a demultiplexer tree I am covering these two and this guy or this guy has to be chosen this cannot be chosen in that case. So, but of course, later on you can find out you can do shuffling of these things move here and there twist around and you will be able to build up some nice topology. So far it looks very bad. So, if I connect this is one. So, I can only connect one here that is a condition for delta network this 0 because I have connected here which is connecting these two. So, I have to either use this or this this already occupied. So, I can only use this option. So, I will take this and this will take 0. This one this is one and this is one the bottom one can I connect this 0 here. This one here how because one can only be fed here and one can only be fed here the two 0s have been taken two 0s has to come here. If you do this you would not get a 0 1 see you have to understand the balance because this is a binary output. So, half of the nodes will take the inputs from all 0s half of them will take from all 1s. So, you have no choice actually in that, but you can make arbitrary lot of combinations each one will give a different permutation will be set of permutations which will be permitted. So, now take from here. So, this is 0 this is 1. So, this 0 has to go obviously here there is no other option you cannot connect a one here and this one will be taken by this guy. So, where this has to go there only this and this which are available this is taking 1 this is taking 0. So, this 0 has to go here and this one has to go here. This is another example actually now you put a 0 0 0 here where you will go go to top top comes here put 0 0 here top again you will come here only thing the numbering is not 0 1 2 3 is not like that, but numbering is fixed. So, the moment you give address as 0 0 0 it will always come at this out and of course, if there is a packet going for 0 0 0 direction this switch this line and this line and this line will be busy there will be some other pattern which may not be permitted only certain set of patterns will be permitted and that is a specific permutation which is allowed. So, this another delta network of 8 by 8, but usually we can keep life simple this has been too complicated. So, best way is to go for that inverse bin configuration or then we will actually not talk about another things which is known as shuffle net, because usually what happens is whenever you are going to create fabricate this stuff each one is a in a VLSI or in optics this is nothing, but a small processor in itself is buffer and everything and I have to interconnect. So, if it is a optical thing and for example, lot of buffers a lot of this process have been built I stack one on top of other these stages I have to make a interconnection between them. So, this interconnection has to be something which is uniform and I can repeat it this interconnection is different this interconnection is different. So, actually it is not desirable for neither for VLSI nor for optical computing implementation. So, both ways this is not be suitable actually yes here also here you might actually I do not know I have not checked. It varies from each what happens total number permutations are 8 factorial right, because only 2 raise power 12 possible combinations can be set, because you can either been cross or bar state they are total 12 switches and this can take two states 2 raise power 12 possible permutations can be set 2 raise power 12 is a smaller than 8 factorial. So, 8 factorial minus 2 raise power 12 those combinations are not permitted by a switch 8 factorial is higher than 2 raise power 12 I can prove that I can prove that. So, this is 8 factorial fine 2 cube 3 4 the checks are no this 3 will also not 2 into 3 6 has been broken. So, how much is this number? It is 5 x of 5 or 3. 2 raise power 7 2 raise power 5 2 raise power 5 is 32 and this number is greater than 32 actually. So, these many this much is the difference which you will have in the permutations, but I am not interested in the permutation as of now I am only interested in kind of what is the blocking probability that is the basically this is the issue. So, now coming to the actual definition now this is the 2 by 2 is all life is very simple want a simplified version I think go with the Benz network. So, I think the most important thing which is there is you have figured out that how to connect to create a delta network make sure you always create a demultiplex tree and the inputs to a switch should always come from the same output number from the switches in earlier stage there has to be exactly one connection from a switch in the previous stage to the switch in the next stage. Another important thing none of the input and outputs will be left free in the intermediate stages all outputs in the output stage will be the outputs and all inputs in the input stage will be the inputs are to the switch matrix. So, another one 8 by 8 I think this I had done earlier but let me do it again. So, I will make give a general proof for a shuffle thing shuffle a generalized shuffle I will be talking about not for this one this one is pretty simple I can take 0 here 1 here this 0 1 0 1. So, remember this can only take input from 1 this can only take input from 0. So, that condition has to be satisfied. So, this one tree I can make another one I am actually drawing shuffle net here this is 0. So, it can go here this is 1. So, this can go here this is 0. So, this can go here there 2 trees no links are common between these 2 trees actually so far there is no link which is common in these 2 trees that is the beauty of shuffle net actually. Now, on what we will get in fact you can very easily convert to a bench network if you are smart enough. So, I will I think you think about it and I will ask how that will be done. So, this is 0 this is 1. So, this can go here and I create a tree here and this one can go here created a multiplexer tree this is also a delta network. And how to create converted to inverse bench I can visualize that from here. So, yeah you move it here and you move this thing here you get inverse bench these are like strings you just take this block move it here this one you move it here it is inverse bench nothing else. Sometimes the things are equivalent, but they do not seem to be equivalent actually this is equivalent to inverse bench. So, now let us go to generalize definition for what we call the delta network. So, how the it formally it will be defined it is a subclass of delta network this is not shuffling I will define what the shuffle is actually. This is not shuffling, but it is a delta network link between first and second stage is exactly same ditto there is no change ditto this is a shuffle this particular thing is shuffle shuffle is one particular example which can be repeated between multiple stages you require log 2 n stages actually. So, this is 8 log 2 n is 3 log 2 of 8 is 3 in this case because we are using 2 by 2 switches, but this is not a general definition general definition is I will use the switch which will be of a by b and the number of inputs to a switch will be a raise power n number of outputs will be b raise power n generalized delta network. So, now let us go to this structure because this is what I will be using for proving that shuffle net actually in general a generalized shuffle net is a delta network we have to formally prove it. So, actually it is not evident here it is fine for 2 by 2 it is simple, but you cannot keep on drawing for a very large size dimensional switch. So, the switch structure will be something like this now I am coming to that. So, this will be made using a by b cross bar switches. So, I have to write actually many statement these are all from the part of the definition. So, delta network will be in general will be filled by a by b switches a by b is a cross bar switch technically is equivalent to that it is a strictly non blocking switch output ports are numbered as 0 1 2 n b minus 1 they total b output ports in every switch. So, input ports will be numbered as what I should write a minus 1 perfect. So, any a raise power n by b raise power n switch will contain n stages. So, we were having 2 cube by 2 cube switch 3 stages because of that because it was built with 2 by 2 switches. So, it will have n stages such that unique path that is a condition for Banyan network of constant length exist from any input to any output none of the inputs of any a by b switch or I call it cross bar unconnected. So, this actually implies that from 1 stage whatever is the number of outputs has to be equal to number of inputs to the next stage. This is obvious and from here actually you can and of course, we also know that now you will have a raise power n sources they will be mapped on to b raise power n destinations or the output ports. And the stages will be numbered from 1 to till n starting from source side. So, how many modules will be there in the first stage yes perfect because a inputs are there to each switch total number of inputs a raise power n. So, a raise power n divide by a. So, it gives a raise power n minus 1 and what is the number of outputs which are coming from first stage each switch is a output of b these are number of modules has to be a raise power n minus 1 into b. So, this should be equal to number of inputs to the second stage. So, how many number of modules in the second stage you again divide by a number of outputs coming out of second stage and so on. So, once you understand this. So, i th stage will have a raise power n minus i these many number of modules each module will be of size a by b. So, what is the total number of modules I can do summing up of all these with index i total number of modules will be and I can now sum it up this will give me and this of course, obviously is when a is not equal to b because when a is equal to b this actually becomes 0 by 0 form. And when of course, a is equal to b in that case this summation will be nothing, but n minus 1 which will be nothing, but obviously the constant will come out. So, either these many modules will be there when size is equal or this. So, for our case when n was 3 a was 2. So, it is 3 into which was 12 for 8 by 8 delta net. But in general for a by b because 2 by 2 was simpler in general for a by b this is what will be the expression. So, now let us look at the rule of how you are going to construct with a by b 2 by 2 was fine a by b also you will follow the same rule you will every time will create a demultiplexed tree every time and you will still follow the same rule. So, I can do it for a very small example of 3 by 2 or something and then take care of that. So, I am going to take 4 square by 3 square switch. So, it will be built with 4 by 3 switching elements and it will be having 2 stages. So, you can if you want you can create for anything, but just this is an example of the principle which are followed for building up the topology. So, I create and I require 4 is power n minus 1 4 actually modules or 4 by 3 in the first stage. Second stage I will be requiring 4 into 3 is 12 12 divided by 4 I require 3 modules obviously. So, let us look at the first input 0 1 2 obviously there are to be only 0 input should come and anyway I am only creating a demultiplexed tree I got the demultiplexed tree. Since, there only 2 stages it is actually simpler here same is here this 0 has to go here this 1 has to go here all the inputs has to come from the same numbers is also a delta network and the addresses which you will be keeping is output addresses will be decided by the number there. So, there are only 3 outputs remember. So, I require a B array digit if it was 0 and 1 a binary bit now I require 0 1 2 can only be the number and there 2 stages. So, I can use an address like 0 0 0 1 0 2 1 0 because then I cannot have more than 2 these will be the addresses. So, first one will be used for routing in the first stage second one in the second stage and you will reach to the destination these will be the numbers like 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 and 2 2. So, you can build up any kind of complex thing with this kind of structure make sure you make a demultiplexed tree every time for every input which are going to connect while maintaining the same condition and of course, there can be in general can be many possible ways you can create. So, now, let us look at shuffle network which is the one of the regular interconnection pattern which can be periodically put between all end stages. So, generalize shuffling we have to identify. So, q shuffle of q r objects how that will be defined. So, while shuffling is technically I have got a stack I build up another stack I can build any number of stack shuffling means take first from here second from here first from here second from here I did the shuffling. So, usually when you are playing cards you are always making two actually portions and then you are taking one from here one from here that is how you do the two shuffle actually there. In general there need not be two shuffle there can be k shuffle. So, you can actually put all the cards into k separate packets take one from here one from each packet every time in round robin fashion and you create a k shuffle in that case. So, we want to actually now give a generalize definition because this is required for me for doing the address mapping because the proof is by induction. So, q shuffle of q r objects will be defined as this will be denoted by where q and r are positive integers this is nothing but I am generating a permutation of indices q r indices which are 0, 1, 2, q r minus 1 and this will be defined by s of q r q into i. So, i is the basically the input side. So, there is a interconnection pattern from input to output. So, you have numbers like this 0, 1, 2, 3 till q r minus 1 I am now trying to generate a map to this. So, this interconnection pattern is what is shuffle. So, for if you take this ith pattern which is sitting here this i is mapped to what that is what we are trying to figure out through a formula. So, it will be always q into i it is a q shuffle. If there are two shuffle I multiply by 2 and then do it actually 2 shuffle means there are two cards. So, if I take the first one the next one has to go to the you have to leave something in between that is why q into i will be there. So, 0 will be connected to 0, 1 will be connected to 2, not to 1 2 will be connected to 4 and so on. But then the number will saturate then you have to do a modulo operation. So, this is actually for that q shuffling which what I am implementing now of q r objects. But if I have a step of q r minus 1 the maximum possible shuffling. q r minus 1 is not this step this step is of q r objects they are numbered from 0 to q r minus 1 this 0 also you have to come in a actual number of objects is how much 1, 2, 3, q r they are numbered in this fashion. They are actually numbered in this fashion because in computing we always start 0 is always included always the first object. So, if you have n address line they will be numbered always from 0, 1, 2, 3 till n minus 1 I am not able to understand i q into i can be greater than q r. That is fine there is a modulo operation I am going to give an example with this. There are two expressions which actually can be used one of them is this actually and of course, the equivalent expression which also can be used is this see these both are equivalent expression. So, for the 8 by 8 let me build up a two shuffle with this. So, 1, 2, 3, 4, 5, 6, 7, 8 numbered from 0, 1, 2, 3, 4, 5, 6, 7. So, we will do with the first formula first. So, q into r is 8, what is r is 4, q is 2. So, I have correspondingly the numbers here 0, 1, 2, 3, 4, 5, 6, 7. Let me just do it parallely actually. So, i is 0, 0 into q is 0, i divided by r I have to find out a integer which is lower than i by r, highest integer which is lower than i by r actually that is what it means i by that is the lower flow that is the flow function this which I am wrong. This actually means the integer which is lower highest integer which is lower than i by r. There is a similarly a ceiling which is the lowest integer which is higher than the number. So, 0 into 2 is 0, 0 by r is 0. So, highest integer lower than or equal to 0 is 0 actually and modulo q r it will get a 0, so 0 has to be connected to 0. When it is 1, 1 into q, q is 2 here you will get 2 and 1 divided by r, r is 4 actually remember. So, 1 by 4 is a number which is a fraction. So, integer highest integer lower than that is 0 actually. So, 1 into 2 will give me 2, what 2 will give? 2 into 2 is 4, 2 by 4 neglect the other part that 4 thing. So, this will be connected to 4, 3 will be connected to 6 when the 4 will come. So, 4 into 2 is 8 which is fine 8 plus 4 by r is 4 by 4 is 1. So, that number will come out to be 1 when you take this floor function 4 by 4 is 1, so that will be 1. So, 8 plus 1 is 9, 9 modulo of 8 is how much? So, 4 will be connected to 1 try for the 5th similarly. So, 5 into 2 is 10, 10 plus 5 by 4 floor function will give you 1. So, 10 plus 1 is 11, 11 modulo 8 is 3, similarly this is 6, this is what was exactly the shuffle net which I had drawn, but binary was easier to remember, but in general you can do for q shuffling. Now, use with the second formula, this will also give the same result actually not an issue. So, 0 will give you 0, q into i modulo q r modulo 7 now, 1 will give you 2, 2 will give you 4, 3 into 2 will give you 6, 6 is actually modulo because 7 I am taking, 4 will give you, 4 into 2 is 8, modulo 7 will give you 1, right connection 5 into 2 is 10, modulo 7 will give you 3, 6 into 2 is 12, modulo 7 will give you 5 which is perfect and when q r i is equal to q r minus 1 that time you have to use this i the lower part it also gives. So, that is a basically thing which will you be using now for doing transformation of address lines actually ultimately. Shuffle will give you the same connection pattern between multiple stages. So, why you are implementing in silicon the same mass can be simply repeated three times or it is a larger switch same thing you repeat multiple times. If you do not do that your cost of fabrication actually will go up you require n different kind of interconnection and different kind of masses you cannot simply repeat that is I think is the issue. If it is optical and I am making a kind of a planar array of transmitter then I put another one on top of it. So, I require some between holographic interconnect every time you have to design a different holographic interconnect between stages. If the same thing is repeated you only make it once make multiple copies push it mass production reduces the cost. Yes that is all optical implementations will be something like this you will have this here each one is a processor it will connect two inputs on top of this you will actually have a slab which is a holographic thing computational holographic holography actually is used you create phase grating technically by depending on what interconnection pattern is required. But remember it is a two dimensional thing it is not one dimensional here I am actually drawing one dimensional. So, two dimensional also can be done in the same fashion, but I am not moving to two dimensional thing here. But that is actually a all together a different domain that is I think some other course probably this can be discussed, but we do not have a course on optical computing. So, you do not get opportunity any course on optical computing will talk about this the structures maybe some other semester I will try. So, I think we will close here. So, shuffle now we have understood I will take exactly this thing and we will start a formal proof that shuffle net actually is a delta network a generalized shuffle net which will follow this interconnection pattern from the output of earth stage to I plus first stage mapping is done as per this.