Package hw4

Class 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 Detail

      • Register

        public Register​(int size)
        Constructs a register whose state consists of the given number of bits.
        Parameters:
        size - number of bits
    • Method Detail

      • tick

        public void tick()
        Description copied from interface: IStatefulComponent
        Updates the internal state, if any, provided that the component is enabled.