Hi all.
Ive a stream of DNA sequence.
A G T G C T T G
and I want a output of
1 | input A G T G C T T C
|
2 | outputs A G
|
3 | A G T
|
4 | G T G
|
5 | T G C
|
6 | G C T
|
7 | C T T
|
8 | T T C
|
9 | T C
|
For now what I think is to used Shift Register (Serial In Serial
Out(SISO)). Below the the SISO and its testbench verilog code.
1 | module SISO (Clk, Load, SIn, SOut);
|
2 |
|
3 | parameter PE = 3;
|
4 | parameter QCbit = 3;
|
5 |
|
6 | input Clk, Load;
|
7 | input [QCbit-1:0] SIn;
|
8 | output [QCbit-1:0] SOut;
|
9 |
|
10 | reg [(QCbit*PE)-1:0] sr ; //3 x 3QC = 24 bits
|
11 |
|
12 | always@(posedge Clk)
|
13 | begin
|
14 | if (Load)
|
15 | begin
|
16 | sr <= {sr[2:0], SIn}; //shift by 2 and concatenate Input
|
17 | end
|
18 | else
|
19 | begin
|
20 | sr <= 1'd0;
|
21 | end
|
22 | end
|
23 |
|
24 | assign SOut = sr[5:3]; // complete shiftreg is serially output
|
25 |
|
26 | endmodule
|
1 | module SISO_tb();
|
2 |
|
3 | /*parameter InWidth = 3;*/
|
4 |
|
5 | localparam
|
6 | N_A = 3'b000, //nucleotide "A"
|
7 | N_C = 3'b001, //nucleotide "C"
|
8 | N_G = 3'b010, //nucleotide "G"
|
9 | N_T = 3'b011; //nucleotide "T"
|
10 |
|
11 | reg Clk,Load;
|
12 | reg [2:0] SIn;
|
13 | wire [2:0] SOut;
|
14 |
|
15 | initial
|
16 | begin
|
17 | Clk = 0;
|
18 | forever
|
19 | begin
|
20 | Clk = 0; #20;
|
21 | Clk = 1; #20;
|
22 | end
|
23 | end
|
24 |
|
25 | initial
|
26 | begin
|
27 | Load = 0; #10;
|
28 | Load = 1; #600; // 2*length of SISO
|
29 | Load = 0; #10;
|
30 | end
|
31 |
|
32 | initial
|
33 | begin
|
34 | SIn = N_A; #30;
|
35 | SIn = N_G; #40;
|
36 | SIn = N_T; #40;
|
37 | SIn = N_G; #40;
|
38 | SIn = N_C; #40;
|
39 | SIn = N_T; #40;
|
40 | SIn = N_T; #40;
|
41 | SIn = N_C; #40;
|
42 | end
|
43 |
|
44 | initial
|
45 | begin
|
46 | #700$finish;
|
47 | end
|
48 |
|
49 | SISO SISO_inst(
|
50 | .Clk (Clk),
|
51 | .Load (Load),
|
52 | .SIn (SIn),
|
53 | .SOut (SOut)
|
54 | );
|
55 |
|
56 | endmodule
|
Is it possible to produce that kind of word output using SISO?
Do you guys have idea?