Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem with parameterized module

Status
Not open for further replies.

gmish27

Member level 1
Joined
May 12, 2011
Messages
34
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
1,553
I created a module as under

module sc #(parameter n=2)(input clock, input enable, output reg [n-1:0] signal);
...
...
always@(posedge clock)
if(enable) signal <= n'bz; //line x say
else
...
...
Endmodule

but i am getting a syntax error in the line x sayin "unexpected token: 'n' "

why is it so ?
 

n'b0 is not valid. n is not a literal, eg 32'b0.

you can try {(n){1'bz}}, which replicates 1'bz N times and concatenates the result.
 
  • Like
Reactions: gmish27

    gmish27

    Points: 2
    Helpful Answer Positive Rating
Yeah! Thank you for this. It's workin now.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top