i need a code where the clock generate on its own.
now what i have is everytime i push a button the clock run.
need hlp from here pls. here is the code
module LFSR (clk, RESET, DIN, LOAD, SHIFT, Q);
input clk;
input RESET;
input DIN;
input LOAD;
input SHIFT;
output [4:0] Q;
reg [4:0] Q;
reg [4:0] Q_N;
wire TAP;
always @ (negedge clk or negedge RESET)
begin
if (~RESET)
Q <= 5'b11111;
else
Q <= Q_N;
end
assign TAP = Q[2] ^ Q[0];
always @ (Q or SHIFT or LOAD or DIN or TAP)
begin
Q_N = Q;
if (LOAD)
Q_N = {DIN, Q[4:1]};
else
if (SHIFT)
Q_N = {TAP, Q[4:1]};
end
endmodule