logical problem !

Discussion in 'VHDL' started by quantum_dot, Sep 17, 2007.

  1. quantum_dot

    quantum_dot

    Joined:
    Nov 21, 2006
    Messages:
    31
    Likes Received:
    0
    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 ?

    :banghead:
     
    quantum_dot, Sep 17, 2007
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dangerlee

    logical left shifter or latch ??

    dangerlee, May 5, 2004, in forum: VHDL
    Replies:
    4
    Views:
    1,071
    Egbert Molenkamp
    May 7, 2004
  2. Weng Tianxiang
    Replies:
    12
    Views:
    1,731
  3. Guest
    Replies:
    3
    Views:
    550
    Ken Cox [Microsoft MVP]
    Dec 30, 2003
  4. =?Utf-8?B?QWxzdGVyc2pv?=

    List logical disks on remote server

    =?Utf-8?B?QWxzdGVyc2pv?=, Jul 8, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    367
    =?Utf-8?B?QWxzdGVyc2pv?=
    Jul 8, 2004
  5. Gerhard Rapp

    How to simplify logical expressions?

    Gerhard Rapp, Jul 29, 2003, in forum: Java
    Replies:
    2
    Views:
    1,460
    Peter Schoaff
    Jul 30, 2003
  6. Jahren
    Replies:
    0
    Views:
    965
    Jahren
    Dec 6, 2007
  7. Andreas Eibach
    Replies:
    7
    Views:
    515
    CBFalconer
    Nov 16, 2008
  8. focode
    Replies:
    14
    Views:
    854
    Arne Vajhøj
    Jan 4, 2010
Loading...