You are an expert Verilog hardware designer working on a complete FPGA or ASIC project. You are given the full source code of a Verilog project. One of the modules in the project is incomplete — its implementation is missing and marked with:

// >>> Module Implementation Begin

// <<< Module Implementation End

Your task is to complete the missing implementation so that the entire project functions correctly. You must infer what the missing module or logic is supposed to do by analyzing the rest of the codebase: module names, signal connections, instantiations, comments, and usage patterns.

Follow these rules:

1. Only generate Verilog code to go between the `// >>> Module Implementation Begin` and `// <<< Module Implementation End` comments.
2. Use Verilog-2001 syntax. Ensure the code is synthesizable.
3. Assume the goal is a working, integrated hardware design — your code must make the whole system function as intended.
4. Analyze the naming, I/O ports, and how the module is instantiated or used in other parts of the project.
5. Implement correct behavior based on design context. Do not guess randomly — reason it out.
6. Avoid vendor-specific features unless explicitly required.
7. Do not output comments, explanation, or anything outside the required code region unless explicitly asked.

Your output should contain **only the Verilog code** that fits inside the marked region.

/*
 * Copyright (c) 2024 Your Name
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module tt_um_tc503_countdown_timer (
    input  wire [7:0] ui_in,    // Dedicated inputs
    output wire [7:0] uo_out,   // Dedicated outputs
    input  wire [7:0] uio_in,   // IOs: Input path
    output wire [7:0] uio_out,  // IOs: Output path
    output wire [7:0] uio_oe,   // IOs: Enable path (active high: 0=input, 1=output)
    input  wire       ena,      // always 1 when the design is powered, so you can ignore it
    input  wire       clk,      // clock
    input  wire       rst_n     // reset_n - low to reset
);

  wire rst = ! rst_n;
  assign uio_oe = 8'b0000_0111;
  assign uio_out[7:3] = 5'b0_0000;

  countdown_timer countdown_timer (
    .clk(clk),
    .reset(rst),
    .countdown0(ui_in[7]),
    .enc0_a(ui_in[0]),
    .enc0_b(ui_in[1]),
    .enc1_a(ui_in[2]),
    .enc1_b(ui_in[3]),
    .enc2_a(ui_in[4]),
    .enc2_b(ui_in[5]),
    .pwm0_out(uio_out[0]),
    .pwm1_out(uio_out[1]),
    .pwm2_out(uio_out[2]),
    .dis0_out(uo_out[6:0]),
    .dis0_ctrl(uo_out[7])
  );


  // List all unused inputs to prevent warnings
  wire _unused = &{ena, clk, rst_n, 1'b0};

endmodule


`default_nettype none
`timescale 1ns/1ns
module countdown_timer (
    input clk,
    input reset,
    input countdown0,
    input enc0_a,
    input enc0_b,
    input enc1_a,
    input enc1_b,
    input enc2_a,
    input enc2_b,
    output pwm0_out,
    output pwm1_out,
    output pwm2_out,
    output reg [6:0] dis0_out,
    output dis0_ctrl
);
// >>> Module Implementation Begin

// <<< Module Implementation End
endmodule




`default_nettype none
`timescale 1ns/1ns
module debounce #(
    parameter HIST_LEN = 8
)(
    input wire clk,
    input wire reset,
    input wire button,
    output reg debounced
);
    localparam on_value = 2 ** HIST_LEN - 1;
    reg [HIST_LEN-1:0] button_hist;

    always @(posedge clk) begin
        if(reset) begin

            button_hist <= 0;
            debounced <= 1'b0;

        end else begin

            button_hist <= {button_hist[HIST_LEN-2:0], button};

            if(button_hist == on_value)
                debounced <= 1'b1;

            else if(button_hist == {HIST_LEN{1'b0}})
                debounced <= 1'b0;
       end
    end

endmodule


`default_nettype none
`timescale 1ns/1ns
module encoder #(
    parameter WIDTH = 8,
    parameter INCREMENT = 1'b1
)(
    input clk,
    input reset,
    input a,
    input b,
    output reg [WIDTH-1:0] value
);

    reg old_a;
    reg old_b;

    always @(posedge clk) begin
        if(reset) begin

            old_a <= 0;
            old_b <= 0;
            value <= 0;

        end else begin

            // last values
            old_a <= a;
            old_b <= b;

            // state machine
            case ({a,old_a,b,old_b})

                4'b1000: value <= value + INCREMENT;
                4'b0111: value <= value + INCREMENT;

                4'b0010: value <= value - INCREMENT;
                4'b1101: value <= value - INCREMENT;

                default: value <= value;
            endcase
        end
    end

endmodule


`default_nettype none
`timescale 1ns/1ns
module pwm #(
    parameter WIDTH = 8,
    parameter INVERT = 0
    ) (
    input wire clk,
    input wire reset,
    output reg out,
    input wire [WIDTH-1:0] level
    );

    reg [WIDTH-1:0] count;
    wire pwm_on = count < level;

    always @(posedge clk) begin
        if(reset)
            count <= 1'b0;
        else
            count <= count + 1'b1;
    end

    always @(posedge clk) begin
	if(reset)
	    out <= 0;
        else
    	    out <= INVERT == 1'b0 ? pwm_on : ! pwm_on;
    end

endmodule


`default_nettype none
`timescale 1ns/1ps
module seven_segment (
    input wire          clk,
    input wire          reset,
    input wire          load,
    input wire [3:0]    ten_count,
    input wire [3:0]    unit_count,
    output reg [6:0]    segments,
    output reg          digit
);

  reg [3:0] ten_count_reg;
  reg [3:0] unit_count_reg;
  wire [3:0] decode;

  always @(posedge clk) begin
    if (reset) begin
	ten_count_reg <= 0;
	unit_count_reg <=0;
	digit <=0;
    end else
	digit <= !digit;

    if (load) begin
	ten_count_reg <= ten_count;
	unit_count_reg <= unit_count;
    end
  end

  assign decode = digit ? ten_count_reg : unit_count_reg;

  always @(*) begin
	case(decode)
	  //		   7654321
	  0: segments = 7'b0111111;
	  1: segments = 7'b0000110;
	  2: segments = 7'b1011011;
	  3: segments = 7'b1001111;
	  4: segments = 7'b1100110;
	  5: segments = 7'b1101101;
	  6: segments = 7'b1111100;
	  7: segments = 7'b0000111;
	  8: segments = 7'b1111111;
	  9: segments = 7'b1100111;
	  default:
	     segments = 7'b0000000;
         endcase
  end
endmodule


`default_nettype none
`timescale 1ns/1ps
module clock_divider (
    input clk,
    input reset,
    output reg min_tick 
);
    // Adjust max_count for a 1-minute period based on your system clock frequency
//    localparam MAX_COUNT = 960000000; // (clock_frequency * 60) - 1 
//    localparam BITS = 30; 
//    reg [BITS-1:0] counter; // BITS depends on MAX_COUNT
    reg [30-1:0] counter; // BITS depends on MAX_COUNT

    always @(posedge clk or posedge reset) begin
        if (reset) begin
            counter <= 0;
            min_tick <= 0;
        end else if (counter == 960000000) begin
            counter <= 0;
            min_tick <= 1'b1;
        end else begin
            counter <= counter + 1;
            min_tick <= 1'b0;
        end
    end
endmodule


Reference solution:
rtl/generated.v:     wire enc0_a_db, enc0_b_db;
    wire enc1_a_db, enc1_b_db;
    wire enc2_a_db, enc2_b_db;
    wire min_chk0;
    wire [7:0] enc0, enc1, enc2;
    reg [7:0] enc0_C, enc1_C, enc2_C;
    reg [3:0] enc0_H, enc0_L;
/***
    always @(*) begin
        enc0_H <= enc0[7:4];
	enc0_L <= enc0[3:0];
    end
***/
    always @(posedge clk) begin
	if (reset) begin
	    enc0_C <= 0;
	    enc1_C <= 0;
	    enc2_C <= 0;
	    enc0_H <= 0;
	    enc0_L <= 0;
        end else if (countdown0 == 1'b1) begin
	    if (min_chk0) begin
	        enc0_C <= enc0_C - 1;
	        enc0_H <= enc0_C[7:4];
	        enc0_L <= enc0_C[3:0];
	    end
	end else begin
	    enc0_C <= enc0;
	    enc0_H <= enc0[7:4];
	    enc0_L <= enc0[3:0];
	end
    end

    // debouncers, 2 for each encoder
    debounce #(.HIST_LEN(8)) debounce0_a(.clk(clk), .reset(reset), .button(enc0_a), .debounced(enc0_a_db));
    debounce #(.HIST_LEN(8)) debounce0_b(.clk(clk), .reset(reset), .button(enc0_b), .debounced(enc0_b_db));
    debounce #(.HIST_LEN(8)) debounce1_a(.clk(clk), .reset(reset), .button(enc1_a), .debounced(enc1_a_db));
    debounce #(.HIST_LEN(8)) debounce1_b(.clk(clk), .reset(reset), .button(enc1_b), .debounced(enc1_b_db));

    debounce #(.HIST_LEN(8)) debounce2_a(.clk(clk), .reset(reset), .button(enc2_a), .debounced(enc2_a_db));
    debounce #(.HIST_LEN(8)) debounce2_b(.clk(clk), .reset(reset), .button(enc2_b), .debounced(enc2_b_db));

    // encoders
    encoder #(.WIDTH(8)) encoder0(.clk(clk), .reset(reset), .a(enc0_a_db), .b(enc0_b_db), .value(enc0));
    encoder #(.WIDTH(8)) encoder1(.clk(clk), .reset(reset), .a(enc1_a_db), .b(enc1_b_db), .value(enc1));
    encoder #(.WIDTH(8)) encoder2(.clk(clk), .reset(reset), .a(enc2_a_db), .b(enc2_b_db), .value(enc2));

    // pwm modules
    pwm #(.WIDTH(8)) pwm0(.clk(clk), .reset(reset), .out(pwm0_out), .level(enc0));
    pwm #(.WIDTH(8)) pwm1(.clk(clk), .reset(reset), .out(pwm1_out), .level(enc1));
    pwm #(.WIDTH(8)) pwm2(.clk(clk), .reset(reset), .out(pwm2_out), .level(enc2));

    // seven segment modules
    seven_segment seven_segment0(.clk(clk), .reset(reset), .load(1'b1), .ten_count(enc0_H), .unit_count(enc0_L), .segments(dis0_out), .digit(dis0_ctrl));    

    // clock divider modules
    clock_divider clock_divider0(.clk(clk), .reset(countdown0), .min_tick(min_chk0));