see first here x should be declared as wire . so the value is should be calcualted at the 0ns simultion time and the valuue have to assign after 5ns .so X is net not register ,hence illegal statement
see first here x should be declared as wire . so the value is should be calcualted at the 0ns simultion time and the valuue have to assign after 5ns .so X is net not register ,hence illegal stateme
The reg data type holds a value until a new value is driven onto it in an initial or always block. The reg type can only be assigned a value in an always or initial block, and is used to apply stimulus to the inputs of the DUT. The wire type is a passive data type that holds a value driven on it by a port, assign statement or reg type. Wires can not be assigned values inside always and initial blocks.