题解 | #无占空比要去的奇数分频#

无占空比要去的奇数分频

https://www.nowcoder.com/practice/12d0615157a04e43bb7f41debc3cfa5b

`timescale 1ns/1ns

module odd_div (    
    input     wire rst ,
    input     wire clk_in,
    output    wire clk_out5
);
//*************code***********//

reg                 [2:0]               cnt;
always@(posedge clk_in or negedge rst)
    if(!rst)
        cnt <= 3'd0;
    else if(cnt >= 3'd4)
        cnt <= 3'd0;
    else
        cnt <= cnt + 1'b1;
assign clk_out5 = ((cnt==3'd1)||(cnt == 3'd2))? 1'b1:1'b0;
//*************code***********//
endmodule

全部评论

相关推荐

SHC2:春招先狠狠投递,然后你看看能不能申请香港新加坡的一年制master,花不了多少钱,或者现在赶紧去刷一段实习。HR专业考研没必要
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务