• 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

  • 1

Well, for a start, nothing in there looks to be clocked at all.

Without using a clock somewhere, you can't update any internal state.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now