I write my verilog code using simple adder(inbiult in xilinx itself) but i want to replace it using RNS adder whose code i already made and it gives module RNS(clk,rst,a,b,c) where a,b are input of rns adder and c is output.
And my code for which i am using simple adder is given below.In my code i am using enable ,for that i have to use always block....but in structural modelling(when i call RNS adder) how to deal with this enable?
module output_adder_8(enable,s089,s318,s175,s250,s289,s118,s075,s350,s189,s218,s375,s050,s389,s018,s275,s150,r1,r3,r5,r7);
input enable;
input [13:0] s089,s175,s250,s318,s289,s118,s075,s350,s189,s218,s375,s050,s389,s018,s275,s150;
output reg[15:0] r1,r3,r5,r7;
reg [11:0] c,d,e,f,g,h,i,j;
//reg [3:0] countp=4'b0000;
always@*
begin
if (enable)
c<= s089+s318;
d<= s175+s250;
r1<= c+d;
e<= s289+s118;
f<= s075-s350;
r3<=f-e;
g<= s218-s189;
h<= s375+s050;
r5<=g+h;
i<= s018-s389;
j<= s275-s150;
r7<=i+j;
end
endmodule
module shift_adder_8a( clk, z0, s018, s050, s075, s089,enable0 );
input clk;
input [12:0] z0;
output reg [13:0] s018;
output reg [13:0] s050;
output reg [13:0] s075;
output reg [13:0] s089;
output reg enable0;
// temp reg declaration
reg [3:0] count0=4'b0000;
reg [13:0] d01,
d02,
d03,
d04,
d05,
e01,
e02,
e03,
e04;
always @(posedge clk )
begin
d01 <= z0<< 3;
d02 <= z0 << 4;
d03 <= z0 << 6;
if (count0==4'b0110)
d04 <= e01 << 1;
d05 <= e02 << 1;
e01 <= d01 + z0;
e02 <= d02 + e01;
e03 <= d03 + e02;
e04 <= e02 + d05;
s018 <= d04;
s050 <= d05;
s075 <= e04;
s089 <= e03;
enable0<=1'b1;
end