Verilog实现74LS194芯片设计程序.doc

上传人:白大夫 文档编号:3274797 上传时间:2019-08-07 格式:DOC 页数:5 大小:23KB
返回 下载 相关 举报
Verilog实现74LS194芯片设计程序.doc_第1页
第1页 / 共5页
亲,该文档总共5页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《Verilog实现74LS194芯片设计程序.doc》由会员分享,可在线阅读,更多相关《Verilog实现74LS194芯片设计程序.doc(5页珍藏版)》请在三一文库上搜索。

1、Verilog实现74LS194芯片设计程序Verilog介绍Verilog一般指Verilog HDL。Verilog HDL是一种硬件描述语言(HDL:Hardware DescripTIon Language),以文本形式来描述数字系统硬件的结构和行为的语言,用它可以表示逻辑电路图、逻辑表达式,还可以表示数字逻辑系统所完成的逻辑功能。 Verilog HDL和VHDL是世界上最流行的两种硬件描述语言,都是在20世纪80年代中期开发出来的。前者由Gateway Design AutomaTIon公司(该公司于1989年被Cadence公司收购)开发。两种HDL均为IEEE标准。Verilo

2、g特点1.能够在不同的抽象层次上,如系统级、行为级、RTL(Register Transfer Level)级、 门级和开关级,对设计系统进行精确而简练的描述;2.能够在每个抽象层次的描述上对设计进行仿真验证,及时发现可能存在的设计错误, 缩短设计周期,并保证整个设计过程的正确性;3.由于代码描述与具体工艺实现无关,便于设计标准化,提高设计的可重用性。如果 有C语言的编程经验,只需很短的时间内就能学会和掌握Verilog HDL,因此,Verilog HDL可以作为学习HDL设计方法的入门和基础。Verilog用途Verilog HDL就是在用途最广泛的C语言的基础上发展起来的一种硬件描述语言

3、,它是由GDA(Gateway Design AutomaTIon)公司的PhilMoorby在1983年末首创的,最初只设计了一个仿真与验证工具,之后又陆续开发了相关的故障模拟与时序分析工具。1985年Moorby推出它的第三个商用仿真器Verilog-XL,获得了巨大的成功,从而使得Verilog HDL迅速得到推广应用。1989年CADENCE公司收购了GDA公司,使得VerilogHDL成为了该公司的独家专利。1990年CADENCE公司公开发表了Verilog HDL,并成立LVI组织以促进Verilog HDL成为IEEE标准,即IEEE Standard 1364-1995.Ve

4、rilog实现74LS194芯片plain view plain copymodule reg_74LS194 (input wire CR_n,input wire CP,input wire S0,S1,input wire Dsl,Dsr,input wire D0,D1,D2,D3,output wire Q0,Q1,Q2,Q3);reg 0:3 q_reg=4b0000;wire 1:0 s_reg;assign s_reg=S1,S0;always (posedge CP or posedge CR_n) beginif (!CR_n) beginq_reg=4b0000;end

5、else begincase (s_reg)2b00 :q_reg=q_reg;2b01 :q_reg=Dsr,q_reg0:2;2b10 :q_reg=q_reg1:3,Dsl;2b11 :q_reg=D0,D1,D2,D3;default:q_reg=4b0000;endcaseendendassign Q0=q_reg0;assign Q1=q_reg1;assign Q2=q_reg2;assign Q3=q_reg3;endmoduleplain view plain copymodule reg_74LS194_tb ();reg clk;wire CR_n;reg1:0 S;re

6、g Dsl,Dsr;wire3:0 D;wire3:0 Q;wire 4:0 duty=2;wire 4:0 period=7;wire 4:0 duty1=3;wire 4:0 period1=4;reg 4:0 count=0;reg 4:0 count1=0;reg_74LS194 ut(.CR_n(CR_n),.CP(clk),.S0(S0),.S1(S1),.Dsl(Dsl),.Dsr(Dsr),.D0(D0),.D1(D1),.D2(D2),.D3(D3),.Q0(Q0),.Q1(Q1),.Q2(Q2),.Q3(Q3);always (posedge clk) beginif (c

7、ount=period-1) begincount=0;end else begincount=count+1;endendalways (posedge clk) beginif (countduty) beginDsl=1b0;Dsr=1b1;end else beginDsl=1b1;Dsr=1b0;endendalways (posedge clk) beginif (count1=period1-1) begincount1=0;end else begincount1=count1+1;endendalways (posedge clk) beginif (count1duty1) beginS0=1b0;S1=1b1;end else beginS1=1b0;S0=1b1;endendiniTIal beginclk=1b0;forever #50 clk=clk;endassign D=4b1111;initial begin#2000 $stop;endendmodule

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1