Coder Social home page Coder Social logo

Random values not sequential about osvvm HOT 1 CLOSED

osvvm avatar osvvm commented on May 20, 2024
Random values not sequential

from osvvm.

Comments (1)

JimLewis avatar JimLewis commented on May 20, 2024

This is normal.

RandSlv(16) uses the current seed and randomize a 16 bit number. The base randomization is 32 bits, so this is done with a single randomization.

The first RandSlv(8) uses the current seed to randomize an 8 bit number. The second RandSlv(8) uses the seed updated by the first randomization to randomize an 8 bit number.

Hence, in your RandSlv(16) you changed the seed once. In your RandSlv(8) you updated the seed twice. Not only will these produce different results, but if you replaced the RandSlv(16) by two separate RandSlv(8) you change the state of the seed after the test completes - which in turn will impact what the entire test does.

OTOH, RandSlv(48) will do two randomizations to product a 48 bit number. However, this number need not be the same as two separate RandSlv(24). OTOH if the seed value was the same at the start of these operations, the final seed value after both of these have occurred will be the same.

At the end of the day, what pseudo random does guarantee, is that if you start with the same seed value and do the same sequence, you will get the same values - and hence, the same test.

from osvvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.