ucb-bar / chisel2-deprecated

chisel.eecs.berkeley.edu
388 stars 90 forks source link

Improve log2* functions, as with Chisel3 #693

Closed aswaterman closed 8 years ago

aswaterman commented 8 years ago

The previous ones were incorrect for large inputs because of inexact floating-point arithmetic. These use BigInt so are exact. This also fixes log2Up(0) to conform to the documentation.