HDL 发表于 2023-11-28 20:30:29

Quartus Verilog HDL/FPGA 无需reg寄存器(使用latch锁存器)实现将50Mhz二分频为25Mhz


module latch_reg(                //latch型reg寄存器
        input D,                //锁存输入
        input CLK,        //上升沿将D打入Q
        output Q                //锁存输出
);

wire P = CLK ? P : D;
assign Q = CLK ? P : Q;
endmodule

module main(
        input clk,                //50Mhz Pin17
        output out                //二分频输出(25Mhz) Pin40
);

latch_reg reg1(
        .D(!out),
        .CLK(clk),
        .Q(out)
);

endmodule

页: [1]
查看完整版本: Quartus Verilog HDL/FPGA 无需reg寄存器(使用latch锁存器)实现将50Mhz二分频为25Mhz