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

Subversion Repositories gng

[/] [gng/] [trunk/] [rtl/] [gng_smul_16_18.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 guangxi.li
//------------------------------------------------------------------------------
2
//
3
// gng_smul_16_18.v
4
//
5
// This file is part of the Gaussian Noise Generator IP Core
6
//
7
// Description
8
//     Signed multiplier 16-bit x 18-bit, delay 2 cycles.
9
//
10
//------------------------------------------------------------------------------
11
//
12
// Copyright (C) 2014, Guangxi Liu <guangxi.liu@opencores.org>
13
//
14
// This source file may be used and distributed without restriction provided
15
// that this copyright statement is not removed from the file and that any
16
// derivative work contains the original copyright notice and the associated
17
// disclaimer.
18
//
19
// This source file is free software; you can redistribute it and/or modify it
20
// under the terms of the GNU Lesser General Public License as published by
21
// the Free Software Foundation; either version 2.1 of the License,
22
// or (at your option) any later version.
23
//
24
// This source is distributed in the hope that it will be useful, but
25
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
26
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
27
// License for more details.
28
//
29
// You should have received a copy of the GNU Lesser General Public License
30
// along with this source; if not, download it from
31
// http://www.opencores.org/lgpl.shtml
32
//
33
//------------------------------------------------------------------------------
34
 
35
 
36
`timescale 1 ns / 1 ps
37
 
38
 
39
module gng_smul_16_18 (
40
    // System signals
41
    input clk,                  // system clock
42
 
43
    // Data interface
44
    input [15:0] a,             // multiplicand
45
    input [17:0] b,             // multiplicator
46
    output [33:0] p             // result
47
);
48
 
49
// Behavioral model
50
reg signed [15:0] a_reg;
51
reg signed [17:0] b_reg;
52
reg signed [33:0] prod;
53
 
54
always @ (posedge clk) begin
55
    a_reg <= a;
56
    b_reg <= b;
57
end
58
 
59
always @ (posedge clk) begin
60
    prod <= a_reg * b_reg;
61
end
62
 
63
assign p = prod;
64
 
65
 
66
endmodule

powered by: WebSVN 2.1.0

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