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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:51:59+00:00 2026-06-04T12:51:59+00:00

I have two modules counter: Output is a vector called error_count. lcd: Module to

  • 0

I have two modules

  1. counter: Output is a vector called error_count.
  2. lcd: Module to display the code on an LCD. Input includes clock and error_count.

Following snippet of the code is most relevant and attached below:

  1. Top level module:

    counter counter1 (..., error_count);
    lcd lcd1 (..., error_count);
  2. counter module:

    module counter (..., error_count);
    ...
    output reg [31:0] error_count = 0;
    ... //Update counter every clock cycle
    endmodule
    
  3. lcd module:

    module lcd (..., error_count);
    ...
    input [31:0] error_count;
    ... //error_count used to display on LCD
    endmodule
    

What is wrong with this code? The display just prints 0 as the output. Is there anything wrong with the way I am passing the the vector?

Additional Info:
I am using the Xilinx Spartan 3E starter kit for testing this code. The LCD code is fine and I have tested it with local counter (which was reg[31:0]).

  • 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-04T12:52:00+00:00Added an answer on June 4, 2026 at 12:52 pm

    You need to declare 32-bit wire within the top-level module to connect the two ports.

    wire [31:0] error_count;

    If you leave this out, an implicit net is declared which is only a 1-bit wire and will not connect the vectors properly.

    This mistake is a classic Verilog gotcha. The presentation here has a good explanation of this one and others:

    http://www.sutherland-hdl.com/papers/2006-SNUG-Boston_standard_gotchas_presentation.pdf

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my code base I find that two modules have structures with the same
I have added two modules in my drupal site called.... 1. me alias 2.
Consider this scenario: I have a project with two modules and one common module
I have two modules, default and mojo. After the initial bootstraping code which is
Basically I have written two modules for my Python Program. I need one module
Lets say I have two modules. Is it possible to include a module inside
suppose you have two modules like module Foo.A where foo = 42 and module
I have found two modules that save their module specific settings without using sql
I have defined two module types and two modules module type FOO = sig
I have two modules, one is a Header module, one is a Items module.

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.