The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design >> Mixed-Signal Design >> pseudo-random sequence generator https://designers-guide.org/forum/YaBB.pl?num=1130947841 Message started by vivkr on Nov 2nd, 2005, 8:10am |
Title: pseudo-random sequence generator Post by vivkr on Nov 2nd, 2005, 8:10am Hi, I am looking for a simple way to generate PRBS sequences. I should like to have one with a fairly long period (2^20 say), but the bigger problem is that I would like to use this to get 3 states which are equally (or almost equally) likely, but the period in which these states occur is fairly long. Typically, it is easy to get 2 such states out of a PRBS (any of the outputs) but trying to get 3 states out of it has me stumped. I would appreciate any help. I am not much of a digital designer but if there are references describing design of such a block, then I think I can pick it up. Regards Vivek |
Title: Re: pseudo-random sequence generator Post by Paul on Nov 2nd, 2005, 11:16am Hi Vivek, PRBS sequences are generated using linear feedback shift registers (LFSRs). You can find sample code here (doulos.com): http://www.doulos.com/knowhow/vhdl_designers_guide/models/bist_circuits_part_one/ and here (generic implementation): http://vnsnes.freeshell.org/lfsr/LFSR.v In order to make sure each sequence only occurs once each 2^N-1, you must chose the taps correctly. More on this and an introduction to Galois field math are presented here: http://www.newwaveinstruments.com/resources/articles/m_sequence_linear_feedback_shift_register_lfsr.htm The two implementations of LFSRs are shown in this reference, but you should be aware that the tap definition to obtain PRBS sequences is opposite. I hope this answers your question. Paul |
Title: Re: pseudo-random sequence generator Post by jbdavid on Nov 3rd, 2005, 9:03am The first thing that occurs to me for a 3 level output, would be to alternate the "1" value between +1 and -1.. so every even 0-1 transition would go positive and the odd ones would go negative. you'd maintain the same direction until the next 0.. --- another idea.. use the state change of the prbs sequence to drive a 3 state counter/modulator.. this has the disadvantage of either a 1 to -1 or -1 to 1 transition on every third state change. -- a third idea .. bring out 2 bits from the prbs sequence.. then assign two patterns to the same value.. ie 00 = 11 = 0 , 10 = -1 , 01 = +1 this should, in effect, be the differential of the PRBS pattern.. Hope this helps |
Title: Re: pseudo-random sequence generator Post by vivkr on Nov 4th, 2005, 4:33am Hi Paul & David, Thanks for the feedback and the links. I think it should provide useful reference material. Regarding the suggestion of using a PRBS to drive a 3-state machine, I already thought of that but if you look carefully, you have 3 states with probabilities of 1/2, 1/4, 1/4. This would be undesirable. Perhaps, I need to insert a random scrambler in between before I map 2 bits from the PRBS to a 3-state machine. This ought to even out the probabilities a bit more. I need to try out these suggestions first. Thanks again. Vivek |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |