leading zero detector

Status
Not open for further replies.

dsocer

Newbie level 6
Joined
Apr 4, 2006
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,370
How can I implement a leading zero detector?
If x+y=z(they are all 50bit),and I want to know the leading zero of z only use x and y,so how can I do that?

Thx!
 

scan from left to right.

stop when first '1' observed xn, yn.
if xn= yn =1 the one left zn+1 bit is leading.
else look at the right xn-1,yn-1 : if xn-1 = yn-1 =1 then it zn again
else if xn-1=yn-1= 0 its zn.
else look at the right xn-2,yn-2

repeat untill x0,y0
 

Thank u! But I think it will became the critical path if I repeat until the last bit.
 

u r right i thought like programmer.

we do 2 test the or test and the and test

the or test will give me the n bit, but also the most left 0 bit location m.

the and test will tell me that if from m+1 to n location theres one one at least,
then its z+1 else z, how simple ....
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…