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 8523191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:20:17+00:00 2026-06-11T07:20:17+00:00

Say I have an entity: entity myblock is port( input1 : std_logic_vector(15 downto 0);

  • 0

Say I have an entity:

entity myblock is
    port(
        input1 : std_logic_vector(15 downto 0);
        input2 : std_logic_vector(15 downto 0);
        input3 : std_logic_vector(15 downto 0);
        -- ...
        output : std_logic_vector(15 downto 0);
    );
end myblock;

I now want to make the size of the inputs generic, so I might do:

entity myblock is
    generic(
        WIDTH : natural;
    );
    port(
        input1 : std_logic_vector(WIDTH-1 downto 0);
        input2 : std_logic_vector(WIDTH-1 downto 0);
        input3 : std_logic_vector(WIDTH-1 downto 0);
        -- ...
        output : std_logic_vector(WIDTH-1 downto 0);
    );
end myblock;

Ideally I’d like to simplify this a bit and have, say:

subtype calc_data is std_logic_vector(WIDTH-1 downto 0);
port(
    input1 : calc_data;
    input2 : calc_data;
    input3 : calc_data;
    -- ...
    output : calc_data;
);

In this case it’s a very simple example, and the benefit is not huge. In more complex cases, though, it would really help.

Is this possible in VHDL?

  • 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-06-11T07:20:19+00:00Added an answer on June 11, 2026 at 7:20 am

    You can name more than one port using a single type specification:

    entity myblock is
        generic(
            WIDTH : natural;
        );
        port(
            input1, input2, input3 : in std_logic_vector(WIDTH-1 downto 0);
            -- ...
            output : out std_logic_vector(WIDTH-1 downto 0);
        );
    end myblock;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have an entity that has attributes att1 and att2, where att1
Let's say I have this entity (for Hibernate): @Entity public class Person { @Id
Say I have an parent entity, each of which have a number of children.
Lets say thay I have an entity with name A.It has two columns named
Let's say I have the typical entity Car class Car : Entity { public
Let's say I have an Account entity, and an AccountData entity (which stores some
Say you have a one to one relationship in your entity model. The code
I have a question about how Hibernate persists entity relations. Let's say I have
I have a question regarding foreign key in entity framework(EF4). Lets say i have
Say, I have following entities: @Entity public class A { @Id @GeneratedValue private Long

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.