OpenCores
URL https://opencores.org/ocsvn/csa/csa/trunk

Subversion Repositories csa

[/] [csa/] [trunk/] [rtl/] [ts_serial_out.v] - Blame information for rev 42

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 41 simon111
 
2
`include "../bench/timescale.v"
3
 
4
// this module serial output the ts stream
5
module ts_serial_out(
6
                          input            clk
7
                        , input            rst
8
                        , input [8*8-1:0]  group
9
                        , input [3:0]      bytes
10
                        , input            en
11
                        , output[1*8-1:0]  dec
12
                        , output           valid
13
                );
14
 
15
        reg [8*8-1:0]  group_d;
16
        reg [3:0]      cnt;
17
 
18
        assign valid = cnt != 3'h0;
19
        assign dec   = group_d[1*8-1:0];
20
 
21
        always@(posedge clk)
22
                if(en)
23
                begin
24
                        group_d<=group;
25
                        cnt    <=bytes;
26
                end
27
                else
28
                if(cnt!=3'h0)
29
                begin
30
                        group_d<={group_d[1*8-1:0],group_d[8*8-1:1*8]};
31
                        cnt<=cnt-4'h1;
32
                end
33
 
34
endmodule
35
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.