Results 1 to 5 of 5

Thread: Assigning value to 7 bits output buffer?

  1. #1
    Join Date
    Jan 2017
    Posts
    4
    Rep Power
    1

    Default Assigning value to 7 bits output buffer?

    Hi,

    I'm doing a Moore FSM, and the outputs are 7 bits buffers (declared as such:
    sum: out STD_LOGIC_VECTOR(6 down to 0);
    )

    When writing the output logic, I wrote:

    when S2 => sum <= '0001010';

    but that gives me an error for each of these instances. What would be the correct syntax for what I'm trying to do?

    Thanks!
    Last edited by sbesozzi; February 9th, 2017 at 04:05 PM.

  2. #2
    Join Date
    May 2013
    Posts
    217
    Rep Power
    1

    Default Re: Assigning value to 7 bits output buffer?

    sum <= "0001010" WHEN S2 = '1';

    Any number that uses more than 1 bit requires double quotes. If that is supposed to be a hex number (not clear but guessing it's binary), you would add an x (x"0001010").

  3. #3
    Join Date
    Sep 2013
    Location
    London
    Posts
    1,326
    Rep Power
    1

    Default Re: Assigning value to 7 bits output buffer?

    you would add an x (x"0001010")
    Since 'sum' is a 7-bit value and x"0001010" represents a 28-bit value (which wouldn't work), stick with sstrel's first solution.

    Cheers,
    Alex
    Last edited by a_x_h_75; February 10th, 2017 at 12:17 AM.

  4. #4
    Tricky is offline Moderator **Forum Master**
    Join Date
    Oct 2008
    Posts
    5,473
    Rep Power
    1

    Default Re: Assigning value to 7 bits output buffer?

    ' is used for single characters
    " is used for strings

    You need to use "

  5. #5
    Join Date
    May 2013
    Posts
    217
    Rep Power
    1

    Default Re: Assigning value to 7 bits output buffer?

    Whoops, missed the 7-bit part! Yes, just "0001010".

Similar Threads

  1. Problem Assigning multibit output in SystemVerilog
    By cradleinflames in forum Quartus II and EDA Tools Discussion
    Replies: 1
    Last Post: August 6th, 2014, 10:12 AM
  2. Assigning individual bits
    By Essentia in forum Verilog and System Verilog
    Replies: 4
    Last Post: February 6th, 2013, 06:42 AM
  3. lpm_add_sub output bits - MSB or LSB?
    By imad01 in forum FPGA, Hardcopy, and CPLD Discussion
    Replies: 3
    Last Post: February 10th, 2011, 09:00 PM
  4. FFT with SGDMA...When output data is > 64 bits
    By Marlon Winder in forum General Software Forum
    Replies: 0
    Last Post: October 27th, 2010, 12:16 PM
  5. Bits to keep: output FIR
    By Fab_83 in forum FPGA, Hardcopy, and CPLD Discussion
    Replies: 4
    Last Post: July 11th, 2009, 11:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •