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

Subversion Repositories hwlu

[/] [hwlu/] [trunk/] [rtl/] [vhdl/] [add_dw.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 kavi
----==============================================================----
2
----                                                              ----
3
---- Filename: add_dw.vhd                                         ----
4
---- Module description: Generic DW-bit binary adder              ----
5
----                                                              ----
6
---- Author: Nikolaos Kavvadias                                   ----
7
----         nkavv@skiathos.physics.auth.gr                       ----
8
----                                                              ---- 
9
----                                                              ----
10
---- Downloaded from: http://wwww.opencores.org/cores/hwlu        ----
11
----                                                              ----
12
---- To Do:                                                       ----
13
----         Probably remains as current                          ---- 
14
----         (to promote as stable version)                       ----
15
----                                                              ----
16
---- Author: Nikolaos Kavvadias                                   ----
17
----         nkavv@skiathos.physics.auth.gr                       ----
18
----                                                              ----
19
----==============================================================----
20
----                                                              ----
21
---- Copyright (C) 2004 Nikolaos Kavvadias                        ----
22
----                    nick-kavi.8m.com                          ----
23
----                    nkavv@skiathos.physics.auth.gr            ----
24
----                    nick_ka_vi@hotmail.com                    ----
25
----                                                              ----
26
---- This source file may be used and distributed without         ----
27
---- restriction provided that this copyright statement is not    ----
28
---- removed from the file and that any derivative work contains  ----
29
---- the original copyright notice and the associated disclaimer. ----
30
----                                                              ----
31
---- This source file is free software; you can redistribute it   ----
32
---- and/or modify it under the terms of the GNU Lesser General   ----
33
---- Public License as published by the Free Software Foundation; ----
34
---- either version 2.1 of the License, or (at your option) any   ----
35
---- later version.                                               ----
36
----                                                              ----
37
---- This source is distributed in the hope that it will be       ----
38
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
39
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
40
---- PURPOSE. See the GNU Lesser General Public License for more  ----
41
---- details.                                                     ----
42
----                                                              ----
43
---- You should have received a copy of the GNU Lesser General    ----
44
---- Public License along with this source; if not, download it   ----
45
---- from <http://www.opencores.org/lgpl.shtml>                   ----
46
----                                                              ----
47
----==============================================================----
48
--
49
-- CVS Revision History
50
--    
51
 
52
library IEEE;
53
use IEEE.std_logic_1164.all;
54
use IEEE.std_logic_unsigned.all;
55
 
56
 
57
entity add is
58
  generic (
59
    DW : integer := 8
60
  );
61
  port (
62
    a   : in std_logic_vector(DW-1 downto 0);
63
    b   : in std_logic_vector(DW-1 downto 0);
64
    sum : out std_logic_vector(DW-1 downto 0)
65
  );
66
end add;
67
 
68
 
69
architecture structural of add is
70
signal temp_sum : std_logic_vector(DW downto 0);
71
begin
72
  --
73
  temp_sum <= (a(DW-1) & a) + (b(DW-1) & b);
74
  sum <= temp_sum(DW-1 downto 0);
75
  --
76
end structural;
77
 
78
 

powered by: WebSVN 2.1.0

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