1 |
14 |
arif_endro |
-- $Id: fulladder.vhdl,v 1.3 2005-03-04 08:06:19 arif_endro Exp $
|
2 |
2 |
arif_endro |
-------------------------------------------------------------------------------
|
3 |
|
|
-- Title : Full Adder component
|
4 |
|
|
-- Project : FM Receiver
|
5 |
|
|
-------------------------------------------------------------------------------
|
6 |
|
|
-- File : fulladder.vhdl
|
7 |
|
|
-- Author : "Arif E. Nugroho" <arif_endro@yahoo.com>
|
8 |
|
|
-- Created : 2004/12/01
|
9 |
|
|
-- Last update :
|
10 |
13 |
arif_endro |
-- Simulators :
|
11 |
2 |
arif_endro |
-- Synthesizers:
|
12 |
|
|
-- Target :
|
13 |
|
|
-------------------------------------------------------------------------------
|
14 |
|
|
-- Description : Simple one bit adder with carry
|
15 |
|
|
-------------------------------------------------------------------------------
|
16 |
39 |
arif_endro |
-- Copyright (C) 2004 Arif Endro Nugroho
|
17 |
2 |
arif_endro |
-------------------------------------------------------------------------------
|
18 |
13 |
arif_endro |
--
|
19 |
|
|
-- THIS SOURCE FILE MAY BE USED AND DISTRIBUTED WITHOUT RESTRICTION
|
20 |
|
|
-- PROVIDED THAT THIS COPYRIGHT STATEMENT IS NOT REMOVED FROM THE FILE AND THAT
|
21 |
|
|
-- ANY DERIVATIVE WORK CONTAINS THE ORIGINAL COPYRIGHT NOTICE AND THE
|
22 |
|
|
-- ASSOCIATED DISCLAIMER.
|
23 |
|
|
--
|
24 |
|
|
-------------------------------------------------------------------------------
|
25 |
|
|
--
|
26 |
|
|
-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
27 |
|
|
-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
28 |
|
|
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
29 |
|
|
-- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
30 |
|
|
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
31 |
|
|
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
32 |
|
|
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
33 |
|
|
-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
34 |
|
|
-- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
35 |
|
|
-- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
36 |
|
|
--
|
37 |
|
|
-------------------------------------------------------------------------------
|
38 |
2 |
arif_endro |
|
39 |
|
|
library IEEE;
|
40 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
41 |
|
|
|
42 |
|
|
entity fulladder is
|
43 |
|
|
port (
|
44 |
|
|
addend : in bit;
|
45 |
|
|
augend : in bit;
|
46 |
|
|
carry_in : in bit;
|
47 |
|
|
sum : out bit;
|
48 |
|
|
carry : out bit
|
49 |
|
|
);
|
50 |
|
|
end fulladder;
|
51 |
|
|
|
52 |
|
|
architecture data_flow of fulladder is
|
53 |
|
|
begin
|
54 |
|
|
sum <= ((addend xor augend) xor carry_in);
|
55 |
|
|
carry <= ((addend and augend) or (carry_in and (addend or augend)));
|
56 |
|
|
end data_flow;
|