Class: Circuits::Component::SrNor

Inherits:
Base
  • Object
show all
Defined in:
lib/circuits/component/sr_nor.rb

Overview

SR NOR Latch

Instance Attribute Summary

Attributes inherited from Base

#inputs, #outputs

Instance Method Summary collapse

Methods inherited from Base

#[], #tick, #tock

Constructor Details

#initializeSrNor

Returns a new instance of SrNor.



8
9
10
11
12
13
14
15
16
17
# File 'lib/circuits/component/sr_nor.rb', line 8

def initialize
  nor_s = Nor.new
  nor_r = Nor.new
  super(inputs: [:r, :s],
        outputs: [:q, :not_q],
        sub_components: [nor_s, nor_r],
        ticks: 2)
  link nor_s, nor_r
  reset
end