Class: Circuits::Component::SrNand
- Inherits:
-
Object
- Object
- Circuits::Component::SrNand
- Includes:
- Circuits::Component
- Defined in:
- lib/circuits/component/sr_nand.rb
Overview
SR NAND Latch
Instance Attribute Summary
Attributes included from Circuits::Component
Instance Method Summary collapse
-
#tick ⇒ Object
Computes the outputs based on the inputs and previous state.
Methods included from Circuits::Component
#[], #[]=, #initialize, #tock
Instance Method Details
#tick ⇒ Object
Computes the outputs based on the inputs and previous state
10 11 12 13 14 15 16 17 |
# File 'lib/circuits/component/sr_nand.rb', line 10 def tick 2.times.each do sub_components.each(&:tick) sub_components.each(&:tock) end self[:q].set nand_1[:out].get self[:not_q].set nand_2[:out].get end |