vGoodtimes
Advanced Member level 4
hobbyiclearner;1523046r said:3. In the 'send' state of the, why has been busy assigned '1' before the first if statement. Since the controller has to wait for atleast in the send state for 50 usec before going back to ready state, in the first if statement, the busy port has been already assigned logic 1.
The code has many extra assignments that are not needed. The important assignments to "busy" are the ones that occur when state is assigned to a different value. These are the transitions of the state machines.
My guess is that the author wanted to have the simplicity of placing the assignments in state cases, but then realized that he needed them on the transitions between states. This wasn't done in all places -- for example busy will be '1' on the first cycle of ready. There are a few other small issues like that. For example clk_count doesn't reset with reset_n, so reset_n can only be a power-on-reset.