Verilog系统函数(一) $display

Verilog系统函数 $display

参考:FPGA篇(四)Verilog系统函数介绍($display,$fopen,$fscanf,$fwrite($fdisplay),$fclose,$random,$stop)

下面代码截自仿真文件部分:

		reg				flag;
//--------------------------------------------------------------------------------
//******************************	系统显示	$display	*******************************
	reg	[31:0] 	data_display;
 
	initial begin
			data_display	=	32'd100;
			flag 	= 	0;	
				$display("!!! Start	Simulation !!!");
			#10;
				//显示16进制  10进制
				$display("data_display = %h hex %d decimal", 100, 100);
				$display("data_display = %h hex %d decimal", data_display, data_display);
				
			#10;
				//显示8进制   2进制
				$display("data_display = %o otal %b binary", 100, 100);
				$display("data_display = %o otal %b binary", data_display, data_display);
			#10;
				//ASCII码
				$display("data_display has %c ascii character value",64);
			#10;
				//显示10进制  换行 2进制
				$display("data_display = %d otal next line \n %b binary", 100, 100);
			#10
			   //显示系统仿真时间
				$display("simulation time is %t",$time);
			flag 	= 	1;	
	end
	
	

运行结果:

    !!! Start    Simulation !!!
    data_display = 00000064 hex         100 decimal
    data_display = 00000064 hex        100 decimal
    data_display = 00000000144 otal 00000000000000000000000001100100 binary
    data_display has @ ascii character value
    data_display =         100 otal next line 
    00000000000000000000000001100100 binary
    simulation time is                50000

从flag可以看出,仿真时间为50ns,也就是50000ps,再次推断,运行结果显示为ps为单位。

 

 

 

 

 

 

 

  • 7
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李锐博恩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值