Home ] Up ] Example Count-ones ] [ Example Shiftregister ]
Example Shiftregister

Up ]

Return to DIG #9


The pitfall of variables

 

 

Last updated: 11-08-09

Pedroni Example 7.8 and 7.9 illustrates the same topics.

The order of signals inside a process doesn't matter
 

(At least not in this example.)

 
   
 
   
 

No matter the order of assignments (<=) inside a process will the result be the same. Signals only gets values after the process ended and hence will both SigTest1 and SigTest2 result in (2-bit) shift-registers.

The same is true for the VarTest1 example below, whereas the VarTest2 will produce a 2-bit BUS due to the fact that a variable gets its value immediately after the assignment (:=)

The order of variables inside a process does matter