Sunday, February 12, 2012

STATE in Digital Electronics

Introduction

Mathematical functions are said to be stateless. This basically means functions do not store information. Mathematical functions take inputs, and produce the corresponding outputs. On the other hand, C functions or C++ objects do have state. C functions can include static variables, which store the value between function calls. C++ objects also store data in the data members of the object. There is a more generic definition of state:
Definition State is a quantity that stores the previous history of what's happened in such a way that you can predict the output, given any future input.
For example, a capacitor is a device that stores charge. The state of the capacitor is the current charge stored by the capacitor. We don't particularly care how it got the charge (i.e., the previous history of adding or removing charge). All we care about is the current charge. From this point onward, if we know the current going to or leaving the capacitor, we should be able to predict the voltage. For sequential logic circuits, the state information is encoded in bits. Because there are a finite number of bits, there are also a finite number of possible states for a sequential logic circuit (a sequential logic circuit has "state").
There is a notion of time when we talk about state. We think of, say, an object start off in an initial state (set by a constructor), and over time, that state changes. For example, if the object is a linked list, we may add or remove elements over time. While the object's state may not keep track of all the things that have happened to the object, nevertheless, we think of this object changing from state to state, as various operations are performing object.
We can think of running programs having a state. For example, a running program has certain values in registers, plus the current instruction it's executing, plus the contents on the stack, plus any global data. All of this information constitutes the state of the running program. It tells you all you need to know about the program so that you can, for instance, pause the program, then run some other program, then restore the program back to running.

Summary

State refers to some recorded information, which we can think of as a kind of memory.. For sequential logic circuits, this is some finite number of bits. Usually, we think of time being involved with state, because it may change over time.

No comments:

Getting Started with High-Speed PCB Design, Beginners Must Understand These 10 Concepts

Getting  S tarted with  H igh- S peed PCB  D esign,  B eginners  M ust  U nderstand  T hese 10  C oncepts To learn  high-speed PCB de...