From 4b6e0102d20d9ab060ce930e4b846c8be446bb06 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Mon, 12 Dec 2016 21:51:10 +0000 Subject: public push --- part_2/ex9/lsfr.v | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 part_2/ex9/lsfr.v (limited to 'part_2/ex9/lsfr.v') diff --git a/part_2/ex9/lsfr.v b/part_2/ex9/lsfr.v new file mode 100644 index 0000000..44e931c --- /dev/null +++ b/part_2/ex9/lsfr.v @@ -0,0 +1,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 -- cgit v1.2.3-54-g00ecf