Writing null into file

Discussion in 'VHDL' started by Przemys³aw Elias, Jul 6, 2010.

  1. Hi,

    Is it possible to put a ASCII 0 character, which is NULL.
    I'm trying to use it in a testbench with a write(line,
    character'val(0)); function from std.textio library, but it simply
    doesn't work this way.
    Any ideas?
     
    Przemys³aw Elias, Jul 6, 2010
    #1
    1. Advertising

  2. Przemys?aw Elias wrote:
    > Hi,
    >
    > Is it possible to put a ASCII 0 character, which is NULL.
    > I'm trying to use it in a testbench with a write(line,
    > character'val(0)); function from std.textio library, but it simply
    > doesn't work this way.
    > Any ideas?


    Maybe

    constant newline_c : string := (1 => NUL);


    -- Mike Treseler
     
    Mike Treseler, Jul 7, 2010
    #2
    1. Advertising

  3. Mike Treseler wrote:

    > constant newline_c : string := (1 => NUL);



    If that works, you might want to change the name to null_c ;)

    -- Mike Treseler
     
    Mike Treseler, Jul 7, 2010
    #3
  4. Przemys³aw Elias

    KJ Guest

    On Jul 6, 4:51 pm, Przemys³aw Elias <> wrote:
    > Hi,
    >
    > Is it possible to put a ASCII 0 character, which is NULL.


    You're confused, ASCII 0 character is exactly that, the ASCII
    character '0'...which is a byte that has the decimal value of 48, hex
    value of 0x30.

    > I'm trying to use it in a testbench with a write(line,
    > character'val(0)); function from std.textio library, but it simply
    > doesn't work this way.
    > Any ideas?


    Whether writing the ASCII character '0' or the NUL character, works
    for me using std.textio functions.

    Kevin Jennings
     
    KJ, Jul 8, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HNguyen
    Replies:
    4
    Views:
    2,437
    HNguyen
    Dec 21, 2004
  2. Replies:
    5
    Views:
    27,264
    Mike Schilling
    Mar 29, 2006
  3. ssylee
    Replies:
    4
    Views:
    516
    CBFalconer
    Aug 12, 2008
  4. jason
    Replies:
    13
    Views:
    927
    John B. Matthews
    May 14, 2010
  5. Denhua
    Replies:
    3
    Views:
    241
    Denhua
    Jan 13, 2012
Loading...

Share This Page