LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

decoder

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 

Download All
0 Kudos
Message 1 of 10
(4,440 Views)

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

0 Kudos
Message 2 of 10
(4,431 Views)

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

0 Kudos
Message 3 of 10
(4,414 Views)

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

0 Kudos
Message 4 of 10
(4,410 Views)

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

0 Kudos
Message 5 of 10
(4,403 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(4,388 Views)

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 

0 Kudos
Message 7 of 10
(4,379 Views)

It is sounds very easy but not that much . i can not debugg it. 

0 Kudos
Message 8 of 10
(4,372 Views)

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:

  • Get the next 3 "bits" (U8 array elements)
  • Combine them so as to take a "majority vote" (i.e. True if the majority of the bits are True, False if the majority are False, else ambiguous)
  • Output the "majority bit"

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 ...

0 Kudos
Message 9 of 10
(4,350 Views)

@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"


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 10
(4,336 Views)