Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Hardware > leading zeroes

Reply
Thread Tools

leading zeroes

 
 
veevee1 veevee1 is offline
Junior Member
Join Date: Mar 2007
Posts: 6
 
      12-11-2009
hello,

What would be the best way (from fast synthesis point of view) to calculate the amount of leading zeroes from substraction result of two bit vectors.


Is there a way to implement it in more convenient way than described below:

signal A : std_logic_vector(9 downto 0);
signal B : std_logic_vector(9 downto 0);

result <= A - B;


Priority coded comparison:

if result(9) = '0' then

elsif result( = '0' then

elsif result(7) = '0' then....

############################

I'm after a solution like this


lead_zeros <= ?

case lead_zeros is
when 0 =>
when 1 =>
when 2 =>
 

Last edited by veevee1; 12-14-2009 at 08:19 AM..
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL component for counting leading zeroes veevee1 VHDL 0 12-14-2009 04:34 PM
All leading tabs or all leading spaces - why isn't that enforced? John Nagle Python 4 08-07-2007 04:05 PM
RE: All leading tabs or all leading spaces - why isn't that enforced? Delaney, Timothy (Tim) Python 0 08-07-2007 03:50 AM
Leading Zeroes Kevin Marks HTML 2 04-27-2007 02:59 PM
csv and leading zeroes Mike P ASP .Net 1 10-04-2006 03:22 PM



Advertisments