3 // USRP - Universal Software Radio Peripheral
5 // Copyright (C) 2007 Corgan Enterprises LLC
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
22 module lfsr_constants(clk_i,rst_i,degree_i,mask_o,len_o);
26 output reg [15:0] mask_o;
27 output reg [16:0] len_o;
31 always @(posedge clk_i)
39 len_o <= #5 ((1 << degree_i) << 1)-3;
42 5'd00: mask_o <= #5 16'h0000;
43 5'd01: mask_o <= #5 16'h0001;
44 5'd02: mask_o <= #5 16'h0003;
45 5'd03: mask_o <= #5 16'h0005;
46 5'd04: mask_o <= #5 16'h0009;
47 5'd05: mask_o <= #5 16'h0012;
48 5'd06: mask_o <= #5 16'h0021;
49 5'd07: mask_o <= #5 16'h0041;
50 5'd08: mask_o <= #5 16'h008E;
51 5'd09: mask_o <= #5 16'h0108;
52 5'd10: mask_o <= #5 16'h0204;
53 5'd11: mask_o <= #5 16'h0402;
54 5'd12: mask_o <= #5 16'h0829;
55 5'd13: mask_o <= #5 16'h100D;
56 5'd14: mask_o <= #5 16'h2015;
57 5'd15: mask_o <= #5 16'h4001;
58 5'd16: mask_o <= #5 16'h8016;
59 default: mask_o <= #5 16'h0000;
60 endcase // case(degree_i)
61 end // else: !if(rst_i)
63 endmodule // lfsr_constants