$显示在Verilog中,printf在C中显示

前端之家收集整理的这篇文章主要介绍了$显示在Verilog中,printf在C中显示前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
正如你所知,在Verilog中有$display,$strobe和$monitor用于在屏幕上显示文本.
而在C中也有printf在屏幕上显示文字.

我的问题是如何在C中使用printf中的其中一个($display,$strobe,$monitor)?

  1. a: $display
  2. b:$strobe
  3. c:$monitor
  4. d: all of them
  5. e: other

解决方法

  1. $display("<format>",exp1,exp2,...); // formatted write to display
  2. format indication %b %B binary
  3. %c %C character (low 8 bits)
  4. %d %D decimal %0d for minimum width field
  5. %e %E E format floating point %15.7E
  6. %f %F F format floating point %9.7F
  7. %g %G G general format floating point
  8. %h %H hexadecimal
  9. %l %L library binding information
  10. %m %M hierarchical name,no expression
  11. %o %O octal
  12. %s %S string,8 bits per character,2´h00 does not print
  13. %t %T simulation time,expression is $time
  14. %u %U unformatted two value data 0 and 1
  15. %v %V net signal strength
  16. %z %Z unformatted four value data 0,1,x,z
  17.  
  18. escape sequences,quoted characters in strings \n newline
  19. \t tab
  20. \\ backslash
  21. \" quote
  22. \ddd octal
  23. %% percent
  24.  
  25. any other characters between the quotes are displayed
  26. the expressions are taken in order of the format indication,in the expression list inserts one space in the output

猜你在找的C&C++相关文章