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.

module instantiation in verilog

Status
Not open for further replies.

sun_ray

Advanced Member level 3
Joined
Oct 3, 2011
Messages
772
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
6,828
Let a module A have one 4 bit input named sigZ. It is needed to instansiate this module A and it is also needed that in the instantiation of A, the four different bits of sigZ will be connected to different four other signals named sig1, sig2, sig3, sig4 from four other different blocks. How can this connection in the instantiation of A, without using concatenation operator?
 

Why you don't like concatenation? It's a standard practice to use this operator in such cases.
 

Code:
wire [3:0] sigZ_wire;
assign sigZ_wire[0] =  sig1;
assign sigZ_wire[1] =  sig2;
assign sigZ_wire[2] =  sig3;
assign sigZ_wire[3] =  sig4;

module_A module_A
(
....
  .sigZ   (sigZ_wire),
....
);

If you are not using the concatenation operator, then it will be somewhat like this.
 

Code:
wire [3:0] sigZ_wire;
assign sigZ_wire[0] =  sig1;
assign sigZ_wire[1] =  sig2;
assign sigZ_wire[2] =  sig3;
assign sigZ_wire[3] =  sig4;

module_A module_A
(
....
  .sigZ   (sigZ_wire),
....
);

If you are not using the concatenation operator, then it will be somewhat like this.

Is this assigning for each bit as shown below not allowed?

A ins_A (.sigZ[0] (sig1), sigZ[1] (sig2), sigz[2] (sig3),............)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top