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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [rtl/] [bigsub.v] - Blame information for rev 3

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

Line No. Rev Author Line
1 3 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    bigsub.v
4
//
5
// Project:     OpenArty, an entirely open SoC based upon the Arty platform
6
//
7
// Purpose:     
8
//
9
// Creator:     Dan Gisselquist, Ph.D.
10
//              Gisselquist Technology, LLC
11
//
12
////////////////////////////////////////////////////////////////////////////////
13
//
14
// Copyright (C) 2016, Gisselquist Technology, LLC
15
//
16
// This program is free software (firmware): you can redistribute it and/or
17
// modify it under the terms of  the GNU General Public License as published
18
// by the Free Software Foundation, either version 3 of the License, or (at
19
// your option) any later version.
20
//
21
// This program is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26
// You should have received a copy of the GNU General Public License along
27
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
28
// target there if the PDF file isn't present.)  If not, see
29
// <http://www.gnu.org/licenses/> for a copy.
30
//
31
// License:     GPL, v3, as defined and found on www.gnu.org,
32
//              http://www.gnu.org/licenses/gpl.html
33
//
34
//
35
////////////////////////////////////////////////////////////////////////////////
36
//
37
//
38
module  bigsub(i_clk, i_sync, i_a, i_b, o_r, o_sync);
39
        input                   i_clk, i_sync;
40
        input           [63:0]   i_a, i_b;
41
        output  reg     [63:0]   o_r;
42
        output  reg     o_sync;
43
 
44
        reg             r_sync, r_pps;
45
        reg     [31:0]   r_hi_a, r_hi_b, r_low;
46
 
47
        initial r_sync = 1'b0;
48
        always @(posedge i_clk)
49
                r_sync <= i_sync;
50
 
51
        always @(posedge i_clk)
52
                { r_pps, r_low } <= i_a[31:0] + ({1'b1,~i_b[31:0]}) + 1'b1;
53
        always @(posedge i_clk)
54
                r_hi_a <= i_a[63:32];
55
        always @(posedge i_clk)
56
                r_hi_b <= ~i_b[63:32];
57
 
58
        initial o_sync = 1'b0;
59
        always @(posedge i_clk)
60
                o_sync <= r_sync;
61
        always @(posedge i_clk)
62
                o_r[31:0] <= r_low;
63
        always @(posedge i_clk)
64
                o_r[63:32] <= r_hi_a + r_hi_b + { 31'h00, r_pps };
65
 
66
endmodule

powered by: WebSVN 2.1.0

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