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

Subversion Repositories sqmusic

[/] [sqmusic/] [trunk/] [sqm/] [sqm_amp.v] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gryzor
/*
2
        SQmusic
3
        logarithmic digital amplifier to use with SQMUSIC
4
  Version 0.1, tested on simulation only with Capcom's 1942
5
 
6
  (c) Jose Tejada Gomez, 9th May 2013
7
  You can use this file following the GNU GENERAL PUBLIC LICENSE version 3
8
  Read the details of the license in:
9
  http://www.gnu.org/licenses/gpl.txt
10
 
11
  Send comments to: jose.tejada@ieee.org
12
 
13
*/
14
`timescale 1ns / 1ps
15
module SQM_AMP(
16
        input [3:0]A, input [3:0]B, input [3:0]C, // input channels
17
        output [15:0] Y
18
);
19
 
20
wire[11:0] Alog, Blog, Clog;
21
 
22
SQM_LOG adac( .din(A), .dout(Alog) );
23
SQM_LOG bdac( .din(B), .dout(Blog) );
24
SQM_LOG cdac( .din(C), .dout(Clog) );
25
//always @(*)
26
assign Y=Alog+Blog+Clog;
27
endmodule
28
 
29
module SQM_LOG(
30
        input [3:0]din,
31
        output reg [11:0]dout );
32
 
33
always @(din)
34
        case (din)
35
                0: dout=0;
36
                1: dout=16;
37
                2: dout=19;
38
                3: dout=32;
39
                4: dout=39;
40
                5: dout=64;
41
                6: dout=78;
42
                7: dout=128;
43
                8: dout=155;
44
                9: dout=256;
45
         10: dout=310;
46
         11: dout=512;
47
         12: dout=621;
48
         13: dout=1024;
49
         14: dout=1448;
50
         15: dout=2048;
51
        endcase
52
 
53
endmodule

powered by: WebSVN 2.1.0

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