Hi everyone,
I am very new to HDL and have a question about reg data type nitialization in the serial interface project code.
When I tested RS-232 receiver code, I found that regs like Baud8GeneratorAcc and RxD_cnt_inv are always in an unknown state (xxxx for example).
I found the reason is that they were never initialized to a value before they were incremented in a expression like reg = reg + a_value. After I initialized the regs to 0, the code worked correctly.
My questions is that does the code run correctly (without the initializations) in anybody else's simulator, and maybe with a different setting? Also, is it good style to explicitly initialize a reg to a value after declaration?
thanks,