Class: RubyHDL::High::Binary
- Inherits:
-
Expression
- Object
- Expression
- RubyHDL::High::Binary
- Defined in:
- lib/HDLRuby/std/sequencer_sw.rb
Overview
Describes the software implementation of an binary operation.
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(type, operator, left, right) ⇒ Binary
constructor
Create a new binary operation with +type+ data type, operator +operator+ and operands +left+ and +right+.
-
#to_ruby ⇒ Object
Convert to ruby code.
Methods inherited from Expression
#<=, #[], #mux, #sdownto, #seach, #stimes, #supto, #to_expr, #to_value
Constructor Details
#initialize(type, operator, left, right) ⇒ Binary
Create a new binary operation with +type+ data type, operator +operator+ and operands +left+ and +right+.
1739 1740 1741 1742 1743 1744 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1739 def initialize(type,operator,left,right) super(type) @operator = operator.to_sym @left = left.to_expr @right = right.to_expr end |
Instance Method Details
#to_ruby ⇒ Object
Convert to ruby code.
1747 1748 1749 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1747 def to_ruby return RUBY_OPERATOR[@operator] % [ @left.to_ruby, @right.to_ruby ] end |