The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 11th, 2024, 3:53pm
Pages: 1
Send Topic Print
pseudo-random sequence generator (Read 3626 times)
vivkr
Community Fellow
*****
Offline



Posts: 780

pseudo-random sequence generator
Nov 02nd, 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
Back to top
 
 
View Profile   IP Logged
Paul
Community Fellow
*****
Offline



Posts: 351
Switzerland
Re: pseudo-random sequence generator
Reply #1 - 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_...

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
Back to top
 
 
View Profile WWW   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: pseudo-random sequence generator
Reply #2 - 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
Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   IP Logged
vivkr
Community Fellow
*****
Offline



Posts: 780

Re: pseudo-random sequence generator
Reply #3 - 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
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.