Class: RubyRTL::RUIntLit

Inherits:
Literal show all
Defined in:
lib/ruby_rtl/ast.rb

Instance Attribute Summary

Attributes inherited from Literal

#type, #val

Attributes inherited from Ast

#comments

Instance Method Summary collapse

Methods inherited from Ast

#accept

Constructor Details

#initialize(val) ⇒ RUIntLit

Returns a new instance of RUIntLit.



256
257
258
259
260
# File 'lib/ruby_rtl/ast.rb', line 256

def initialize val
  val=val==0 ? 1 : val
  nbits=Math.log2(val).floor + 1
  super(val,RUIntType.new(nbits))
end