------------------------------------------------------------------------------- -- Title : Deflection Projection Unit -- Project : Prototype implementation of the GTU of the Alice TRD Experiment ------------------------------------------------------------------------------- -- File : proj_d.vhd -- Author : Jan de Cuveland -- Company : -- Last update: 2003/06/03 -- Platform : ------------------------------------------------------------------------------- -- This is a prototype implementation of the Global Tracking Unit (GTU) -- of the Alice TRD detector. ------------------------------------------------------------------------------- -- Description: This unit converts a deflection length into a deflection angle ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2003/01/21 1.0 cuveland Created ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use work.gtu_types.all; ------------------------------------------------------------------------------- entity proj_d is generic ( plane : integer := 0); -- 0..5 port ( d : in signed(deflen_width-1 downto 0); -- deflection length y : in signed(ypos_width-1 downto 0); -- y position d_out : out signed(deflang_width-1 downto 0)); -- deflection angle end proj_d; ------------------------------------------------------------------------------- architecture default of proj_d is constant excess_ypos : integer := 4; constant excess_result : integer := 10; function const ( constant plane : integer) return signed is variable r : real; variable i : integer; begin r := ypos_resolution * thickness / (deflen_resolution * radius(plane)); i := integer(r * real(2 ** (excess_ypos+excess_result+1))); return conv_signed(i, deflang_width-ypos_width+excess_ypos+excess_result+1); end const; -- constant factor constant c : signed(deflang_width-ypos_width+excess_ypos+excess_result downto 0) := const(plane); -- y position signal ypos : signed(ypos_width-excess_ypos-1 downto 0); -- deflection length signal d_ext : signed(deflang_width downto 0); -- deflection angle signal s : signed(deflang_width downto 0); -- approx. vertex angle signal p : signed(deflang_width+excess_result downto 0); signal v_ext : signed(deflang_width downto 0); begin -- default ypos <= y(y'high downto excess_ypos); p <= ypos * c; v_ext <= p(p'high downto excess_result); d_ext <= d & "0"; s <= d_ext - v_ext + 1; d_out <= s(s'high downto 1); end default;