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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:35:47+00:00 2026-06-17T04:35:47+00:00

I am having trouble in building a chain of modules. I can connect models

  • 0

I am having trouble in building a chain of modules. I can connect models manually listing all the modules but need more concise representation. The following code has been tried but doesn’t work? How can I correct the codes?

module network(
    input signed [31:0] xi,
    output signed [31:0] yo,
    input clk,
    input reset
    );

    wire signed [31:0] x0, x1, x2, y0, y1, y2, xo;
    wire [3:1] t;
    //working code for chain of pe
//   pe u0(xi, x0, 0, y0, clk, reset);  
//   pe u1(x0, x1, y0, y1, clk, reset);
//   pe u2(x1, x2, y1, y2, clk, reset);
//   pe u3(x2, xo, y2, yo, clk, reset);
    //chain of array not working! how!
    pe p[1:4] ((xi,t), (t, x), (0, t), (t,yo),clk,reset); <- want to improve
endmodule

Here, pe (input,output,input,output,clk,reset).

  • 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-17T04:35:49+00:00Added an answer on June 17, 2026 at 4:35 am

    Try this. It should work in all version of Verilog. In this instance the parameter PE_NUM must be an int with a value of 2 or more. A generate block must be use if a 1 pe instance is desired, which requires Verilog-2001 or SystemVerilog. Some simulators may have an hit a memory limitation when PE_NUM gets big (ex 2**16).

    /*All Verilog*/
    module network(
            input signed [31:0] xi,
            output signed [31:0] yo,
            input clk,
            input reset
            );
        parameter PE_NUM = 4; // limitation PE_NUM must be greater then 1
        wire signed [31:0] xo;
        wire signed [0:PE_NUM-2] [31:0] xN;
        wire signed [0:PE_NUM-2] [31:0] yN;
        pe p[0:PE_NUM-1] ({xi,xN}, {xN,xo}, {32'b0,yN}, {yN,yo}, clk,reset);
    endmodule
    

    The following is an example with generate:

    /*Verilog-2001 or SystemVerilog*/
    module network(
            input signed [31:0] xi,
            output signed [31:0] yo,
            input clk,
            input reset
            );
        parameter PE_NUM = 4; // no limitation
        wire signed [31:0] xo;
        generate
            if(PE_NUM <2) begin
                pe p (xi, xo, 32'b0, yo, clk,reset);
            end
            else begin
                wire signed [0:PE_NUM-2] [31:0] xN;
                wire signed [0:PE_NUM-2] [31:0] yN;
                pe p[0:PE_NUM-1] ({xi,xN}, {xN,xo}, {32'b0,yN}, {yN,yo}, clk,reset);
            end
        endgenerate
    endmodule
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble building a query. I can do what I want in 3
I am having some trouble building the query I need to return the AccountID
I'm building a processing pipeline with NServiceBus but I'm having trouble with the configuration
I am building a comics website, but am having trouble aligning the images the
I'm having trouble building gdlib. As far as I can tell, zlib, png and
I'm having trouble building hiphop under Backtrack 5. I have installed all the essentials
I am having trouble understanding how I can effectively and efficiently building a mocking
I'm building a website using Zend Framework and having trouble implementing modules and custom
I'm building a PHP CMS, but having trouble with variables. I want to be
I'm having trouble building a restful service with Lift. All I want to do

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.