summaryrefslogtreecommitdiff
path: root/part_2/ex9/lsfr.v
blob: 44e931ca85a195c7157743ad62f18dc7d8db414c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module lfsr(
	input CLOCK,
	input ENABLE,
	output reg [13:0] SHIFT
);

	initial SHIFT = 13'd1;
	
	always @ (posedge CLOCK)
	begin
		if (ENABLE == 1'b1)
			SHIFT <= {SHIFT[12:0],(SHIFT[13] ^ SHIFT[11]) ^ SHIFT[3]};
	end
endmodule