hello every one , i want to create an array with size A[128x4], in which A[1] consisting of only 128 elements, A[2] consisting of 32 elements, A[3] consisting of 8 elements, A[4] consisting of 2 elements, i want to run a (m = 1:256) bit counter through my array in a way that after filling my 128 elements in A[1] it goes onto fill the A[2] ..... i want to collect my output at from second element from A[4] array, it will be even better if the array shift after receiving a incremental feedback((i.e receiving on feedback as '2' the counter goes to A[2] array, receiving feedback as '3' the counter goes to the A[3] array to it an so on)). kindly guide me with it, thank you.
all im trying to ask is i want to perform an counter operation of 256, which fills only 128 elements in A[1], and 32 elements in A[2] and 8 elements in A[3] and 2 elements in A[4], sir, thats my expected answer , i even drawed the sequence how it has to come
The drawing suggest a shift operation, but once you mentioned "counter", should we assume that the overflow of each counter will trigger increment of the subsequent one in the chain ? Anyway, It is expected that you post your code, otherwise you have to get the first steps on that language.
im passing it to an array array A= cell(1,4);
A[1] = is a (128x1) array.
A[2] = is a (32x1) array.
A[3] = is a (8x1) array.
A[4] = is a (2x1) array.
im passing my input to first element of the A[1] and collecting from the second element of the A[4] array. as SHOWN IN THE FIGURE.
after filling 128 elements in A[1] the input is passed through A[2]. AND SO ON , im going to collect my output from second element of A[4].
- - - Updated - - -
i have made some random thoughts on my code , pls correct me in this.
Code:
N= 256; %% counter size
A = cell(1,4); %% four cell arrays
for m =1:N %% counts
for level = 1:numel(A) %% incremental feedback
A((N/(4^(level-1)))/2)=0; %% when level 1 = it creates 128 bit size, for level =2 ,32bit size,
%% similarly when level =3,8bit,when level= 4, it creates 2 bit size.
A(1) = m; %% giving an input to the A[1] of the first cell
A = circshift(A,[0,-1]); %%shifting operation
output=A; %% output collecting
end
end
The Cell() function creates a n-dimensional array, but if I understood correctly, you want create a linear array. Anyway, you had still not answered what was asked in post #6.
@andre_teprom: sorry then my mistake cell shouldn't be used..,"should we assume that the overflow of each counter will trigger increment of the subsequent one in the chain"!!!!, there is only one counter(256 bit), when the counter fills all the elements of A[1](i.e of 128 elements)after filling it, its gets the trigger then the counter continues to fill the array A[2].