Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393_sata
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393_sata
Commits
a699d0ce
Commit
a699d0ce
authored
Aug 07, 2015
by
Alexey Grebenkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link layer. Pre-testing rtl
parent
22d73e32
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
590 additions
and
96 deletions
+590
-96
crc.v
host/crc.v
+130
-0
link.v
host/link.v
+374
-96
scrambler.v
host/scrambler.v
+86
-0
No files found.
host/crc.v
0 → 100644
View file @
a699d0ce
/*******************************************************************************
* Module: crc
* Date: 2015-07-11
* Author: Alexey
* Description: crc calculations for the link layer
*
* Copyright (c) 2015 Elphel, Inc.
* crc.v is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* crc.v file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/> .
*******************************************************************************/
/* same as for a scrambler, @ doc p.561 */
// TODO make it parallel, make another widths support
module
crc
#(
parameter
DATA_BYTE_WIDTH
=
4
)
(
input
wire
clk
,
input
wire
rst
,
input
wire
val_in
,
input
wire
[
DATA_BYTE_WIDTH
*
8
-
1
:
0
]
data_in
,
output
wire
[
DATA_BYTE_WIDTH
*
8
-
1
:
0
]
crc_out
)
;
reg
[
31
:
0
]
crc
;
wire
[
31
:
0
]
crc_bit
;
reg
[
31
:
0
]
new_bit
;
always
@
(
posedge
clk
)
crc
<=
rst
?
32'h52325032
:
val_in
?
new_bit
:
crc
;
assign
crc_bit
=
crc
^
data_in
;
assign
crc_out
=
crc
;
always
@
(
*
)
begin
new_bit
[
31
]
=
crc_bit
[
31
]
^
crc_bit
[
30
]
^
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
27
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
15
]
^
crc_bit
[
11
]
^
crc_bit
[
9
]
^
crc_bit
[
8
]
^
crc_bit
[
5
]
;
new_bit
[
30
]
=
crc_bit
[
30
]
^
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
22
]
^
crc_bit
[
14
]
^
crc_bit
[
10
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
4
]
;
new_bit
[
29
]
=
crc_bit
[
31
]
^
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
25
]
^
crc_bit
[
23
]
^
crc_bit
[
22
]
^
crc_bit
[
21
]
^
crc_bit
[
13
]
^
crc_bit
[
9
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
3
]
;
new_bit
[
28
]
=
crc_bit
[
30
]
^
crc_bit
[
28
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
22
]
^
crc_bit
[
21
]
^
crc_bit
[
20
]
^
crc_bit
[
12
]
^
crc_bit
[
8
]
^
crc_bit
[
6
]
^
crc_bit
[
5
]
^
crc_bit
[
2
]
;
new_bit
[
27
]
=
crc_bit
[
29
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
21
]
^
crc_bit
[
20
]
^
crc_bit
[
19
]
^
crc_bit
[
11
]
^
crc_bit
[
7
]
^
crc_bit
[
5
]
^
crc_bit
[
4
]
^
crc_bit
[
1
]
;
new_bit
[
26
]
=
crc_bit
[
31
]
^
crc_bit
[
28
]
^
crc_bit
[
26
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
22
]
^
crc_bit
[
20
]
^
crc_bit
[
19
]
^
crc_bit
[
18
]
^
crc_bit
[
10
]
^
crc_bit
[
6
]
^
crc_bit
[
4
]
^
crc_bit
[
3
]
^
crc_bit
[
0
]
;
new_bit
[
25
]
=
crc_bit
[
31
]
^
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
22
]
^
crc_bit
[
21
]
^
crc_bit
[
19
]
^
crc_bit
[
18
]
^
crc_bit
[
17
]
^
crc_bit
[
15
]
^
crc_bit
[
11
]
^
crc_bit
[
8
]
^
crc_bit
[
3
]
^
crc_bit
[
2
]
;
new_bit
[
24
]
=
crc_bit
[
30
]
^
crc_bit
[
28
]
^
crc_bit
[
27
]
^
crc_bit
[
21
]
^
crc_bit
[
20
]
^
crc_bit
[
18
]
^
crc_bit
[
17
]
^
crc_bit
[
16
]
^
crc_bit
[
14
]
^
crc_bit
[
10
]
^
crc_bit
[
7
]
^
crc_bit
[
2
]
^
crc_bit
[
1
]
;
new_bit
[
23
]
=
crc_bit
[
31
]
^
crc_bit
[
29
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
20
]
^
crc_bit
[
19
]
^
crc_bit
[
17
]
^
crc_bit
[
16
]
^
crc_bit
[
15
]
^
crc_bit
[
13
]
^
crc_bit
[
9
]
^
crc_bit
[
6
]
^
crc_bit
[
1
]
^
crc_bit
[
0
]
;
new_bit
[
22
]
=
crc_bit
[
31
]
^
crc_bit
[
29
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
19
]
^
crc_bit
[
18
]
^
crc_bit
[
16
]
^
crc_bit
[
14
]
^
crc_bit
[
12
]
^
crc_bit
[
11
]
^
crc_bit
[
9
]
^
crc_bit
[
0
]
;
new_bit
[
21
]
=
crc_bit
[
31
]
^
crc_bit
[
29
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
24
]
^
crc_bit
[
22
]
^
crc_bit
[
18
]
^
crc_bit
[
17
]
^
crc_bit
[
13
]
^
crc_bit
[
10
]
^
crc_bit
[
9
]
^
crc_bit
[
5
]
;
new_bit
[
20
]
=
crc_bit
[
30
]
^
crc_bit
[
28
]
^
crc_bit
[
26
]
^
crc_bit
[
25
]
^
crc_bit
[
23
]
^
crc_bit
[
21
]
^
crc_bit
[
17
]
^
crc_bit
[
16
]
^
crc_bit
[
12
]
^
crc_bit
[
9
]
^
crc_bit
[
8
]
^
crc_bit
[
4
]
;
new_bit
[
19
]
=
crc_bit
[
29
]
^
crc_bit
[
27
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
22
]
^
crc_bit
[
20
]
^
crc_bit
[
16
]
^
crc_bit
[
15
]
^
crc_bit
[
11
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
3
]
;
new_bit
[
18
]
=
crc_bit
[
31
]
^
crc_bit
[
28
]
^
crc_bit
[
26
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
21
]
^
crc_bit
[
19
]
^
crc_bit
[
15
]
^
crc_bit
[
14
]
^
crc_bit
[
10
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
2
]
;
new_bit
[
17
]
=
crc_bit
[
31
]
^
crc_bit
[
30
]
^
crc_bit
[
27
]
^
crc_bit
[
25
]
^
crc_bit
[
23
]
^
crc_bit
[
22
]
^
crc_bit
[
20
]
^
crc_bit
[
18
]
^
crc_bit
[
14
]
^
crc_bit
[
13
]
^
crc_bit
[
9
]
^
crc_bit
[
6
]
^
crc_bit
[
5
]
^
crc_bit
[
1
]
;
new_bit
[
16
]
=
crc_bit
[
30
]
^
crc_bit
[
29
]
^
crc_bit
[
26
]
^
crc_bit
[
24
]
^
crc_bit
[
22
]
^
crc_bit
[
21
]
^
crc_bit
[
19
]
^
crc_bit
[
17
]
^
crc_bit
[
13
]
^
crc_bit
[
12
]
^
crc_bit
[
8
]
^
crc_bit
[
5
]
^
crc_bit
[
4
]
^
crc_bit
[
0
]
;
new_bit
[
15
]
=
crc_bit
[
30
]
^
crc_bit
[
27
]
^
crc_bit
[
24
]
^
crc_bit
[
21
]
^
crc_bit
[
20
]
^
crc_bit
[
18
]
^
crc_bit
[
16
]
^
crc_bit
[
15
]
^
crc_bit
[
12
]
^
crc_bit
[
9
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
5
]
^
crc_bit
[
4
]
^
crc_bit
[
3
]
;
new_bit
[
14
]
=
crc_bit
[
29
]
^
crc_bit
[
26
]
^
crc_bit
[
23
]
^
crc_bit
[
20
]
^
crc_bit
[
19
]
^
crc_bit
[
17
]
^
crc_bit
[
15
]
^
crc_bit
[
14
]
^
crc_bit
[
11
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
4
]
^
crc_bit
[
3
]
^
crc_bit
[
2
]
;
new_bit
[
13
]
=
crc_bit
[
31
]
^
crc_bit
[
28
]
^
crc_bit
[
25
]
^
crc_bit
[
22
]
^
crc_bit
[
19
]
^
crc_bit
[
18
]
^
crc_bit
[
16
]
^
crc_bit
[
14
]
^
crc_bit
[
13
]
^
crc_bit
[
10
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
5
]
^
crc_bit
[
3
]
^
crc_bit
[
2
]
^
crc_bit
[
1
]
;
new_bit
[
12
]
=
crc_bit
[
31
]
^
crc_bit
[
30
]
^
crc_bit
[
27
]
^
crc_bit
[
24
]
^
crc_bit
[
21
]
^
crc_bit
[
18
]
^
crc_bit
[
17
]
^
crc_bit
[
15
]
^
crc_bit
[
13
]
^
crc_bit
[
12
]
^
crc_bit
[
9
]
^
crc_bit
[
6
]
^
crc_bit
[
5
]
^
crc_bit
[
4
]
^
crc_bit
[
2
]
^
crc_bit
[
1
]
^
crc_bit
[
0
]
;
new_bit
[
11
]
=
crc_bit
[
31
]
^
crc_bit
[
28
]
^
crc_bit
[
27
]
^
crc_bit
[
26
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
20
]
^
crc_bit
[
17
]
^
crc_bit
[
16
]
^
crc_bit
[
15
]
^
crc_bit
[
14
]
^
crc_bit
[
12
]
^
crc_bit
[
9
]
^
crc_bit
[
4
]
^
crc_bit
[
3
]
^
crc_bit
[
1
]
^
crc_bit
[
0
]
;
new_bit
[
10
]
=
crc_bit
[
31
]
^
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
26
]
^
crc_bit
[
19
]
^
crc_bit
[
16
]
^
crc_bit
[
14
]
^
crc_bit
[
13
]
^
crc_bit
[
9
]
^
crc_bit
[
5
]
^
crc_bit
[
3
]
^
crc_bit
[
2
]
^
crc_bit
[
0
]
;
new_bit
[
9
]
=
crc_bit
[
29
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
18
]
^
crc_bit
[
13
]
^
crc_bit
[
12
]
^
crc_bit
[
11
]
^
crc_bit
[
9
]
^
crc_bit
[
5
]
^
crc_bit
[
4
]
^
crc_bit
[
2
]
^
crc_bit
[
1
]
;
new_bit
[
8
]
=
crc_bit
[
31
]
^
crc_bit
[
28
]
^
crc_bit
[
23
]
^
crc_bit
[
22
]
^
crc_bit
[
17
]
^
crc_bit
[
12
]
^
crc_bit
[
11
]
^
crc_bit
[
10
]
^
crc_bit
[
8
]
^
crc_bit
[
4
]
^
crc_bit
[
3
]
^
crc_bit
[
1
]
^
crc_bit
[
0
]
;
new_bit
[
7
]
=
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
23
]
^
crc_bit
[
22
]
^
crc_bit
[
21
]
^
crc_bit
[
16
]
^
crc_bit
[
15
]
^
crc_bit
[
10
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
5
]
^
crc_bit
[
3
]
^
crc_bit
[
2
]
^
crc_bit
[
0
]
;
new_bit
[
6
]
=
crc_bit
[
30
]
^
crc_bit
[
29
]
^
crc_bit
[
25
]
^
crc_bit
[
22
]
^
crc_bit
[
21
]
^
crc_bit
[
20
]
^
crc_bit
[
14
]
^
crc_bit
[
11
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
5
]
^
crc_bit
[
4
]
^
crc_bit
[
2
]
^
crc_bit
[
1
]
;
new_bit
[
5
]
=
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
24
]
^
crc_bit
[
21
]
^
crc_bit
[
20
]
^
crc_bit
[
19
]
^
crc_bit
[
13
]
^
crc_bit
[
10
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
5
]
^
crc_bit
[
4
]
^
crc_bit
[
3
]
^
crc_bit
[
1
]
^
crc_bit
[
0
]
;
new_bit
[
4
]
=
crc_bit
[
31
]
^
crc_bit
[
30
]
^
crc_bit
[
29
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
20
]
^
crc_bit
[
19
]
^
crc_bit
[
18
]
^
crc_bit
[
15
]
^
crc_bit
[
12
]
^
crc_bit
[
11
]
^
crc_bit
[
8
]
^
crc_bit
[
6
]
^
crc_bit
[
4
]
^
crc_bit
[
3
]
^
crc_bit
[
2
]
^
crc_bit
[
0
]
;
new_bit
[
3
]
=
crc_bit
[
31
]
^
crc_bit
[
27
]
^
crc_bit
[
25
]
^
crc_bit
[
19
]
^
crc_bit
[
18
]
^
crc_bit
[
17
]
^
crc_bit
[
15
]
^
crc_bit
[
14
]
^
crc_bit
[
10
]
^
crc_bit
[
9
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
3
]
^
crc_bit
[
2
]
^
crc_bit
[
1
]
;
new_bit
[
2
]
=
crc_bit
[
31
]
^
crc_bit
[
30
]
^
crc_bit
[
26
]
^
crc_bit
[
24
]
^
crc_bit
[
18
]
^
crc_bit
[
17
]
^
crc_bit
[
16
]
^
crc_bit
[
14
]
^
crc_bit
[
13
]
^
crc_bit
[
9
]
^
crc_bit
[
8
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
2
]
^
crc_bit
[
1
]
^
crc_bit
[
0
]
;
new_bit
[
1
]
=
crc_bit
[
28
]
^
crc_bit
[
27
]
^
crc_bit
[
24
]
^
crc_bit
[
17
]
^
crc_bit
[
16
]
^
crc_bit
[
13
]
^
crc_bit
[
12
]
^
crc_bit
[
11
]
^
crc_bit
[
9
]
^
crc_bit
[
7
]
^
crc_bit
[
6
]
^
crc_bit
[
1
]
^
crc_bit
[
0
]
;
new_bit
[
0
]
=
crc_bit
[
31
]
^
crc_bit
[
30
]
^
crc_bit
[
29
]
^
crc_bit
[
28
]
^
crc_bit
[
26
]
^
crc_bit
[
25
]
^
crc_bit
[
24
]
^
crc_bit
[
16
]
^
crc_bit
[
12
]
^
crc_bit
[
10
]
^
crc_bit
[
9
]
^
crc_bit
[
6
]
^
crc_bit
[
0
]
;
end
endmodule
host/link.v
View file @
a699d0ce
This diff is collapsed.
Click to expand it.
host/scrambler.v
0 → 100644
View file @
a699d0ce
/*******************************************************************************
* Module: scrambler
* Date: 2015-07-11
* Author: Alexey
* Description: a scrambler for the link layer
*
* Copyright (c) 2015 Elphel, Inc.
* scrambler.v is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* scrambler.v file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/> .
*******************************************************************************/
/*
* Algorithm is taken from the doc, p.565. TODO make it parallel
*/
// TODO another widths support
module
scrambler
#(
parameter
DATA_BYTE_WIDTH
=
4
)
(
input
wire
clk
,
input
wire
rst
,
input
wire
val_in
,
input
wire
[
DATA_BYTE_WIDTH
*
8
-
1
:
0
]
data_in
,
output
wire
[
DATA_BYTE_WIDTH
*
8
-
1
:
0
]
data_out
)
;
reg
[
15
:
0
]
now
;
reg
[
31
:
0
]
next
;
always
@
(
posedge
clk
)
now
<=
rst
?
16'hf0f6
:
val_in
?
next
:
now
;
assign
data_out
=
val_in
?
data_in
^
next
:
data_in
;
always
@
(
*
)
/* if (rst)
next = 32'h0;
else*/
begin
next
[
31
]
=
now
[
12
]
^
now
[
10
]
^
now
[
7
]
^
now
[
3
]
^
now
[
1
]
^
now
[
0
]
;
next
[
30
]
=
now
[
15
]
^
now
[
14
]
^
now
[
12
]
^
now
[
11
]
^
now
[
9
]
^
now
[
6
]
^
now
[
3
]
^
now
[
2
]
^
now
[
0
]
;
next
[
29
]
=
now
[
15
]
^
now
[
13
]
^
now
[
12
]
^
now
[
11
]
^
now
[
10
]
^
now
[
8
]
^
now
[
5
]
^
now
[
3
]
^
now
[
2
]
^
now
[
1
]
;
next
[
28
]
=
now
[
14
]
^
now
[
12
]
^
now
[
11
]
^
now
[
10
]
^
now
[
9
]
^
now
[
7
]
^
now
[
4
]
^
now
[
2
]
^
now
[
1
]
^
now
[
0
]
;
next
[
27
]
=
now
[
15
]
^
now
[
14
]
^
now
[
13
]
^
now
[
12
]
^
now
[
11
]
^
now
[
10
]
^
now
[
9
]
^
now
[
8
]
^
now
[
6
]
^
now
[
1
]
^
now
[
0
]
;
next
[
26
]
=
now
[
15
]
^
now
[
13
]
^
now
[
11
]
^
now
[
10
]
^
now
[
9
]
^
now
[
8
]
^
now
[
7
]
^
now
[
5
]
^
now
[
3
]
^
now
[
0
]
;
next
[
25
]
=
now
[
15
]
^
now
[
10
]
^
now
[
9
]
^
now
[
8
]
^
now
[
7
]
^
now
[
6
]
^
now
[
4
]
^
now
[
3
]
^
now
[
2
]
;
next
[
24
]
=
now
[
14
]
^
now
[
9
]
^
now
[
8
]
^
now
[
7
]
^
now
[
6
]
^
now
[
5
]
^
now
[
3
]
^
now
[
2
]
^
now
[
1
]
;
next
[
23
]
=
now
[
13
]
^
now
[
8
]
^
now
[
7
]
^
now
[
6
]
^
now
[
5
]
^
now
[
4
]
^
now
[
2
]
^
now
[
1
]
^
now
[
0
]
;
next
[
22
]
=
now
[
15
]
^
now
[
14
]
^
now
[
7
]
^
now
[
6
]
^
now
[
5
]
^
now
[
4
]
^
now
[
1
]
^
now
[
0
]
;
next
[
21
]
=
now
[
15
]
^
now
[
13
]
^
now
[
12
]
^
now
[
6
]
^
now
[
5
]
^
now
[
4
]
^
now
[
0
]
;
next
[
20
]
=
now
[
15
]
^
now
[
11
]
^
now
[
5
]
^
now
[
4
]
;
next
[
19
]
=
now
[
14
]
^
now
[
10
]
^
now
[
4
]
^
now
[
3
]
;
next
[
18
]
=
now
[
13
]
^
now
[
9
]
^
now
[
3
]
^
now
[
2
]
;
next
[
17
]
=
now
[
12
]
^
now
[
8
]
^
now
[
2
]
^
now
[
1
]
;
next
[
16
]
=
now
[
11
]
^
now
[
7
]
^
now
[
1
]
^
now
[
0
]
;
next
[
15
]
=
now
[
15
]
^
now
[
14
]
^
now
[
12
]
^
now
[
10
]
^
now
[
6
]
^
now
[
3
]
^
now
[
0
]
;
next
[
14
]
=
now
[
15
]
^
now
[
13
]
^
now
[
12
]
^
now
[
11
]
^
now
[
9
]
^
now
[
5
]
^
now
[
3
]
^
now
[
2
]
;
next
[
13
]
=
now
[
14
]
^
now
[
12
]
^
now
[
11
]
^
now
[
10
]
^
now
[
8
]
^
now
[
4
]
^
now
[
2
]
^
now
[
1
]
;
next
[
12
]
=
now
[
13
]
^
now
[
11
]
^
now
[
10
]
^
now
[
9
]
^
now
[
7
]
^
now
[
3
]
^
now
[
1
]
^
now
[
0
]
;
next
[
11
]
=
now
[
15
]
^
now
[
14
]
^
now
[
10
]
^
now
[
9
]
^
now
[
8
]
^
now
[
6
]
^
now
[
3
]
^
now
[
2
]
^
now
[
0
]
;
next
[
10
]
=
now
[
15
]
^
now
[
13
]
^
now
[
12
]
^
now
[
9
]
^
now
[
8
]
^
now
[
7
]
^
now
[
5
]
^
now
[
3
]
^
now
[
2
]
^
now
[
1
]
;
next
[
9
]
=
now
[
14
]
^
now
[
12
]
^
now
[
11
]
^
now
[
8
]
^
now
[
7
]
^
now
[
6
]
^
now
[
4
]
^
now
[
2
]
^
now
[
1
]
^
now
[
0
]
;
next
[
8
]
=
now
[
15
]
^
now
[
14
]
^
now
[
13
]
^
now
[
12
]
^
now
[
11
]
^
now
[
10
]
^
now
[
7
]
^
now
[
6
]
^
now
[
5
]
^
now
[
1
]
^
now
[
0
]
;
next
[
7
]
=
now
[
15
]
^
now
[
13
]
^
now
[
11
]
^
now
[
10
]
^
now
[
9
]
^
now
[
6
]
^
now
[
5
]
^
now
[
4
]
^
now
[
3
]
^
now
[
0
]
;
next
[
6
]
=
now
[
15
]
^
now
[
10
]
^
now
[
9
]
^
now
[
8
]
^
now
[
5
]
^
now
[
4
]
^
now
[
2
]
;
next
[
5
]
=
now
[
14
]
^
now
[
9
]
^
now
[
8
]
^
now
[
7
]
^
now
[
4
]
^
now
[
3
]
^
now
[
1
]
;
next
[
4
]
=
now
[
13
]
^
now
[
8
]
^
now
[
7
]
^
now
[
6
]
^
now
[
3
]
^
now
[
2
]
^
now
[
0
]
;
next
[
3
]
=
now
[
15
]
^
now
[
14
]
^
now
[
7
]
^
now
[
6
]
^
now
[
5
]
^
now
[
3
]
^
now
[
2
]
^
now
[
1
]
;
next
[
2
]
=
now
[
14
]
^
now
[
13
]
^
now
[
6
]
^
now
[
5
]
^
now
[
4
]
^
now
[
2
]
^
now
[
1
]
^
now
[
0
]
;
next
[
1
]
=
now
[
15
]
^
now
[
14
]
^
now
[
13
]
^
now
[
5
]
^
now
[
4
]
^
now
[
1
]
^
now
[
0
]
;
next
[
0
]
=
now
[
15
]
^
now
[
13
]
^
now
[
4
]
^
now
[
0
]
;
end
endmodule
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment