URL
https://opencores.org/ocsvn/xteacore/xteacore/trunk
[/] [xteacore/] [trunk/] [rtl/] [round_f.vhd] - Blame information for rev 2
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
2 |
entactogen |
|
2 |
|
|
-- Copyright (c) 2013 Antonio de la Piedra
|
3 |
|
|
|
4 |
|
|
-- This program is free software: you can redistribute it and/or modify
|
5 |
|
|
-- it under the terms of the GNU General Public License as published by
|
6 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
7 |
|
|
-- (at your option) any later version.
|
8 |
|
|
|
9 |
|
|
-- This program is distributed in the hope that it will be useful,
|
10 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
|
|
-- GNU General Public License for more details.
|
13 |
|
|
|
14 |
|
|
-- You should have received a copy of the GNU General Public License
|
15 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16 |
|
|
|
17 |
|
|
library IEEE;
|
18 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
19 |
|
|
use IEEE.NUMERIC_STD.ALL;
|
20 |
|
|
|
21 |
|
|
entity round_f is
|
22 |
|
|
port(v_in : in std_logic_vector(31 downto 0);
|
23 |
|
|
last_val : in std_logic_vector(31 downto 0);
|
24 |
|
|
v_out : out std_logic_vector(31 downto 0));
|
25 |
|
|
end round_f;
|
26 |
|
|
|
27 |
|
|
architecture Behavioral of round_f is
|
28 |
|
|
|
29 |
|
|
signal op_1_s : std_logic_vector(31 downto 0);
|
30 |
|
|
signal op_2_s : std_logic_vector(31 downto 0);
|
31 |
|
|
signal op_3_s : std_logic_vector(31 downto 0);
|
32 |
|
|
signal op_4_s : std_logic_vector(31 downto 0);
|
33 |
|
|
|
34 |
|
|
begin
|
35 |
|
|
|
36 |
|
|
op_1_s <= (v_in(27 downto 0) & "0000");
|
37 |
|
|
op_2_s <= "00000"& v_in(31 downto 5);
|
38 |
|
|
op_3_s <= op_1_s xor op_2_s;
|
39 |
|
|
op_4_s <= std_logic_vector(unsigned(op_3_s ) + unsigned(v_in));
|
40 |
|
|
v_out <= op_4_s xor last_val;
|
41 |
|
|
|
42 |
|
|
end Behavioral;
|
43 |
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.