From 9d8d1aa41a6fceda5c5b501d9c031577572e145b Mon Sep 17 00:00:00 2001 From: Andrew Kay Date: Sun, 5 Jul 2020 16:59:45 -0500 Subject: [PATCH] Cleanup, maybe, state_counter --- interface2/rtl/coax_rx.v | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/interface2/rtl/coax_rx.v b/interface2/rtl/coax_rx.v index 9c144d5..db63605 100644 --- a/interface2/rtl/coax_rx.v +++ b/interface2/rtl/coax_rx.v @@ -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;