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

Subversion Repositories rtf68ksys

[/] [rtf68ksys/] [trunk/] [rtl/] [verilog/] [PSGChannelSummer.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robfinch
/* ============================================================================
2
        (C) 2007  Robert Finch
3
        All rights reserved.
4
        rob@birdcomputer.ca
5
 
6
        PSGChannelSummer.v
7
                Sums the channel outputs.
8
 
9
    This source code is available for evaluation and validation purposes
10
    only. This copyright statement and disclaimer must remain present in
11
    the file.
12
 
13
 
14
        NO WARRANTY.
15
    THIS Work, IS PROVIDEDED "AS IS" WITH NO WARRANTIES OF ANY KIND, WHETHER
16
    EXPRESS OR IMPLIED. The user must assume the entire risk of using the
17
    Work.
18
 
19
    IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
20
    INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES WHATSOEVER RELATING TO
21
    THE USE OF THIS WORK, OR YOUR RELATIONSHIP WITH THE AUTHOR.
22
 
23
    IN ADDITION, IN NO EVENT DOES THE AUTHOR AUTHORIZE YOU TO USE THE WORK
24
    IN APPLICATIONS OR SYSTEMS WHERE THE WORK'S FAILURE TO PERFORM CAN
25
    REASONABLY BE EXPECTED TO RESULT IN A SIGNIFICANT PHYSICAL INJURY, OR IN
26
    LOSS OF LIFE. ANY SUCH USE BY YOU IS ENTIRELY AT YOUR OWN RISK, AND YOU
27
    AGREE TO HOLD THE AUTHOR AND CONTRIBUTORS HARMLESS FROM ANY CLAIMS OR
28
    LOSSES RELATING TO SUCH UNAUTHORIZED USE.
29
 
30
        Spartan3
31
        1255 LUTs / 975 slices / 56MHz
32
============================================================================ */
33
 
34
module PSGChannelSummer(clk_i, cnt, outctrl, tmc_i, o);
35
input clk_i;                    // master clock
36
input [7:0] cnt;         // select counter
37
input [3:0] outctrl;     // channel output enable control
38
input [19:0] tmc_i;              // time-multiplexed channel input
39
output [21:0] o;         // summed output
40
reg [21:0] o;
41
 
42
// channel select signal
43
wire [1:0] sel = cnt[1:0];
44
 
45
always @(posedge clk_i)
46
        if (cnt==8'd0)
47
                o <= 22'd0 + (tmc_i & {20{outctrl[sel]}});
48
        else if (cnt < 8'd4)
49
                o <= o + (tmc_i & {20{outctrl[sel]}});
50
 
51
endmodule

powered by: WebSVN 2.1.0

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