Cleanup, maybe, state_counter

This commit is contained in:
Andrew Kay
2020-07-05 16:59:45 -05:00
parent c155c23d5f
commit 9d8d1aa41a

View File

@@ -35,7 +35,6 @@ module coax_rx (
reg [3:0] next_state;
reg [3:0] previous_state;
reg [7:0] state_counter;
reg [7:0] next_state_counter;
reg previous_rx;
@@ -65,7 +64,6 @@ module coax_rx (
always @(*)
begin
next_state = state;
next_state_counter = state_counter + 1;
next_bit_timer_reset = 0;
@@ -295,13 +293,10 @@ module coax_rx (
always @(posedge clk)
begin
if (state != next_state)
state_counter <= 0;
else
state_counter <= next_state_counter;
state <= next_state;
state_counter <= (state == next_state) ? state_counter + 1 : 0;
bit_timer_reset <= next_bit_timer_reset;
data <= next_data;