Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/HDLRuby/hruby_tools.rb
Overview
Extends the Integer class for computing the bit width.
Instance Method Summary collapse
-
#width ⇒ Object
Gets the bit width.
Instance Method Details
#width ⇒ Object
Gets the bit width
32 33 34 |
# File 'lib/HDLRuby/hruby_tools.rb', line 32 def width return Math.log2(self+1).ceil end |