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

Subversion Repositories embedded_risc

[/] [embedded_risc/] [trunk/] [Verilog/] [ACC.V] - Blame information for rev 27

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 hosseinami
/****************************************************************************************
2
 MODULE:                Sub Level Accumulator Block
3
 
4
 FILE NAME:     acc.v
5
 VERSION:       1.0
6
 DATE:          September 28th, 2001
7
 AUTHOR:                Hossein Amidi
8
 COMPANY:       California Unique Electrical Co.
9
 CODE TYPE:     Register Transfer Level
10
 
11
 Instantiations:
12
 
13
 DESCRIPTION:
14
 Sub Level RTL Accumulator block, with zero & negetive flags
15
 
16
 Hossein Amidi
17
 (C) September 2001
18
 California Unique Electric
19
 
20
***************************************************************************************/
21
 
22
`timescale 1ns / 1ps
23
 
24
module   ACC(   // Input
25
                                        clock,
26
                                        reset,
27
                                        ACCInEn,
28
                                        ACCDataIn,
29
                                        // Output
30
                                        ACCNeg,
31
                                        ACCZero,
32
                                        ACCDataOut
33
                                        );
34
 
35
 
36
// Parameter
37
parameter DataWidth = 32;
38
 
39
// Input
40
input  clock;
41
input  reset;
42
input    ACCInEn;
43
input  [DataWidth - 1 : 0] ACCDataIn;
44
 
45
// Output
46
output  ACCNeg;
47
output  ACCZero;
48
output [DataWidth - 1 : 0] ACCDataOut;
49
 
50
// Signal Declerations
51
reg [DataWidth - 1 : 0]rACCDataOut;
52
 
53
// Assignments
54
assign ACCDataOut = rACCDataOut;
55
assign ACCNeg = rACCDataOut[31];
56
assign ACCZero = ~((((((((((((((((ACCDataOut[0]  | ACCDataOut[1])   |
57
                                                                                 (ACCDataOut[2]  | ACCDataOut[3]))  |
58
                                                                                 (ACCDataOut[4]  | ACCDataOut[5]))  |
59
                                                                                 (ACCDataOut[6]  | ACCDataOut[7]))  |
60
                                                                                 (ACCDataOut[8]  | ACCDataOut[9]))  |
61
                                                                                 (ACCDataOut[10] | ACCDataOut[11])) |
62
                                                                                 (ACCDataOut[12] | ACCDataOut[13])) |
63
                                                                                 (ACCDataOut[14] | ACCDataOut[15])) |
64
                                                                                 (ACCDataOut[16] | ACCDataOut[17])) |
65
                                                                                 (ACCDataOut[18] | ACCDataOut[19])) |
66
                                                                                 (ACCDataOut[20] | ACCDataOut[21])) |
67
                                                                                 (ACCDataOut[22] | ACCDataOut[23])) |
68
                                                                                 (ACCDataOut[24] | ACCDataOut[25])) |
69
                                                                                 (ACCDataOut[26] | ACCDataOut[27])) |
70
                                                                                 (ACCDataOut[28] | ACCDataOut[29])) |
71
                                                                                 (ACCDataOut[30] | ACCDataOut[31])) ;
72
 
73
 
74
 
75
always @(posedge reset or negedge clock)
76
begin
77
        if(reset == 1'b1)
78
                rACCDataOut <= 32'h0000;
79
        else
80
        if(ACCInEn == 1'b1)
81
                rACCDataOut <= ACCDataIn;
82
        else
83
                rACCDataOut <= rACCDataOut;
84
end
85
endmodule

powered by: WebSVN 2.1.0

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