URL
https://opencores.org/ocsvn/xucpu/xucpu/trunk
[/] [xucpu/] [trunk/] [VHDL/] [pipeline/] [adder.vhdl] - Blame information for rev 16
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
2 |
lcdsgmtr |
-- Copyright 2015, Jürgen Defurne
|
2 |
|
|
--
|
3 |
|
|
-- This file is part of the Experimental Unstable CPU System.
|
4 |
|
|
--
|
5 |
|
|
-- The Experimental Unstable CPU System Is free software: you can redistribute
|
6 |
|
|
-- it and/or modify it under the terms of the GNU Lesser General Public License
|
7 |
|
|
-- as published by the Free Software Foundation, either version 3 of the
|
8 |
|
|
-- License, or (at your option) any later version.
|
9 |
|
|
--
|
10 |
|
|
-- The Experimental Unstable CPU System is distributed in the hope that it will
|
11 |
|
|
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
13 |
|
|
-- General Public License for more details.
|
14 |
|
|
--
|
15 |
|
|
-- You should have received a copy of the GNU Lesser General Public License
|
16 |
|
|
-- along with Experimental Unstable CPU System. If not, see
|
17 |
|
|
-- http://www.gnu.org/licenses/lgpl.txt.
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
LIBRARY ieee;
|
21 |
|
|
USE ieee.std_logic_1164.ALL;
|
22 |
|
|
USE ieee.numeric_std.ALL;
|
23 |
|
|
|
24 |
|
|
ENTITY adder IS
|
25 |
|
|
|
26 |
|
|
PORT (
|
27 |
|
|
ADDEND : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
|
28 |
|
|
SUM : OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
|
29 |
|
|
|
30 |
|
|
END ENTITY adder;
|
31 |
|
|
|
32 |
|
|
ARCHITECTURE Behavioral OF adder IS
|
33 |
|
|
|
34 |
|
|
BEGIN -- ARCHITECTURE Behavioral
|
35 |
|
|
|
36 |
|
|
-- purpose: Incrementing circuit
|
37 |
|
|
-- type : combinational
|
38 |
|
|
-- inputs : Q0 (output from first pipeline register)
|
39 |
|
|
-- outputs: D0 (input to first pipeline register)
|
40 |
|
|
PROCESS (ADDEND) IS
|
41 |
|
|
BEGIN -- PROCESS
|
42 |
|
|
IF ADDEND = "11111111" THEN
|
43 |
|
|
SUM <= "00000000";
|
44 |
|
|
ELSE
|
45 |
|
|
SUM <= STD_LOGIC_VECTOR(UNSIGNED(ADDEND) + 1);
|
46 |
|
|
END IF;
|
47 |
|
|
END PROCESS;
|
48 |
|
|
|
49 |
|
|
END ARCHITECTURE Behavioral;
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.