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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [rtl/] [rca.sv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 vladimirar
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Low Pass Filter FIR IP Core                                 ////
4
////                                                              ////
5
////  This file is part of the LPFFIR project                     ////
6
////  https://opencores.org/projects/lpffir                       ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Implementation of LPFFIR IP core according to               ////
10
////  LPFFIR IP core specification document.                      ////
11
////                                                              ////
12
////  To Do:                                                      ////
13
////  -                                                           ////
14
////                                                              ////
15
////  Author:                                                     ////
16
////  - Vladimir Armstrong, vladimirarmstrong@opencores.org       ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2019 Authors and OPENCORES.ORG                 ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE.  See the GNU Lesser General Public License for more ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
 
45
// Ripple Carry Adder: adds two 16-bit numbers
46
module rca(
47
           input [15:0]        a,
48
           input [15:0]        b,
49
           input               ci, // Carry Input
50
 
51
           output logic        co, // Carry Output
52
           output logic [15:0] s // Sum
53
           );
54
 
55
   logic                       a0,a1,a2,a3,a4,a5,a6,a7;
56
   logic                       a8,a9,a10,a11,a12,a13,a14,a15;
57
   logic                       b0,b1,b2,b3,b4,b5,b6,b7;
58
   logic                       b8,b9,b10,b11,b12,b13,b14,b15;
59
   logic                       c0,c1,c2,c3,c4,c5,c6,c7;
60
   logic                       c8,c9,c10,c11,c12,c13,c14;
61
   logic                       s0,s1,s2,s3,s4,s5,s6,s7;
62
   logic                       s8,s9,s10,s11,s12,s13,s14,s15;
63
 
64
   assign a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];
65
   assign a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7];
66
   assign a8 = a[8], a9 = a[9], a10 = a[10];
67
   assign a11 = a[11], a12 = a[12], a13 = a[13];
68
   assign a14 = a[14], a15 = a[15];
69
   assign b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
70
   assign b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7];
71
   assign b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11];
72
   assign b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];
73
   assign s[0] = s0, s[1] = s1, s[2] = s2, s[3] = s3;
74
   assign s[4] = s4, s[5] = s5,s[6] = s6, s[7] = s7;
75
   assign s[8] = s8, s[9] = s9, s[10] = s10, s[11] = s11;
76
   assign s[12] = s12, s[13] = s13, s[14] = s14, s[15] = s15;
77
 
78
   fa fa_inst0(.a(a0),.b(b0),.ci(ci),.co(c0),.s(s0));
79
   fa fa_inst1(.a(a1),.b(b1),.ci(c0),.co(c1),.s(s1));
80
   fa fa_inst2(.a(a2),.b(b2),.ci(c1),.co(c2),.s(s2));
81
   fa fa_inst3(.a(a3),.b(b3),.ci(c2),.co(c3),.s(s3));
82
   fa fa_inst4(.a(a4),.b(b4),.ci(c3),.co(c4),.s(s4));
83
   fa fa_inst5(.a(a5),.b(b5),.ci(c4),.co(c5),.s(s5));
84
   fa fa_inst6(.a(a6),.b(b6),.ci(c5),.co(c6),.s(s6));
85
   fa fa_inst7(.a(a7),.b(b7),.ci(c6),.co(c7),.s(s7));
86
   fa fa_inst8(.a(a8),.b(b8),.ci(c7),.co(c8),.s(s8));
87
   fa fa_inst9(.a(a9),.b(b9),.ci(c8),.co(c9),.s(s9));
88
   fa fa_inst10(.a(a10),.b(b10),.ci(c9),.co(c10),.s(s10));
89
   fa fa_inst11(.a(a11),.b(b11),.ci(c10),.co(c11),.s(s11));
90
   fa fa_inst12(.a(a12),.b(b12),.ci(c11),.co(c12),.s(s12));
91
   fa fa_inst13(.a(a13),.b(b13),.ci(c12),.co(c13),.s(s13));
92
   fa fa_inst14(.a(a14),.b(b14),.ci(c13),.co(c14),.s(s14));
93
   fa fa_inst15(.a(a15),.b(b15),.ci(c14),.co(co),.s(s15));
94
 
95
endmodule

powered by: WebSVN 2.1.0

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