Package hw4
Class Register
- java.lang.Object
-
- hw4.AbstractComponent
-
- hw4.AbstractStatefulComponent
-
- hw4.Register
-
- All Implemented Interfaces:
IComponent
,IStatefulComponent
public class Register extends AbstractStatefulComponent
Implementation of a register with an internal "state" consisting of a fixed number of bits. If enabled, the tick() method causes the input bits to be copied to the state (provided that the inputs are valid). Outputs are always valid and equal to the state.- Author:
- smkautz
-
-
Constructor Summary
Constructors Constructor Description Register(int size)
Constructs a register whose state consists of the given number of bits.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
tick()
Updates the internal state, if any, provided that the component is enabled.-
Methods inherited from class hw4.AbstractStatefulComponent
clear, invalidateOutputs, propagate, setEnabled
-
Methods inherited from class hw4.AbstractComponent
inputs, inputsValid, invalidateInputs, outputs, outputsValid
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface api.IComponent
inputs, inputsValid, invalidateInputs, outputs, outputsValid
-
-
-
-
Method Detail
-
tick
public void tick()
Description copied from interface:IStatefulComponent
Updates the internal state, if any, provided that the component is enabled.
-
-