FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-22-2009, 10:18 PM
Amal
Guest
 
Posts: n/a
Default $display and zero padding...

In Verilog or SystemVerilog, is it possible to do zero padding when
displaying an integer as in C/C++? Something equivalent to:

printf( "%05d", x );

Also is it possible to display in upper-case hex characters instead?

printf( "%X", h );

-- Amal
Reply With Quote
  #2 (permalink)  
Old 06-22-2009, 11:05 PM
sharp@cadence.com
Guest
 
Posts: n/a
Default Re: $display and zero padding...

On Jun 22, 5:18*pm, Amal <akhailt...@gmail.com> wrote:
> In Verilog or SystemVerilog, is it possible to do zero padding when
> displaying an integer as in C/C++? *Something equivalent to:
>
> * printf( "%05d", x );


No, not by the 2005 IEEE standards. The 2009 draft standard currently
in balloting allows a width field in the format.

> Also is it possible to display in upper-case hex characters instead?
>
> * printf( "%X", h );


You get whatever case your implementation gives you. The standard
does not specify a case, and makes no distinction between %h and %H
(%x is nonstandard).

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
zero padding once again fisico30 DSP 21 04-23-2009 09:09 AM
zero padding of FFT bharat pathak DSP 29 02-20-2008 04:49 AM
zero padding jimosoto DSP 1 02-25-2007 07:27 AM
zero padding in matlab rakesh5454 DSP 2 06-26-2006 11:42 AM
Zero Padding a DFT quick one DSP 5 02-02-2005 04:34 PM


All times are GMT +1. The time now is 07:29 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved