Team:Peking/test

iGEM EPFL 2016

Sequential logic vs. combinational logic


Introduction


Combinational logic circuits implement Boolean functions, which always depend on input. Boolean functions are mappings of input to output. They are functions of input only. It means that if you feed in an input to a circuit, the output will always be the same for that circuit. If that value were not the same every single time, then the output must not completely depend on input. Something else must be affecting the output.

Example-Buy coffee


Let's consider a vending machine. We want to see if its output is solely dependent on the input. Imagine this vending machine only sells coffee, and that the price of a coffee is 75 cents. The machine can only take quarters. Once 75 cents are deposited, a coffee is dispensed without any button being pressed. (What a stupid machine!) One day, when you want to drink coffee, you see this machine, and you happen to be holding several quarters. You place the first quarter in the machine, and out comes...nothing! Undaunted, you put another quarter in, and out comes.... nothing! Frustrated, you decide to put in yet another quarter, and out comes a coffee! Delicious, savory and mellow Coke! You drink, and are content. Then, invigorated by caffeine, you begin to think "Is this machine a function?" You gave the same input, three times in a row, but it did not produce the same output. A mathematical function maps inputs to outputs. Thus, once you know what the input maps to, that should be it. In this case, the input (a quarter) mapped to nothing. So, clearly, this does not behave like a function. What's happening? Clearly, the machine is storing some information. In particular, it's records how much money you have entered so far. The output is determined not only by the input, but also by this stored information.

Sequential logicS


Key things to notice:  Like combinational logic circuits, a sequential logic circuit has inputs and outputs.  Unlike combinational logic circuits, a sequential logic circuit is related to time.  Also, there is a box inside the circuit called State. This box contains flip flops. Assume it has k flip flops. The flip flops basically store a k-bit number representing the current state. The state can be updated.  The output is computed based on the inputs and the state coming out of the state box.  The information needed to update to the state (called the next state) comes from the current state (the current value of q) and the input, which is fed through combinational logic, and fed back into the state box, telling the state box how to update itself.

Summary


The main difference between sequential circuits and combinational circuits is that sequential circuits compute their output based on input and state, and that the state is updated. Combinational logic circuits implement Boolean functions, so they are functions only of their inputs, and are not based on clocks.