Page 218 - A Practical Guide from Design Planning to Manufacturing
P. 218

Logic Design  191

        Most importantly this example shows how an abstract concept such as
        addition can be written down as a truth table and ultimately imple-
        mented using logic gates.
          Many automated tools are available today to perform logic minimiza-
        tion; it is increasingly rare to see engineers using Karnaugh maps to
        minimize functions by hand. However, for some simple problems this
        may be the easiest solution; for more complex problems where automa-
        tion is used, it is important to understand the mechanism behind logic
        minimization.



        Sequential logic
        Logic gates allow microprocessors to perform computations on data, but
        to run programs a processor must also store data. Sequential logic cir-
        cuits include memory elements, allowing them to retain knowledge of
        what has happened before. In combinational logic circuits, the outputs
        are functions only of the inputs. In sequential logic circuits, the outputs
        are also functions of the current memory state stored by the circuit.
        Combinational logic is sufficient to add numbers, but it could not, for
        example, control an elevator. Whether an elevator goes up or down
        depends not just on what button is currently being pressed, but also on
        which buttons were pressed in the past. Pressing the button for a lower
        floor will cause a different behavior in an idle elevator than one that is
        currently going up. Sequential logic can create control circuits that react
        differently to the same inputs depending upon the state of the machine.
        They can also implement memory arrays that store values to be read
        later. In fact, an entire microprocessor can be thought of as a single very
        large sequential logic circuit.
          A common element for storing data within sequential logic is a flip-
        flop. A flip-flop is a memory element that captures the data at its input
        at the rise of a clock signal and holds it until the next rise of clock. Any
        changes in the data input between rising edges of the clock signal are
        ignored.
          Figure 6-19 shows the voltage waveforms of a flip-flop’s inputs and
        outputs. At the first rise of clock, the input is high, so the flip-flop output
        changes to high. Transitions on the inputs before the second rise of clock
        are ignored. Because the input is high at the second rise of clock, the
        flip-flop output does not change. The input is low for the third rise of
        clock, which causes a change in the output. How flip-flops are imple-
        mented with transistors is discussed in Chap. 7.
          Pipelined processors are filled with combinational logic that must per-
        form the same action for each instruction as it reaches that stage of the
        pipeline. These circuits are commonly separated by flip-flops. The flip-
        flops capture the inputs to the logic at the beginning of each processor
   213   214   215   216   217   218   219   220   221   222   223