Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - logical problem !

 
Thread Tools Search this Thread
Old 09-17-2007, 09:20 AM   #1
Default logical problem !


I need to find out the first occurence of bit '1' in a 64 bit number, starting from LSB, in shortest possible clock cycles. The result should be a number indicating the position of first occurence of bit '1'.

For eg. 0xA00C00000000000C
Here the first occurence of bit '1' starting from LSB is at bit position number 3. Hence the answer should be binary "100".

My approach: I thought of generating 2's complement of the given number and then simply ANDing the given number and its 2's complement, should give the correct position number.

Is there any other way of finding the same thing in just one clock cycle ?



quantum_dot
quantum_dot is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dial Up Problem smackedass A+ Certification 3 02-02-2007 11:59 PM
Re: storage problem bopper2 A+ Certification 0 06-04-2005 05:50 AM
Re: Virus Problem ** Help!** David BlandIII A+ Certification 1 03-02-2004 06:00 PM
Re: Serious Computer Problem hootnholler A+ Certification 1 11-24-2003 12:18 PM
Re: Serious Computer Problem Bret A+ Certification 0 11-19-2003 12:51 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46