Register

NSL uses registers to hold data signals. Registers will hold on the rising edge of a clock signal (m_clock). We can refer and transfer value to registers but referenced value will be the data on last clock period.

Example-NS14

declare NS14 { input a,b; output f; } module NS14 { reg r; r := a & b; f = r; }



We will make a simulation on this circuitry as following command:

# ./exe NS14



The result will be available on your console.



a:0, b:0, r:x, f:x a:1, b:0, r:0, f:0 a:0, b:1, r:0, f:0 a:1, b:1, r:0, f:0 a:0, b:0, r:1, f:1 a:1, b:0, r:0, f:0 a:0, b:1, r:0, f:0 a:1, b:1, r:0, f:0 a:0, b:0, r:1, f:1



We can see the wave form of this simulation as:

# ./exe -wave NS14






PREV UP NEXT