write(L, bitout(0)); -> cool but where yer two arguments?

Discussion in 'VHDL' started by matchstick86, Oct 20, 2009.

  1. matchstick86

    matchstick86

    Joined:
    Oct 2, 2009
    Messages:
    19
    So I generated some std_logic bits for bitout(i). I had something like
    Code:
    if b(i-1) > "0100" then
     bitout(i) <= '0';
    elsif b(i-1) < "0100" then
     bitout(i) <='1';
    elsif b(i-1) = "0100" then
     bitout(i) <='X';
    end if;
    
    PS: Please someone tell me I can just write something simpler for this, like
    Code:
    if b(i-1) > ....
    elsif b(i-1) < ....
    else ...
    
    Example is
    Code:
    use STD.textio.all;
    
    process
    file output : text open WRITE_MODE is "nice_file.txt";
    variable L : line;
    
    begin
    write(L, bitout(0));
    ...
    write(L, bitout(7));
    writeline(output, L);
    end;
    
    For write(L, bitout(0)) through to bitout(7) (for eg.), error message was "write expects 2 arguments". What 2 arguments are they asking for?
     
    matchstick86, Oct 20, 2009
    #1
    1. Advertising

  2. matchstick86

    matchstick86

    Joined:
    Oct 2, 2009
    Messages:
    19
    The solution:
    Code:
    library IEEE;
    use ieee.std_logic_arith;
    use std.textio.all;
    use ieee.std_logic_textio.all;
    
    good day good night
     
    matchstick86, Oct 22, 2009
    #2
    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. Alia Khouri
    Replies:
    0
    Views:
    299
    Alia Khouri
    Apr 26, 2009
  2. Dave Searles
    Replies:
    2
    Views:
    362
    Dave Searles
    Sep 20, 2009
  3. Tony Arcieri
    Replies:
    14
    Views:
    476
    Tony Arcieri
    Dec 9, 2010
  4. Diego Virasoro

    Newbie: two cool discoveries

    Diego Virasoro, Nov 26, 2010, in forum: Ruby
    Replies:
    7
    Views:
    98
    Arturo Garcia
    Nov 28, 2010
  5. Tony Arcieri
    Replies:
    0
    Views:
    420
    Tony Arcieri
    Dec 14, 2010
Loading...

Share This Page