Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6529069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:35:41+00:00 2026-05-25T09:35:41+00:00

Suppose you have a loop for i in 1 downto 0 loop for j

  • 0

Suppose you have a loop

for i in 1 downto 0 loop
    for j in 1 downto 0 loop
        tS0 <= i;

But I need to convert the integer (which is natural) to std_logic. tS0 is declared as std_logic. I am only doing it one bit (0 or 1). That is, my i and j can only represent the value {0,1}.

I think I am heading to the wrong approach here. Can someone please tell me what should I do instead?

I don’t think std_logic has to_unsigned method. i tried letting tS0 to be a vector (1 down to 0), and assigned like tS0(0) <= i, and etc. But it still didn’t work out.

Thank you very much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:35:41+00:00Added an answer on May 25, 2026 at 9:35 am

    You will need to use a vector, either unsigned or std_logic, but it can be one bit long. ie:

    signal tS0 : unsigned (0 downto 0);
    ...
    tS0 <= to_unsigned(i, tS0'length);
    

    …or…

    signal tS0: std_logic_vector(0 downto 0);
    ...
    tS0 <= std_logic_vector(to_unsigned(i,tS0'length);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a loop which is going to convert an ArrayList with 10
Suppose you have an array of 1000 random integer numbers and you need to
Suppose you have the following function foo . When I'm running a for loop,
Suppose I have a vector<int> myvec and I want to loop through all of
Suppose, I have a if statement inside a for loop: for( ; ; )
Suppose we have a loop that runs for 100 times. Does using unsigned char
Suppose I have an array age=[16 17 25 18 32 89 43 55] which
Suppose I have a composite class PharmaProduct (which represents the product hierarchy of a
Suppose I have a myTest.sql scripts, which contains thousands of create table blahblah statements.
Suppose I have a Byte array and I use Encoding.ASCII.GetString() to convert the bytes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.