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

  • Home
  • SEARCH
  • 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 8603291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:17:21+00:00 2026-06-12T02:17:21+00:00

I am trying to make a simple mux in verilog from a decoder with

  • 0

I am trying to make a simple mux in verilog from a decoder with an enable, but for some reason when I try to use the decoder within my mux with the enable locked to 1, I get an error.

module DECODER(out1, out2, out3, out4, A, B, enable);

  `define NOT not #50
  `define AND and #50

  input A, B, enable;
  output out1, out2, out3, out4;
  wire notA, notB, val1, val2, val3, val4;

  `NOT first (notA, A);
  `NOT second (notB, B);

  `AND firstEval(val1, notA, notB);
  `AND secondEval(val2, notA, B);
  `AND thirdEval(val3, A, notB);
  `AND fourthEval(val4, A,B);

  `AND firstOutput(out1, val1, enable);
  `AND secondOutput(out2, val2, enable);
  `AND thirdOutput(out3, val3, enable);
  `AND fourthOutput(out4, val4, enable);
endmodule

module MUX (out, A, B, C, D, select1, select2);
  `define AND and #50
  `define OR or #50

  output out;
  input A,B,C,D,select1,select2;
  wire selectA, selectB, selectC, selectD, firstOr, secondOr, andA, andB, andC, andD;

  DECODER decoderModule(selectA, selectB, selectC, selectD, select1, select2,TRUE);

  `AND checkA(andA, selectA, A);
  `AND checkB(andB, selectB, B);
  `AND checkC(andC, selectC, C);
  `AND checkD(andD, selectD, D);

  `OR firstStep(firstOr, andA, andB);
  `OR secondStep(secondOr, firstOr, andC);

  `OR throughPut(out, secondOr, selectD);

endmodule

module TEST;
  reg A,B,C,D, select1, select2;
  wire out;

  initial
  begin
    A = 1; B = 1; C = 1; D = 1; select1 = 0; select2 = 0;
    #300 A = 0;
    #300 A = 1;
    #300 select1 = 1;
    #300 B = 0;
    #300 B = 1;
    #300 select2 = 1;
    #300 D = 0;
    #300 D = 1;
    #300 select1 = 0;
    #300 C = 0;
    #300 C = 1;
  end

  MUX UUT(out, A,B,C,D,select1,select2);

  initial
    $monitor($time, ,out, , A,B,C,D,select1,select2);
endmodule

When I run the simulation I get the following error:

# ** Warning: (vsim-3015) C:/Modeltech_pe_edu_10.1c/win32pe_edu/Mux.v(9): [PCDPC] - Port size (1 or 1) does not match connection size (32) for port 'enable'. The port definition is at: C:/Modeltech_pe_edu_10.1c/win32pe_edu/Decoder.v(1).

Any help on how to fix this would be greatly appreciated. I feel like I may be misunderstanding something about how Verilog uses static values.

  • 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-12T02:17:23+00:00Added an answer on June 12, 2026 at 2:17 am

    You have not provided a definition of the TRUE signal. I have replaced your TRUE with 1'b1 and now the simulation runs better:

      DECODER decoderModule(selectA, selectB, selectC, selectD, select1, select2, 1'b1);
    

    Undeclared signals default to 1'bx in most simulators.

    Alternately, you could declare TRUE as a wire in your MUX moodule:

    wire TRUE = 1'b1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to make simple minesweeper game in python, but have one problem. I have
I'm trying to make simple website with content background combined from 3 images: top
im trying to make a simple search on my database from the index action
I'm trying to make simple use of the NSNotification center inside my iPhone application,
I am trying to make a simple resource dictionary for styles but the Background
I'm trying to make a simple JQuery JSON call with some HTML, JS, and
I'm trying make a simple control, with a some path in it. And binding
I'm trying to make a simple Ruby regex to detect a JavaScript Declaration, but
i'm trying make simple app twitter and i use twitter4j library and i got
I was trying to make simple click loop with some delay, can you tell

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.