完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
module vgaexp3(clk50m,rst_n,r,g,b,vs,hs);
output r,g,b,vs,hs; input clk50m,rst_n; reg [10:0]count_hs,count_vs; //reg vs,hs; wire clk40m; //-------------------------------------通过PLL输出 40MHz pll_sec pll_sec_inst ( .inclk0 ( clk50m ), .c0 ( clk40m ), ); //------------------------------------------ 产生 HS,VS always @(posedge clk40m or negedge rst_n) if(!rst_n) count_hs <= 11'd0; else if(count_hs == 11'd1056) count_hs <= 11'd0; else count_hs <= count_hs + 1'b1; always@(posedgeclk40m or negedge rst_n) if(!rst_n) count_vs <= 11'd0; else if(count_vs == 11'd628) count_vs <= 11'd0; else if(count_hs == 11'd1056)count_vs <= count_vs + 1'b1; /*always@(posedgeclk40m) begin if(count_hs <= 11'd128) hs <= 1'b0; else hs <= 1'b1; if(count_vs <= 11'd4) vs <= 1'b0; else vs <= 1'b1; end */ assign hs=(count_hs<=11'd128) ? 1'b0 : 1'b1; assign vs=(count_vs<=11'd4) ? 1'b0 : 1'b1; //----------------------------------------------------------有效区输出颜色 reg valid_r; always@(posedgeclk40m or negedge rst_n ) if(!rst_n) valid_r <= 1'b0; else if((count_hs>11'd216&&count_hs<11'd1017)&&(count_vs>11'd27&&count_vs<11'd627)) valid_r<=1'b1; else valid_r<=1'b0; assign r = valid_r?1:0; assign b = valid_r?1:0; assign g = valid_r?0:0; endmodule 这是源程序,根据原理来说没问题,为什么连到显示器上后显示没信号输入,为什么呢?求助。。。。 |
|
相关推荐
1个回答
|
|
程序没有问题的,是不是引脚没有分配对?检查核对下引脚在验证下
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1421 浏览 1 评论
1215 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
1426 浏览 0 评论
913 浏览 0 评论
2229 浏览 0 评论
1427 浏览 34 评论
5612 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 09:52 , Processed in 0.549205 second(s), Total 74, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号