jameela
Junior Member level 2
can anyone solve the problems stated in comments in the following code.....???
module eseone(clr,e_xk1,var_xk,var_r,e_zeta_k,var_zeta_k,e_ese_xk,r); //module eseone with I/Os given in brackets
input [3:0]r; //bits received by the system receiver
input clr; //control signal given just once initially to clear all registers
output [3:0] var_xk,var_r,e_zeta_k,var_zeta_k,e_ese_xk; //output wires to show output,from respective registers,in simulation
output e_xk1; //output wire to show output,from respective register,in simulation
//.......................................error in systhesis..............................................................
real e_xk; //register to store result of division in decimal
//.......................................................................................................................
reg [3:0] var_xk,var_r,e_zeta_k,var_zeta_k,e_ese_xk; //outputs declared as reg
reg e_xk1; //output declared as reg
always@(r or posedge clr) //following code runs whenever bits are received by the system receiver or when reg are cleared
//........................................error in simulation..............................................................
//when clr control signal is given received r should not be wasted rather utilized when clr is 0 again
//.........................................................................................................................
begin
if (clr) //control signal to clear all registers once
begin
e_xk=0;
var_xk=1; //it should be assigned 1 initially
var_r=0;
e_zeta_k=0;
var_zeta_k=0;
e_ese_xk=0;
end
else
begin
e_xk={r/8}; //received bits divided by the number of users of system
begin
if (e_xk==0.5) // if result is equal to 0.5 output should be 0
e_xk1=0;
else if (e_xk<0.5) //if result is less than 0.5 output should be 0
e_xk1=0;
//.....................................error in simulation.................................................................
else e_xk1=1; //if result is greater than 0.5 output should be 1
//.........................................................................................................................
end
var_xk=(1-e_xk1*e_xk1); //1 minus sqaure of output gives var_xk
var_r=((var_xk+var_xk+var_xk+var_xk+var_xk+var_xk+var_xk+var_xk)+1); //var_xk added 8 times plus 1
e_zeta_k=(r-e_xk1); //received bits minus e_xk1
var_zeta_k=(var_r-var_xk); //values calculated above are subtracted
e_ese_xk=(2*((r-e_zeta_k)/var_zeta_k)); //formula to calculate e_ese_xk
end
end
endmodule
module eseone(clr,e_xk1,var_xk,var_r,e_zeta_k,var_zeta_k,e_ese_xk,r); //module eseone with I/Os given in brackets
input [3:0]r; //bits received by the system receiver
input clr; //control signal given just once initially to clear all registers
output [3:0] var_xk,var_r,e_zeta_k,var_zeta_k,e_ese_xk; //output wires to show output,from respective registers,in simulation
output e_xk1; //output wire to show output,from respective register,in simulation
//.......................................error in systhesis..............................................................
real e_xk; //register to store result of division in decimal
//.......................................................................................................................
reg [3:0] var_xk,var_r,e_zeta_k,var_zeta_k,e_ese_xk; //outputs declared as reg
reg e_xk1; //output declared as reg
always@(r or posedge clr) //following code runs whenever bits are received by the system receiver or when reg are cleared
//........................................error in simulation..............................................................
//when clr control signal is given received r should not be wasted rather utilized when clr is 0 again
//.........................................................................................................................
begin
if (clr) //control signal to clear all registers once
begin
e_xk=0;
var_xk=1; //it should be assigned 1 initially
var_r=0;
e_zeta_k=0;
var_zeta_k=0;
e_ese_xk=0;
end
else
begin
e_xk={r/8}; //received bits divided by the number of users of system
begin
if (e_xk==0.5) // if result is equal to 0.5 output should be 0
e_xk1=0;
else if (e_xk<0.5) //if result is less than 0.5 output should be 0
e_xk1=0;
//.....................................error in simulation.................................................................
else e_xk1=1; //if result is greater than 0.5 output should be 1
//.........................................................................................................................
end
var_xk=(1-e_xk1*e_xk1); //1 minus sqaure of output gives var_xk
var_r=((var_xk+var_xk+var_xk+var_xk+var_xk+var_xk+var_xk+var_xk)+1); //var_xk added 8 times plus 1
e_zeta_k=(r-e_xk1); //received bits minus e_xk1
var_zeta_k=(var_r-var_xk); //values calculated above are subtracted
e_ese_xk=(2*((r-e_zeta_k)/var_zeta_k)); //formula to calculate e_ese_xk
end
end
endmodule