Line 6: | Line 6: | ||
<div class="container"> | <div class="container"> | ||
<div class="col-md-10 col-md-offset-1 animate-box"> | <div class="col-md-10 col-md-offset-1 animate-box"> | ||
− | <h2 class="lead"> | + | <h2 class="lead">Sequential logic vs. combinational logic</h2> |
<div class="spacer h20"></div> | <div class="spacer h20"></div> | ||
<hr class="animate-box"/> | <hr class="animate-box"/> | ||
Line 20: | Line 20: | ||
<div class="container"> | <div class="container"> | ||
<div class="col-md-10 col-md-offset-1 animate-box"> | <div class="col-md-10 col-md-offset-1 animate-box"> | ||
− | <h3> | + | <h3>Introduction</h3> |
<div class="spacer h20"></div> | <div class="spacer h20"></div> | ||
<hr class="animate-box"/> | <hr class="animate-box"/> | ||
<div class="spacer h20"></div> | <div class="spacer h20"></div> | ||
<p class="sub-lead"> | <p class="sub-lead"> | ||
− | + | 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. | |
</p> | </p> | ||
Line 39: | Line 39: | ||
<div class="container"> | <div class="container"> | ||
<div class="col-md-10 col-md-offset-1 animate-box"> | <div class="col-md-10 col-md-offset-1 animate-box"> | ||
− | <h3> | + | <h3>Example-Buy coffee</h3> |
<div class="spacer h20"></div> | <div class="spacer h20"></div> | ||
<hr class="animate-box"/> | <hr class="animate-box"/> | ||
<div class="spacer h20"></div> | <div class="spacer h20"></div> | ||
<p class="sub-lead"> | <p class="sub-lead"> | ||
− | + | 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. | ||
+ | |||
</p> | </p> | ||
Line 52: | Line 65: | ||
</section> | </section> | ||
</div> | </div> | ||
+ | |||
<div class="simple-page"> | <div class="simple-page"> | ||
<section class=""> | <section class=""> | ||
<div class="container"> | <div class="container"> | ||
<div class="col-md-10 col-md-offset-1 animate-box"> | <div class="col-md-10 col-md-offset-1 animate-box"> | ||
− | <h3> | + | <h3>Sequential logicS</h3> |
<div class="spacer h20"></div> | <div class="spacer h20"></div> | ||
<hr class="animate-box"/> | <hr class="animate-box"/> | ||
<div class="spacer h20"></div> | <div class="spacer h20"></div> | ||
<p class="sub-lead"> | <p class="sub-lead"> | ||
− | + | 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. | ||
+ | |||
</p> | </p> | ||
Line 69: | Line 89: | ||
</section> | </section> | ||
</div> | </div> | ||
+ | |||
+ | <div class="simple-page"> | ||
+ | <section class=""> | ||
+ | <div class="container"> | ||
+ | <div class="col-md-10 col-md-offset-1 animate-box"> | ||
+ | <h3>Summary</h3> | ||
+ | <div class="spacer h20"></div> | ||
+ | <hr class="animate-box"/> | ||
+ | <div class="spacer h20"></div> | ||
+ | <p class="sub-lead"> | ||
+ | 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. | ||
+ | |||
+ | </p> | ||
+ | |||
+ | <div class="spacer h20"></div> | ||
+ | </div> | ||
+ | </div> | ||
+ | </section> | ||
+ | </div> | ||
+ | |||
</html> | </html> | ||
{{RISE_foot}} | {{RISE_foot}} |
Revision as of 04:55, 15 October 2017
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.