Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************/
- /** 20141016 8-Bit Divider **/
- /** Maker : Yan **/
- /** E-Mail : [email protected] **/
- /** Date : 2014/10/16 pm.10:00 **/
- /************************************/
- module Divider_Mod8(Clk, Clr, _output);
- input Clk, Clr;
- output reg _output;
- reg [3:0] Q1;
- always@(posedge Clk or posedge Clr)
- begin
- if(Clr == 1)
- Q1 = 0;
- else
- if(Q1 == 7)
- Q1 = 0;
- else
- Q1 = Q1 + 1;
- end
- always@(posedge Clk or posedge Clr)
- begin
- if(Clr == 1)
- _output = 0;
- else
- if(Q1 < 4)
- _output = 1;
- else
- _output = 0;
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment