-
Notifications
You must be signed in to change notification settings - Fork 0
/
15_bit_scrambler.v
51 lines (48 loc) · 1.39 KB
/
15_bit_scrambler.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 04.06.2024 11:21:38
// Design Name:
// Module Name: scrambler
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module scrambler(
input wire clk,
input wire rst,
input wire [14:0] initial_value,
output reg [14:0] dout
);
always @(posedge clk or posedge rst) begin
if (rst == 1) begin
dout <= initial_value;
end else if (rst==0) begin
dout[0] <= initial_value[14] ^ initial_value[13];
dout[1] <= initial_value[0];
dout[2] <= initial_value[1];
dout[3] <= initial_value[2];
dout[4] <= initial_value[3];
dout[5] <= initial_value[4];
dout[6] <= initial_value[5];
dout[7] <= initial_value[6];
dout[8] <= initial_value[7];
dout[9] <= initial_value[8];
dout[10] <= initial_value[9];
dout[11] <= initial_value[10];
dout[12] <= initial_value[11];
dout[13] <= initial_value[12];
dout[14] <= initial_value[13];
end
end
endmodule