LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create 4 bit lfsr in labview

I need a detailed explanation on how to create a 4 bit Lfsr in Labview. Do i need shift registers or flip flops? Are they the same thing?? How do i conect them all up???? Please someone help asap, i am a complete novice to Labview!!!
0 Kudos
Message 1 of 23
(7,505 Views)

I'm going to assume that by Lfsr you mean Linear Feedback Shift Register.  Unfortunately there are not flip-flops in LV.  What LV does have are shift registers which can be used to pass data from one iteration of a loop to the next iteration.  There are also functions in LV to perform a rotate/shift function on a number.  So you could probably use a FOR loop with a shift register and the rotate function to do what you want. 

What kind of function is going to determine the bit to be shifted in and how many shifts are you going to perform?

0 Kudos
Message 2 of 23
(7,496 Views)

Yes i have found out that Labview doesn't have any Flip flops so Shift registers would need to be used. I found an interesting website that shows a 3-element Lfsr,(BELOW).

http://courses.ece.uiuc.edu/ece463/SP08/labs/LVtraining/LVtutorial.htm

It uses a while loop instead of the for loop you mentioned. I was wondering if you know how to develop it into a 4 element LFSR (eg where to connect the shift registers to the exclusive or...............This question is open to everyone!!!!!!

0 Kudos
Message 3 of 23
(7,466 Views)

You still have not said what you are trying to accomplish with the LFSR.  They can be used to generate psuedo random sequences, high speed counters etc.  If you look carefully at the link you posted, at the end of the exercise the heart of the vi is a FOR loop.

The questions remain:

1. What function do you wish to apply to the current data to generate the next bit to be shifted in?  XOR or XNOR?

2. If creating random data, how many bits of data are you trying to create?

0 Kudos
Message 4 of 23
(7,444 Views)
I want to use an XOR and i am trying to get graphical and tabular results. As per random data maybe up to 21....Please answer asap, thanks for your help
0 Kudos
Message 5 of 23
(7,407 Views)
and yes i would like the psuedo random sequences in tabular form....
0 Kudos
Message 6 of 23
(7,406 Views)
Here is what a 4-bit LFSR with the XOR might look like.  The key here is to look at how it uses the shift registers.
0 Kudos
Message 7 of 23
(7,402 Views)
Thanks for your help. Unfortunately as i said before, i am a complete novice to Labview!! I do not know many of the objects in your labview diagram. For example what is the object to the left of the 4 registers? And was it a while loop you used? I would be extremely grateful if you could describe how you got to all the features shown on the labview diagram.....where you navigated to etc. I also want to make tabular and graphical results, could you please add those onto your diagram as well so i know where to add them. Thank you very much for your help.
0 Kudos
Message 8 of 23
(7,378 Views)

If you don't know the difference between a what a FOR  and WHILE loop looks like then I have to wonder if you have even started up LV and looked at the palettes to see what functions are available.  I have shown you the concept of how to implement a LFSR in LV. 

Fire up LV and do some exploring in the palattes and see what functions are available.  There a several good examples that ship with LV as well.

HINT:  The diagram takes an 8bit integer, converts it to a boolean array, indexes the array to access the 4 lsb individually. 

0 Kudos
Message 9 of 23
(7,353 Views)
listen, all i want to know is what type of loop it is, and what is to left of the 4 shif registers. Thanks.
0 Kudos
Message 10 of 23
(7,346 Views)