1
0
mirror of https://github.com/olofk/serv.git synced 2026-01-13 15:17:25 +00:00
olofk.serv/rtl/shift_reg.v
2018-11-17 21:30:03 +01:00

19 lines
368 B
Verilog

module shift_reg
(
input wire clk,
input wire i_en,
input wire i_d,
output wire o_q,
output wire [LEN-2:0] o_par);
parameter LEN = 0;
parameter INIT = 0;
reg [LEN-1:0] data = INIT;
assign o_q = data[0];
assign o_par = data[LEN-1:1];
always @(posedge clk)
if (i_en)
data <= {i_d, data[LEN-1:1]};
endmodule