完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想ISE设计一个数字钟,但是出现了Xst:871 - "topclock.v" line 33: Invalid use of input signal
module topclock( input CP, input nCR, input EN, input Adj_Hour, input Adj_Min, output [7:0] Hour, output [7:0] Minute, output [7:0] Second ); supply1 Vdd; wire SecH_EN,MinL_EN,MinH_EN,Hour_EN; counter10 U1(Second[3:0],CP,nCR,EN); counter6 U2(Second[7:4],CP,nCR,SecH_EN); assign MinL_EN=Adj_Min? Vdd:(Second==8'h59); assign MinH_EN=(Adj_Min&&(Minute[3:0]==4'h9))||(Minute[3:0]==4'h9)&&(Second==8'h59); counter10 U3(Minute[3:0],CP,nCR,MinL_EN); counter6 U4(Minute[7:4],CP,MinH_EN); assign Hour_EN=Adj_Hour? Vdd:((Minute==8'h59)&&(Second==8'h59)); counter24 U5(Hour[7:4],Hour[3:0],CP,nCR,Hour_EN); endmodule module counter10( input CP, input nCR, input EN, output reg[3:0] Q ); always@(posedge CP,negedge nCR) begin if(~nCR) Q<=4'b0000; else if(~EN) Q<=Q; else if(Q==4'b1001) Q<=4'b0000; else Q<=Q+1'b1; end endmodule module counter6( input CP, input nCR, input EN, output reg[3:0] Q ); always@(posedge CP,negedge nCR) begin if(~nCR) Q<=4'b0000; else if(~EN) Q<=Q; else if(Q==4'b0101) Q<=4'b0000; else Q<=Q+1'b1; end endmodule module counter24( input CP, input nCR, input EN, output reg[3:0] CntH, output reg[3:0] CntL ); always@(posedge CP,negedge nCR) begin if(~nCR) {CntH,CntL}<=8'h00; else if(~EN) {CntH,CntL}<={CntH,CntL}; else if(((CntH>2)||(CntL>9))||((CntH==2)&&(CntL>=3))) {CntH,CntL}<=8'h00; else if((CntH==2)&&(CntL<3)) begin CntH<=CntH;CntL<=CntL+1'b1;end else if(CntL==9) begin CntH<=CntH+1'b1;CntL<=4'b0000;end else begin CntH<=CntH;CntL<=CntL+1'b1;end end endmodule |
|
相关推荐
1 个讨论
|
|
只有小组成员才能发言,加入小组>>
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-4 00:55 , Processed in 0.581446 second(s), Total 62, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号