第一范文网 - 专业文章范例文档资料分享平台

资料:数电第五次实验

来源:用户分享 时间:2025/10/23 14:46:37 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

module demo1( input[7:0]x, input clk, input clr, output reg[6:0]atog, output reg[3:0]an ); wire[1:0]s; reg[3:0]digit; reg[19:0]clkdiv; assign s=clkdiv[19:18]; always@(*) case(s) 0:digit=x[7:4]; 1:digit=x[3:0]; 2:digit=0; 3:digit=0; default:digit=x[7:4]; endcase always@(*) case(digit) 0:atog=7'b0000001; 1:atog=7'b1001111; 2:atog=7'b0010010; 3:atog=7'b0000110; 4:atog=7'b1001100; 5:atog=7'b0100100; 6:atog=7'b0100000; 7:atog=7'b0001111; 8:atog=7'b0000000; 9:atog=7'b0000100; 'hA:atog=7'b0001000; 'hB:atog=7'b1100000; 'hC:atog=7'b0110001; 'hD:atog=7'b1000010; 'hE:atog=7'b0110000; 'hF:atog=7'b0111000; default:atog=7'b0000001; endcase always@(*) begin an=4'b1111; an[s]=0; end

模板资料

资源共享

always@(posedge clk or posedge clr) begin if(clr==1) clkdiv<=0; else clkdiv<=clkdiv+1; end endmodule

NET\NET\NET\NET\NET\NET\NET\NET\NET\NET\NET\NET\NET\NET\ NET\ NET\ NET\ NET\ NET\ NET\ NET\

module demo1( input[7:0]x, input clk, input clr, output reg[6:0]atog, output reg[3:0]an ); wire[1:0]s; reg[3:0]digit; reg[19:0]clkdiv; assign s=clkdiv[19:18]; always@(*)

模板资料 资源共享

case(s) 0:if(x[3:0]>=4'b1010) digit=x[3:0]-4'b1010; else digit=x[3:0]; 1:if(x[3:0]>=4'b1010) digit=4'b0001; else digit=4'b0000; 2:if(x[7:4]>=4'b1010) digit=x[7:4]-4'b1010; else digit=x[7:4]; 3:if(x[7:4]>=4'b1010) digit=4'b0001; else digit=4'b0000; default:digit=4'b0000; endcase always@(*) case(digit) 0:atog=7'b0000001; 1:atog=7'b1001111; 2:atog=7'b0010010; 3:atog=7'b0000110; 4:atog=7'b1001100; 5:atog=7'b0100100; 6:atog=7'b0100000; 7:atog=7'b0001111; 8:atog=7'b0000000; 9:atog=7'b0000100; 'hA:atog=7'b0001000; 'hB:atog=7'b1100000; 'hC:atog=7'b0110001; 'hD:atog=7'b1000010; 'hE:atog=7'b0110000; 'hF:atog=7'b0111000; default:atog=7'b0000001; endcase always@(*) begin an=4'b1111; an[s]=0; end

模板资料

资源共享

搜索更多关于: 资料:数电第五次实验 的文档
资料:数电第五次实验.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c66qxn9m5g73pit886asl2xn8u9whjn0047o_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top