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

Subversion Repositories versatile_fifo

[/] [versatile_fifo/] [trunk/] [rtl/] [verilog/] [dff_sr.v] - Blame information for rev 25

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 unneback
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Versatile counter                                           ////
4
////                                                              ////
5
////  Description                                                 ////
6
////  Versatile counter, a reconfigurable binary, gray or LFSR    ////
7
////  counter                                                     ////
8
////                                                              ////
9
////  To Do:                                                      ////
10
////   - add LFSR with more taps                                  ////
11
////                                                              ////
12
////  Author(s):                                                  ////
13
////      - Michael Unneback, unneback@opencores.org              ////
14
////        ORSoC AB                                              ////
15
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18
//// Copyright (C) 2009 Authors and OPENCORES.ORG                 ////
19
////                                                              ////
20
//// This source file may be used and distributed without         ////
21
//// restriction provided that this copyright statement is not    ////
22
//// removed from the file and that any derivative work contains  ////
23
//// the original copyright notice and the associated disclaimer. ////
24
////                                                              ////
25
//// This source file is free software; you can redistribute it   ////
26
//// and/or modify it under the terms of the GNU Lesser General   ////
27
//// Public License as published by the Free Software Foundation; ////
28
//// either version 2.1 of the License, or (at your option) any   ////
29
//// later version.                                               ////
30
////                                                              ////
31
//// This source is distributed in the hope that it will be       ////
32
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
33
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
34
//// PURPOSE.  See the GNU Lesser General Public License for more ////
35
//// details.                                                     ////
36
////                                                              ////
37
//// You should have received a copy of the GNU Lesser General    ////
38
//// Public License along with this source; if not, download it   ////
39
//// from http://www.opencores.org/lgpl.shtml                     ////
40
////                                                              ////
41
//////////////////////////////////////////////////////////////////////
42
 
43
module dff_sr ( aclr, aset, clock, data, q);
44
 
45
    input         aclr;
46
    input         aset;
47
    input         clock;
48
    input         data;
49
    output reg    q;
50
 
51
   always @ (posedge clock or posedge aclr or posedge aset)
52
     if (aclr)
53
       q <= 1'b0;
54
     else if (aset)
55
       q <= 1'b1;
56
     else
57
       q <= data;
58
 
59
endmodule

powered by: WebSVN 2.1.0

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