[sv-bc] RE: clog2 problem

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Tue Jan 22 2008 - 08:27:14 PST
Shalom,

 

No. I meant "N | 1" (the bitwise or operator). I didn't use + because
addition could cause a wrap-around to 0 and distort the result.

Using "N | 1" works for all positive numbers, even 0. (btw, I changed
the subject line)

 

            Arturo

 

________________________________

From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com] 
Sent: Tuesday, January 22, 2008 2:05 AM
To: Arturo Salz; sv-bc@eda.org
Subject: RE: [sv-bc] Agenda: January 21, 2008 SV-BC Meeting (NOTE: NEW
CALL LOGISTICS)

 

Arturo,

 

Did you mean $clog2(N+1) ?

 

Thanks,

Shalom

	 

	 

	The second paragraph has led some users to believe that $clog2
returns the minimum number of bits needed to store a particular value,
but, that is not true if $clog2 is indeed ceil( log2( N ) ). The general
expression needed to determine the minimum number of bits would be
$clog2(N | 1) not  $clog2(N). 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Jan 22 08:29:40 2008

This archive was generated by hypermail 2.1.8 : Tue Jan 22 2008 - 08:30:08 PST