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

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Hardware/] [XUPV5-LX110T_SoC/] [MIPS32-Pipelined-Hw/] [src/] [MIPS32/] [Register.v] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 ayersg
`timescale 1ns / 1ps
2
/*
3
 * File         : Register.v
4
 * Project      : University of Utah, XUM Project MIPS32 core
5
 * Creator(s)   : Grant Ayers (ayers@cs.utah.edu)
6
 *
7
 * Modification History:
8
 *   Rev   Date         Initials  Description of Change
9
 *   1.0   7-Jun-2011   GEA       Initial design.
10
 *
11
 * Standards/Formatting:
12
 *   Verilog 2001, 4 soft tab, wide column.
13
 *
14
 * Description:
15
 *   A variable-width register (d flip-flop) with configurable initial
16
 *   value. Default is 32-bit width and 0s for initial value.
17
 */
18
module Register #(parameter WIDTH = 32, INIT = 0)(
19
        input  clock,
20
        input  reset,
21
        input  enable,
22
        input  [(WIDTH-1):0] D,
23
        output reg [(WIDTH-1):0] Q
24
        );
25
 
26
        initial
27
                Q = INIT;
28
 
29
        always @(posedge clock) begin
30
                Q <= (reset) ? INIT : ((enable) ? D : Q);
31
        end
32
 
33
endmodule

powered by: WebSVN 2.1.0

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