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

Subversion Repositories integer_square_root

[/] [integer_square_root/] [trunk/] [src/] [pipe_mult.sv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ayka
`timescale 1ns / 100ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// Company:
4
// Engineer: Yihua Liu
5
//
6
// Create Date: 2022/06/06 13:54:21
7
// Design Name:
8
// Module Name: mult
9
// Project Name: lab_3_a
10
// Target Devices: xczu7eg-ffvf1517-2-i
11
// Tool Versions:
12
// Description:
13
//
14
// Dependencies:
15
//
16
// Revision:
17
// Revision 0.01 - File Created
18
// Additional Comments:
19
//
20
//////////////////////////////////////////////////////////////////////////////////
21
 
22
 
23
// This is an 8 stage (9 depending on how you look at it) pipelined
24
// multiplier that multiplies 2 64-bit integers and returns the low 64 bits
25
// of the result.  This is not an ideal multiplier but is sufficient to
26
// allow a faster clock period than straight *
27
// This module instantiates 8 pipeline stages as an array of submodules.
28
module mult(
29
                                input clock, reset,
30
                                input [63:0] mcand, mplier,
31
                                input start,
32
 
33
                                output [63:0] product,
34
                                output done
35
                        );
36
 
37
        // This parameter is used to change the number of stages.
38
        // For example, if N_STAGE = 8, we are using an 8-stage pipelined multiplier.
39
    parameter N_STAGE = 8;
40
        logic [63:0] mcand_out, mplier_out;
41
        logic [(N_STAGE-1)*64-1:0] internal_products, internal_mcands, internal_mpliers;
42
        logic [N_STAGE-2:0] internal_dones;
43
 
44
        mult_stage #(.N_STAGE(N_STAGE)) mstage [N_STAGE-1:0]  (
45
                .clock(clock),
46
                .reset(reset),
47
                .product_in({internal_products,64'h0}),
48
                .mplier_in({internal_mpliers,mplier}),
49
                .mcand_in({internal_mcands,mcand}),
50
                .start({internal_dones,start}),
51
                .product_out({product,internal_products}),
52
                .mplier_out({mplier_out,internal_mpliers}),
53
                .mcand_out({mcand_out,internal_mcands}),
54
                .done({done,internal_dones})
55
        );
56
 
57
endmodule

powered by: WebSVN 2.1.0

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