Sep 3, 2007 #1 V vlsi_freak Full Member level 2 Joined Sep 3, 2007 Messages 127 Helped 14 Reputation 28 Reaction score 8 Trophy points 1,298 Activity points 2,041 Which one would you use and why? I vote for the first method??? signal a_sig : std_logic_vector(n downto 0); signal b_sig : std_logic_vector(n downto 0); process(a_sig,bsig) variable c_sig : std_logic_vector(n downto 0); begin c_sig := a_sig-bsig; a_is_smaller <= c_sig(c_sig'high); end process; process(a_sig,bsig) variable c_sig : std_logic_vector(n downto 0); begin if(asig < bsig) then a_is_smaller <= '1'; else a_is_smaller <= '0'; end if; end process;
Which one would you use and why? I vote for the first method??? signal a_sig : std_logic_vector(n downto 0); signal b_sig : std_logic_vector(n downto 0); process(a_sig,bsig) variable c_sig : std_logic_vector(n downto 0); begin c_sig := a_sig-bsig; a_is_smaller <= c_sig(c_sig'high); end process; process(a_sig,bsig) variable c_sig : std_logic_vector(n downto 0); begin if(asig < bsig) then a_is_smaller <= '1'; else a_is_smaller <= '0'; end if; end process;
Sep 3, 2007 #2 lordsathish Full Member level 5 Joined Feb 11, 2006 Messages 246 Helped 33 Reputation 66 Reaction score 3 Trophy points 1,298 Location Asia Activity points 2,698 Re: Which one is good I think the answer to your question depens upon the synthesis tool that you use...the less than comparator might have less number of gates than the subractor... so i guess the second code will be better...
Re: Which one is good I think the answer to your question depens upon the synthesis tool that you use...the less than comparator might have less number of gates than the subractor... so i guess the second code will be better...
Sep 4, 2007 #3 gck Full Member level 3 Joined Oct 17, 2006 Messages 173 Helped 26 Reputation 52 Reaction score 19 Trophy points 1,298 Activity points 2,220 Re: Which one is good First approch is just taking one substractor and second approch is taking comparator. First approch is taking less combinational delay than second one. So I will also go for First approch.
Re: Which one is good First approch is just taking one substractor and second approch is taking comparator. First approch is taking less combinational delay than second one. So I will also go for First approch.
Sep 4, 2007 #4 A ameed Advanced Member level 4 Joined Jun 28, 2007 Messages 106 Helped 6 Reputation 12 Reaction score 1 Trophy points 1,298 Location INDIA Activity points 1,931 Re: Which one is good hi, depends on synthesis tool. thanx......