Verilog - Race Conditions

Race Conditions

The order of execution isn't always guaranteed within Verilog. This can best be illustrated by a classic example. Consider the code snippet below:

initial a = 0; initial b = a; initial begin #1; $display("Value a=%b Value of b=%b",a,b); end

What will be printed out for the values of a and b? Depending on the order of execution of the initial blocks, it could be zero and zero, or alternately zero and some other arbitrary uninitialized value. The $display statement will always execute after both assignment blocks have completed, due to the #1 delay.

Read more about this topic:  Verilog

Famous quotes containing the words race and/or conditions:

    “The parallel between antifeminism and race prejudice is striking. The same underlying motives appear to be at work, namely fear, jealousy, feelings of insecurity, fear of economic competition, guilt feelings, and the like. Many of the leaders of the feminist movement in the nineteenth-century United States clearly understood the similarity of the motives at work in antifeminism and race discrimination and associated themselves with the anti slavery movement.”
    —Ashley Montagu (b. 1905)

    “For it is not possible to join serpentine wisdom with columbine innocency, except men know exactly all the conditions of the serpent: his baseness and going upon his belly, his volubility and lubricity, his envy and sting, and the rest; that is, all forms and natures of evil: for without this, virtue lieth open and unfenced.”
    —Francis Bacon (1561–1626)