전자공학/디지털회로17 [Verilog] 125MHz -> 1KHz 분주기 zybo z7-20이 125MHz 이므로 1KHz 분주기를 설계했다. 코드 `timescale 1ns / 1ps module pre_1khz( inputi_clk,// xdc's sysclk inputrst, output rego_clk ); reg [15:0] counter62500; // 2^16 = 65536 always @(posedge rst, posedge i_clk) begin if(rst) begin counter62500 2022. 12. 29. [Verilog] 1/1000 prescaler 분주(Prescaler) 클럭을 줄이는 것 카운터를 이용해서 설계함 아래 필기에 설명 `timescale 1ns/1ps module pre1000( inputi_clk, inputn_rst, output rego_clk ); reg [8:0] counter500; always @(negedge n_rst, posedge i_clk) begin if(!n_rst) begin counter500 2022. 12. 27. [Verilog] Counter 0~99 까지 count를 하는 회로이다. 2개가 존재하는데 1개는 99에서 멈추고 다른 1개는 다시 0으로 초기화가 된다. HW이므로 Parallel 하게 실행된다. `timescale 1ns/1ps module counter( inputclk, inputreset_n, output[6:0]o_cnt, output[6:0]o_cnt_always ); // 100에서 멈추는 counter reg [6:0] cnt100; assign o_cnt = cnt100; always @(negedge reset_n, posedge clk) begin if(!reset_n) cnt100 99 -> 0 reg [6:0] cnt; assign o_cnt_always = cnt; always @(negedge reset_.. 2022. 12. 26. [Verilog] Gate-Level에서 D Latch & D Flip-Flop D Latch CLK = 0 : Q(t+1) = D CLK = 1 : Q(t+1) = Q(t) 2022. 12. 25. 이전 1 2 3 4 5 다음