SLIDAS Random Number Emulator


This is a function, implemented in C, which emulates the random number sequence produced by the SLIDAS card in modes 5, 6 and 7.

If you are testing a ROMB, you may want to verify the random number sequence coming out of the SLIDAS after you have received it in the ROMB. The random number sequence is not really random, it is determined in hardware and so can be emulated.

To use slidas_random(), do the following;

  1. You will have a program called for example, link_test.c. This program will be able to see the data that has come into the ROMB from the SLIDAS.
  2. Edit link_test.c to include a test of this data. You can do this by comparing it to the result of a function call to slidas_random(). As an example, if the data from the SLIDAS is in the array slidas_data[], your code might look like this;
    1. for (i=0; i<NO_OF_WORDS_TO_TEST; i++)
        if (slidas_data[i] != slidas_random(0))
          printf("Error found in random data!\n");

  3. Calling slidas_random(0) just gives the next random word in the sequence. Mostly, this is all you want. However, if you want to reset the sequence, call slidas_random(1). You will only want to do this if you have reset the SLIDAS as well. E.g.
    1. first_random_word = slidas_random(1);

  4. Compile the programs with a line (in UNIX) like;
    1. $ cc -o link_test link_test.c slidas_random.c

Note that the first time the function is called, it returns the first random number in the sequence (which is 0x95c5011c). Thereafter, it returns the next number automatically. There is no need to reset the function unless you reset the SLIDAS!

One point to bear in mind is that the random number cycle repeats after 4,294,967,295 iterations. Since this is also 2^32-1, it means that the SLIDAS produces every possible 32-bit word during a cycle of the pattern (except for 0x00000000 which would jam it!). This might seem a lot, but at the top speed of the SLIDAS (40 MHz) this takes only 107 seconds.

To get the code, simply download the C source code as an ascii file (click on the link, then do File, then Save As...).

There is also a skeleton program (called link_test.c) which calls slidas_random(). This program takes as an argument the number of random words required (e.g. $ link_test 100 will print out the first 100 numbers.)

Finally, here is a file which contains the first 1000 numbers.

Owen Boyle
24 October 1997