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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [actel/] [ordb1a3pe1500/] [rtl/] [verilog/] [sdc_controller/] [sd_crc_7.v] - Blame information for rev 544

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 544 julius
module sd_crc_7(BITVAL, Enable, CLK, RST, CRC);
2
   input        BITVAL;// Next input bit
3
   input Enable;
4
   input        CLK;                           // Current bit valid (Clock)
5
   input        RST;                             // Init CRC value
6
   output [6:0] CRC;                               // Current output CRC value
7
 
8
   reg    [6:0] CRC;
9
                     // We need output registers
10
   wire         inv;
11
 
12
   assign inv = BITVAL ^ CRC[6];                   // XOR required?
13
 
14
 
15
    always @(posedge CLK or posedge RST) begin
16
                if (RST) begin
17
                        CRC = 0;
18
 
19
        end
20
                else begin
21
                        if (Enable==1) begin
22
                                CRC[6] = CRC[5];
23
                                CRC[5] = CRC[4];
24
                                CRC[4] = CRC[3];
25
                                CRC[3] = CRC[2] ^ inv;
26
                                CRC[2] = CRC[1];
27
                                CRC[1] = CRC[0];
28
                                CRC[0] = inv;
29
                        end
30
                end
31
     end
32
 
33
endmodule
34
 

powered by: WebSVN 2.1.0

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