当前位置: 首页> 汽车> 车展 > 农产品网络营销渠道_福彩hao123网址导航_高州网站seo_头条今日头条

农产品网络营销渠道_福彩hao123网址导航_高州网站seo_头条今日头条

时间:2025/7/11 22:45:08来源:https://blog.csdn.net/weixin_50965981/article/details/143492419 浏览次数: 0次
农产品网络营销渠道_福彩hao123网址导航_高州网站seo_头条今日头条

【【简单systyem verilog 语言学习使用一— adder加法器 】】

adder.v

module adder( input          [3 : 0]       a    ,input          [3 : 0]       b    ,output         [3 : 0]       sum  ,output                       carry  
); assign  {carry,sum } = a + b ;endmodule  

adder_tb.sv

class input1   ;rand bit [3 : 0]  a  ;constraint in_cons { a > 0 ; a < 15; }function void display() ;$write("rand number a is %4d", a) ;endfunctionendclassclass input2 ;rand bit [3 : 0]  b  ;constraint in_cons { b > 0 ; b < 15; }function void display() ;$write("rand number b is %4d", b) ;endfunctionendclassmodule   test  ;//对 类 进行例化input1  a_inst  ;input2  b_inst  ;logic [3 : 0]  a,b , sum ;logic  carry  ;adder u_adder(.a    ( a    ),.b    ( b    ),.sum  ( sum  ),.carry  ( carry  ));// 开始初始化initialbegina_inst = new();b_inst = new();assert (a_inst.randomize())  ;assert (b_inst.randomize())  ;a = a_inst.a  ;b = b_inst.b  ;a_inst.display() ;b_inst.display() ;#5$display("Sum=%4d,Carry=%1b", sum, carry);endendmodule
关键字:农产品网络营销渠道_福彩hao123网址导航_高州网站seo_头条今日头条

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: