EmbDev.net

Forum: FPGA, VHDL & Verilog Word Processing using verilog


von dayana42200 (Guest)


Rate this post
useful
not useful
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?

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
dayana42200 wrote:
> I want a output of
There is no clock or timing information in that picture. I don't get the 
trick. So some question remain:

> outputs A G
>         A G T
> ...
The output length is variable?

> Ive a stream of DNA sequence.
> A G T G C T T G
You get one "character" with each clock?

> Below the the SISO and its testbench verilog code.
Whats happening with thoe two in the simulator?
And whats wrong with that whats happening?
What do you expect and what do you get instead?

: Edited by Moderator
von dayana42200 (Guest)


Attached files:

Rate this post
useful
not useful
Lothar M. wrote:

> There is no clock or timing information in that picture. I don't get the
> trick. So some question remain:
  I want the output in every clock cycle.

> The output length is variable?
  Yes as shown in the output pattern.

> You get one "character" with each clock?
  Yes as shown in the attached waveform.

> Whats happening with thoe two in the simulator?
> And whats wrong with that whats happening?
> What do you expect and what do you get instead?
As you can see, in the attached waveform, it is just a normal SISO that 
works. I expect the output pattern that I show and I have no idea how to 
process the DNA stream.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.