In information technology and computer science, a system is described as stateful if it is designed to remember preceding events or user interactions;[1] the remembered information is called the state of the system.
The output of a digital circuit or deterministic computer program at any time is completely determined by its current inputs and its state.
[3] In sequential logic, information from past inputs is stored in electronic memory elements, such as flip-flops.
[5][6][7] A more specialized definition of state is used for computer programs that operate serially or sequentially on streams of data, such as parsers, firewalls, communication protocols and encryption.
Serial programs operate on the incoming data characters or packets sequentially, one at a time.
Similarly, the television also stores a number that controls the level of volume produced by the speaker.
As another example, the state of a microprocessor is the contents of all the memory elements in it: the accumulators, storage registers, data caches, and flags.