CMX
CMX firmware code in-line documentation
 All Classes Namespaces Files Functions Variables
compExch.vhd
Go to the documentation of this file.
1 
11 
12 library IEEE;
13 use IEEE.STD_LOGIC_1164.ALL;
14 
15 -- Uncomment the following library declaration if using
16 -- arithmetic functions with Signed or Unsigned values
17 use IEEE.NUMERIC_STD.ALL;
18 
19 use work.CMXpackage.all;
21 
22 
23 entity compExch is
24  Port(
25  A, B : in JetTOB;
26  H, L : out JetTOB);
27 
28 end compExch;
29 
30 architecture Behavioral of compExch is
31 
32  signal FlippedPair : arr_TOB(1 downto 0);
33  signal UnFlippedPair : arr_TOB(1 downto 0);
34  signal ResultPair : arr_TOB(1 downto 0);
35 
36 begin
37 
38  UnFlippedPair(0)<=A;
39  UnFlippedPair(1)<=B;
40 
41  FlippedPair(0)<=B;
42  FlippedPair(1)<=A;
43 
44  ResultPair<=UnFlippedPair when A.Et2>=B.Et2 else FlippedPair;
45 
46  H<=ResultPair(0);
47  L<=ResultPair(1);
48 
49 
50 end Behavioral;
51 
in BJetTOB
Definition: compExch.vhd:25
out HJetTOB
Definition: compExch.vhd:26
arr_TOB (1 downto 0) FlippedPair
Definition: compExch.vhd:32
in AJetTOB
Definition: compExch.vhd:25
_library_ workwork
arr_TOB (1 downto 0) ResultPair
Definition: compExch.vhd:34
out LJetTOB
Definition: compExch.vhd:26
arr_TOB (1 downto 0) UnFlippedPair
Definition: compExch.vhd:33
_library_ ieeeieee