• 0

LMS algorithm using output from XADC


Hello all,

I'm trying to simulate LMS algorithm with digital samples from XADC out of Auxillary channel 6.

In my step to update weight, I don't understand how to bring about weight update. It reads Weight_in and Weight_out as XXXX.


Please check the bolded. area in LMS_weight module.



module LMShruthi ( DCLK, RESET, Desired_in, mux ); 
input DCLK, RESET;
input   signed [15:0] Desired_in; 
output signed [15:0] mux; 
wire [15:0] mu; //mu=0.0000001
reg signed [15:0] Data_in; 
wire signed [15:0] e;
wire signed [31:0] Product_32, y; 
assign mu  = 16'b0000000001100110;   
always # (50000) Data_in = Desired_in;
assign Product_32 = mu * Data_in; 
    assign mux = Product_32[24:9];
LMS_weight uut3   ( .DCLK(DCLK), .RESET(RESET), .Data_in(Data_in), .mux(mux), .y(y) ); 
    assign e = Desired_in - y[24:9];  
module LMS_weight (DCLK, RESET, Data_in, mux, y); 
    input DCLK,RESET;
    input signed [15:0] Data_in,mux; 
    output  signed [31:0] y; 
    wire signed [15:0] Weight_in;
    wire signed [15:0] Weight_out, emux; 
    wire signed [31:0] Product_32; 
    assign Product_32 = Data_in * mux; 
    assign emux = Product_32[26:11]; 
    assign Weight_in = (RESET==1'b1) ? 16'h0000 : (emux + Weight_out);
    assign y = Weight_out * Data_in; 

Thank you,

Shruthi Sampathkumar.

Share this post

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.