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

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Hardware/] [MIPS32_Standalone/] [Register.v] - Blame information for rev 10

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 3 ayersg
    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 2 ayersg
 
29 3 ayersg
    always @(posedge clock) begin
30
        Q <= (reset) ? INIT : ((enable) ? D : Q);
31
    end
32 2 ayersg
 
33
endmodule
34 3 ayersg
 

powered by: WebSVN 2.1.0

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