Forum Discussion
Altera_Forum
Honored Contributor
14 years agohere is more of my code
Reg_P:process (CLK) begin if (CLK'event and CLK='1') then if RESET='1' then p<= (others => '0'); else case CS is ----------------------------------- when S1 => p <= X_in; ----------------------------------- when S7 => if (mul_result = '1') then p <= mul_c; end if; ----------------------------------- when S8 => p <= t; ----------------------------------- when S10 => p <= p(m_size-2 downto 0) & p(m_size-1); ----------------------------------- when others => null; ----------------------------------- end case; end if; end if; end process; ----------------------------------------------- Reg_Q:process (CLK, r_by_2) begin if (CLK'event and CLK='1') then if RESET='1' then q<= (others => '0'); else case CS is ----------------------------------- when S2 => q<=p; ----------------------------------- when S4 => if(r_by_2 = 1) then q <= q (m_size-r_by_2-1 downto 0) & q(m_size-1); else q(m_size-1 downto r_by_2) <= q (m_size - r_by_2 - 1 downto 0); q(r_by_2-1 downto 0) <= q(m_size-1 downto m_size - r_by_2); end if; ----------------------------------- when others => null; ----------------------------------- end case; end if; end if; end process;