Problem with polynomial division

Status
Not open for further replies.

zoomkrupesh

Newbie level 4
Joined
Feb 3, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,329
Hi,

I am facing a problem in computing division of two polynomial.I am using lfsr for the equation x^4+x+1.And my input is x^8+1.What should be my output?i.e if I divide x^8+1 by x^4+x+1.Below I have given a code for generating equation x^4+x+1

module s1(clk,rst,data_in,s1);
input data_in;
output [3:0] s1;
input rst;
input clk;

reg [3:0] s1;


always @(posedge clk or posedge rst)
begin
if(rst)
begin
s1 <= 4'b0000;
end
else
begin
s1[0] <= s1[3] ^ data_in;
s1[1] <= s1[0] ^ s1[3] ^ data_in;
s1[2] <= s1[1];
s1[3] <= s1[2];
end
end
endmodule

I applied vector 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 serially to above verilog code.But I am not getting the correct output.

Please help me

Thanks in advance
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…