# Introduction to Optisystem – How To Setup The Pseudo Random Bit Sequence Generator

Compatibility:

In this Optisystem introductory tutorial video we will be looking at  how to setup the pseudo random bit sequence generator In Optisystem

The Pseudo random bit sequence can be used to generate a binary sequence of pseudo random bits. The bit sequence can be connected to a binary sequence visualizer so that the output bit sequence can be seen.

Double clicking the block shows the main properties. Double clicking beside bit rate we can change the bit rate of the block to base it on other parameters or to make it get it’s value from a function. Pressing Evaluate we can see what the current value of bit rate is .  If we want to change the value of the bit rate defined for the entire project we can double click on our work space and the global parameters window will pop up. In the global parameters window the bit rate for the project as well as other global parameters may be changed. Now returning to the bit sequence generator and pressing evaluate script we can see that the bit rate has been updated. With the operation mode on probability the bit sequence generator will generate a random output and the probability of generating a 1 will be based on the Mark probability . The length of the sequence generated will be equal to that of the global parameter sequence length

Before we test out the bit sequence generator, I am going to change the number of leading and trailing zeros so we can easily observe the output. AS you can see, the output of the generator reflected a 0.5 probability of generating a 1 at the output.

Now I would like to change try changing the mark probability to something lower. After calculating the project a couple of times and looking at the visualizer we can see that the probability of generating a 1 is now much lower

Going back into the bit sequence generator and going into the random numbers tab we can choose to either generate a random seed each time or define our seed. A Seed is a number used to initialize a pseudo random generator. So if we unchecked the generate random seed box and instead choose our own random seed index, this means every time we run the random generator we should receive the same set of random numbers because the seed used to generate them is the same.

Running the program twice the result is as expected. The set of random bits is the same because we used the same seed both times. Going back to select the generate random seed box again we should expect that this time the result will be different because we are not using the same seed. The Different each iteration box can be used to generate a different random seed each time when the project is being run for multiple iterations. Upon calculating the project we can see that this time the result is different because the seed we are using has changed

Going back into the bit sequence generator and changing the operation mode to order will cause the pseudo random generator to generate a random bit sequence with a period of 2 to the power of the order minus 1.

Clicking on “order” the value can be changed to make it dependent on other layout parameters. Pressing evaluate we can see what it’s current value is. WE  can now calculate the project and check the binary sequence visualizer to see the output. Changing the output range to a larger number we can see that the sequence ends at 1024 bits. Given an order of 10 this means that the period of the sequence would be equal to 1023 bits. Going back into the bit sequence generator and changing the operation mode to alternate will cause the output sequence to alternate between ones and zeroes. Changing the operation mode to ones will cause it to output all ones. Changing the operation mode to zeros will cause it to output all zeroes.