Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_tools.rb,
lib/HDLRuby/hruby_verilog.rb
Overview
class Fixnum def to_verilog to_s end end
Instance Method Summary collapse
-
#to_expr ⇒ Object
Converts to a new high-level expression.
- #to_verilog ⇒ Object
-
#width ⇒ Object
Gets the bit width.
Instance Method Details
#to_expr ⇒ Object
Converts to a new high-level expression.
3901 3902 3903 |
# File 'lib/HDLRuby/hruby_high.rb', line 3901 def to_expr return Value.new(Integer,self) end |
#to_verilog ⇒ Object
34 35 36 |
# File 'lib/HDLRuby/hruby_verilog.rb', line 34 def to_verilog to_s end |
#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 |