Class: RTL::Mux

Inherits:
Circuit show all
Defined in:
lib/rtl/library.rb

Instance Attribute Summary collapse

Attributes inherited from Circuit

#color, #components, #father, #iname, #name, #ports, #properties, #signals

Instance Method Summary collapse

Methods inherited from Circuit

#component_named, #inputs, #make_lib, #new_instance, #outputs, #port, #port_named, #to_dot, #wires

Constructor Details

#initializeMux

Returns a new instance of Mux.



54
55
56
57
58
59
60
61
62
# File 'lib/rtl/library.rb', line 54

def initialize
  name="Mux"
  super(name)
  @arity=0
  add Port.new("i0",:in)
  add Port.new("i1",:in)
  add Port.new("sel",:in)
  add Port.new("f",:out)
end

Instance Attribute Details

#arityObject

Returns the value of attribute arity.



53
54
55
# File 'lib/rtl/library.rb', line 53

def arity
  @arity
end

Instance Method Details

#add(port) ⇒ Object



64
65
66
67
# File 'lib/rtl/library.rb', line 64

def add port
  @arity+=1
  super port
end