# cpe229_lec07 - CPE 229 Course Notes Lecture 7 Copyright...

• Notes
• 9

This preview shows pages 1–2. Sign up to view the full content.

CPE 229 Course Notes: Lecture 7 Copyright: 2005 Bryan Mealy Yet Another Real Story FSMs are primarily used to control other circuits. It is possible to make a FSM that will output a desired counting sequence (namely counters) but that is more an academic exercise rather than a real-world application. The end product in CPE 229 is to be able to implement real-world applications; specifically a controller for the datapath circuitry of a computer. The problem below attempts to present a real design problem that you’ll need or want to use a FSM to solve. The application is somewhat corny, but the underlying design and the steps required to implement the design could almost be considered real. Problem Statement: Design a circuit that drives an 8-LED display (similar to the ones in on the development boards in the CPE 269 lab) in the following manner. The display should have only one LED at a time lit. The lit LED should shift towards the left with on the system clock edge until it arrives as the left-most LED. At this point, the lit LED should then start shifting towards the right until it hits the right- most LED and starts shifting left again. The circuit is controlled by a shift enable input DE. When this input is asserted, the circuit resets itself (the right-most LED lit) and initiates the shifting sequence. When the DE input is not asserted, the LED output stops shifting and remains in the final state it was in before the DE input was unasserted. Implement the design using less than four flip-flops. The Long-Winded Solution: The obvious solution to this problem is to use a one-hot encoded FSM and use the state variables to drive the output displays. But that would be too simple which is why there is a limit placed on the number of flip-flops you can use in this design. The better solution is to continue with the theme of CPE 229 and fit the design into the model previously presented and shown again in Figure 1 (although this time, we’re not designing a CPU, the model is still valid). The approach we’ll take for solving this problem is to first design the circuit for the datapath and then design a circuit that will control it. Figure 1: The basic model used much too often in CPE 229. The first step is to pull from your vast digital knowledge and come up with some circuitry for the datapath that will be able to implement the given problem. If you think about it, the moving back and forth of the lit LED could be characterized as a shifting action. And since this shifting action is synchronized with the clock, the design cries out heavily for being centered around a shift register. But didn’t shift registers only shift in one direction? First, there is a device known as a universal shift register that can handle most of the listed functions required by this problem: it shifts left or right, it has a parallel data loading inputs, or it holds the current value (does not shift at all). Let’s work with this device first. The universal shift register is actually based on a simple concept. In other words, we can decompose a shift

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Spring '09
• smith

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern