1 //-----------------------------------------------------
4 // Function : Linear feedback shift register
5 // Coder : Deepak Kumar Tala
6 //-----------------------------------------------------
8 out , // Output of the counter
9 enable , // Enable for counter
14 //----------Output Ports--------------
16 //------------Input Ports--------------
17 input enable, clk, reset;
18 //------------Internal Variables--------
22 //-------------Code Starts Here-------
23 assign linear_feedback = !(out[7] ^ out[3]);
26 if (reset) begin // active high reset
28 end else if (enable) begin
29 out <= {out[6],out[5],
32 out[0], linear_feedback};
35 endmodule // End Of Module counter