05-26-2015 11:24 AM
Hi every one
This is the majority decoder with the repition of 3 . It is not working . The case is always true!!
the decoder input is set of 1 and 0 . for example I want to send 011 , then endoder (with repition 3 ) output will be 000 111 111.
now the input of the incoder is 000 111 111. I should extract 011 from output of the decoder. it is majority decoder , it means that if the input is 001 it means that the bit was 0. if it is 110 it means that the bit is 1.
My teacher said the inputs of the decoder of 3 bits which I do not undersatnd very well.
but I add 3 bits together, if sum is less than 1 and equal one, it means that the bit is 0. if not the bit is 1.
It is not working. some one please help the debugging.
Thank you
05-26-2015 11:53 AM
You may be getting confused by the term "bit sequence". What do you mean by this? Is it a sequence of "bits" (binary digits) (which is most easily represented by an array of booleans) or a "representation" of such a sequence, using the numbers 0 and 1 (in some suitable numeric representation)?
From your Front Panel, you seem to be using the latter numeric representation for your bit sequence, and using a U8 (instead of a U1) to represent it. OK, that's fine. But then inside your For loop, you take the U8 apart into its bits -- why? The U8 array is the bit sequence already.
Do you see where you got confused?
Bob Schor
05-26-2015 12:28 PM
Hi
You mean I should ommit for loop?
I got confused by U8 , because when it said array of U8 it means array which each content is U8.
anyway, what is the solution? how come the inputs are 3 bits. my teacher said the inputs are sequence of 3 bits .
But I think it is a stream of 0 and 1 and I and I should choose 3 bits each time then do the calculation?
what is the solution?
Thank you
05-26-2015 12:33 PM
Find out if your Teacher is representing the stream of bits as an array of U8, with 0 being "off" and "1" being "on", or as an array of Boolean, with "True" being "on" and "False" being "off". It has to be one or the other -- your code seems to be trying to make it both.
BS
05-26-2015 12:35 PM
I can not understand what you are saying. do you know the solution.
Foregt what my teacher said, you have the Vi so can you make it work?
BR
05-26-2015 01:05 PM
@uni-pixel wrote:
I can not understand what you are saying. do you know the solution.
We are asking you for the actual requirements. What is the format of the inputs? What is the format of the outputs? If you cannot answer these, you cannot write the program.
05-26-2015 01:09 PM
Hi Cruss
The format is in attachment. it is from the book of Ni.
Digital Wireless Communication Physical Layer Exploration Lab Using the NI USRP
It is array of U8 As you can see in the picture.
Thank you
05-26-2015 01:21 PM
It is sounds very easy but not that much . i can not debugg it.
05-26-2015 04:04 PM
OK, I'm going to go with the assumption that bits (U1) are stored in U8's, so the U8 array [1, 0, 1, 0, 0] represents "T, F, T, F, F".
Now we can come up with an algorithm, to wit:
So, 3 bits in, 1 bit out.
The rest is left as an Exercise for the Student (that means you, uni-pixel). The Good News is you've already done some of the work. Just pay attention to the statement of the Algorithm and you should be fine.
Bob Schor
P.S. -- once you've done that, just for fun, try implementing the same algorithm using the assumption that bits are stored as Booleans. It's essentially the same code ...
05-26-2015 05:30 PM - edited 05-26-2015 05:31 PM
@Bob_Schor wrote:
OK, I'm going to go with the assumption that bits (U1) are stored in U8's, so the U8 array [1, 0, 1, 0, 0] represents "T, F, T, F, F".
With that assumption, I would do something like this in order to do the "vote"