2014年5月24日 星期六

50MHZ 時鐘脈波除頻轉成1Hz標準脈波

源自於

http://www.worlduc.com/blog2012.aspx?bid=16544240



//div50MHZ.v
module div50MHZ(clk_50MHZ,clk_1HZ);
input clk_50MHZ;
output clk_1HZ;
reg  clk_1HZ;
reg   cnt=24999999;
always@(posedge clk_50MHZ)
   if(cnt==24999999)
       begin
           cnt<=0;
           clk_1HZ<=~clk_1HZ;
       end
   else
       cnt<=cnt+1'b1;
endmodule

沒有留言:

張貼留言

Wokwi ESP32 Simulator : ESP32 + NTP+MQTT+ Node-RED Dashboard

Wokwi ESP32 Simulator : ESP32 + NTP+MQTT+ Node-RED Dashboard  Wokwi ESP32程式 // Learn about the ESP32 WiFi simulation in // https://docs.wokw...