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.

[moved]vhdl or verilog code to call a function within loop

Status
Not open for further replies.

ecasha

Junior Member level 2
Joined
Feb 28, 2017
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
197

Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
module coding(clok,data,coded_out,out,rst);       
input [4:0] data;    
input clok, rst;    
output [1:0] coded_out;     
output [1:0] out;    
genvar i;    
for(i=0;i<=4;i=i+1) begin   
   sipo str1 (.din(data[i]),.clk(clok),.dout(out),.reset(rst));    
    convol_enco u3 (.coded(coded_out),.in(data[i]),.p_out(out));   
    end   
endmodule



what is the problem with above code? how do i rectify it?
 
Last edited by a moderator:

How do you expect this to work when the loop is unrolled and all the outputs of the five (0-4) instances of u3 are all shorted together?

I think you are probably misinterpreting the code and think the loop is done sequentially in time and that you get 5 outputs one after another.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top