signal tx_ref_clk_i       : std_logic;
 
   signal tx_dlm_word_i      : std_logic_vector(7 downto 0);
-  signal tx_dlm_i           : std_logic;
 
   signal tx_rst_word_i      : std_logic_vector(4*8-1 downto 0);
   signal tx_rst_i           : std_logic_vector(3 downto 0);
   signal link_rx_ready_i    : std_logic_vector(3 downto 0);
   signal tx_clk_avail_sel   : std_logic;
   
+  signal word_sync_i        : std_logic_vector(3 downto 0);
+  signal word_sync_sel      : std_logic;
+  
   signal quad_mode : integer range 0 to 100;
 
 begin
                       '1';
 
   TX_CLK_AVAIL_OUT <= tx_clk_avail_sel;
-  
+
+-------------------------------------------------      
+-- byte/word alignment
+-------------------------------------------------      
+  word_sync_sel <= word_sync_i(0) when ((quad_mode >= 8) and (IS_MODE(0) = c_IS_SLAVE)) else
+                   word_sync_i(1) when ((quad_mode >= 8) and (IS_MODE(1) = c_IS_SLAVE)) else
+                   word_sync_i(2) when ((quad_mode >= 8) and (IS_MODE(2) = c_IS_SLAVE)) else
+                   word_sync_i(3) when ((quad_mode >= 8) and (IS_MODE(3) = c_IS_SLAVE)) else
+                   '1';
+
+  WORD_SYNC_OUT <= word_sync_sel;
+
 -------------------------------------------------      
 -- reset komma receive
 -- output only if a slave port is available in QUAD
         RX_K_IN            => rx_k(i),
         -- ports for synchronous operation
         WORD_SYNC_IN       => WORD_SYNC_IN,
-        WORD_SYNC_OUT      => WORD_SYNC_OUT, 
+        WORD_SYNC_OUT      => word_sync_i(i), 
         GLOBAL_RESET_IN    => GLOBAL_RESET_IN,
         GLOBAL_RESET_OUT   => global_reset_i(i),
         LINK_TX_READY_IN   => LINK_TX_READY_IN,
         LINK_RX_READY_OUT  => link_rx_ready_i(i),
         -- komma operation
-        TX_DLM_IN          => tx_dlm_i,
+        TX_DLM_IN          => TX_DLM_IN,
         TX_DLM_WORD_IN     => tx_dlm_word_i,
         TX_RST_IN          => tx_rst_i(i),
         TX_RST_WORD_IN     => tx_rst_word_i(i*8+7 downto i*8),
   
 --  DEBUG_OUT <= debug_i(3*32+31 downto 3*32);
   DEBUG_OUT(11 downto 0)  <= debug_i(3*32+11 downto 3*32);
-  DEBUG_OUT(12)           <= wa_read_i;
-  DEBUG_OUT(13)           <= tx_clk_avail_sel;
-  DEBUG_OUT(14)           <= GLOBAL_RESET_IN;
-  DEBUG_OUT(15)           <= '0';
+  DEBUG_OUT(12)           <= debug_tx_control_i(3*32+4);
+  DEBUG_OUT(13)           <= debug_tx_control_i(3*32+5);
+  DEBUG_OUT(14)           <= debug_tx_control_i(3*32+30);
+  DEBUG_OUT(15)           <= debug_tx_control_i(3*32+31);
   DEBUG_OUT(31 downto 16) <= debug_i(3*32+31 downto 3*32+16);
   
 end architecture;