






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Laboratory of Digital Logic which includes Implementation, Altera Cyclone, Subfunction, Inputs to Outputs, Multiplexers and Pass Transistors, Interconnections, Maximum Expected, Two Circuits, Flip Flop etc. Key important points are: Control Unit Design, Designing, State Machine, Frequency Counter, Signal Frequency, Major Building Blocks, Functional Blocks, Useful Machine, Frequency Counter Based, Contents
Typology: Lecture notes
1 / 10
This page cannot be seen from the preview
Don't miss anything!







In this experiment, you will design a finite state machine controller, and integrate it into a design using the logic functions you have created previsously. After performing this experiment, you should be able to:
In this prelab, you will be designing a state machine to act as a control unit for a frequency counter. Perhaps the most obvious way to implement a frequency counter is to simply count signal changes (C = number of 0Æ1 edges) for a fixed period of time (T), then the signal frequency can be calculated as FSIGNAL = C / T. We have already created all of the major building blocks (i.e. BCD counters and decoders, divide-by-N counter) that we will need for this in previous labs, now we need to design and implement a state machine to control the operation of those blocks. In particular, we will be implementing the controller as a state machine using the one FF per state method (also referred to as a one-hot controller); as preparation for this prelab and lab you should first review Mano and Kime [1] pages 406-410.
Fewer step-by-step instructions are provided for tasks you have completed in earlier labs, as you should be becoming fairly accomplished in using the Altera Quartus II toolset. The issues of tool complexity and the learning curves associated with the tools are something that you will deal with routinely as a design engineer. Since we will often be designing with the most recent technology, the tool sets are often immature and less than robust. So, we will need to be able to fight our way through the various errors and omissions (and our own self-inflicted troubles) that we will discover in our hardware, software and documentation in order to bring our design to fruition. If you need to, review the previous labs as a reminder of how to accomplish tasks that you encounter in this lab.
This lab will build on the functional blocks that you created in experiments 3 and 4, and we will add a finite state machine (FSM) to create a useful machine. We will be developing a frequency counter based on the block diagram shown below in Figure 1. The blocks that are highlighted in thicker blue lines are logic that you have already designed or that will be provided for you. All of the items in the thicker blue blocks are contained in a schematic sheet FREQCNT.BDF that will be provided for you to use. The contents of FREQCNT.BDF are shown below in Figure 2. Although the logic is largely complete, you will still need to add synchronizing flip-flops to the external inputs, add circuitry to generate a pulse on input transitions, and make the various connections to your controller. You will design your controller on a separate sheet (CONTROL.BDF), then create a symbol for it, add that symbol FREQCNT.BDF, and make the necessary connections.
SYNCHRONIZER
COUNT_CLEAR
2-DIGIT BCD COUNTER
ONE-HOT CONTROLLER
BCD-TO- SEGMENT DECODER
OCTAL D-FF LED DISPLAYS
CLOCK
DIVIDE-BY- COUNTER
CLR
CE
RESET
CLOCK TC
TIMER_RESET
TIME_UP
CLOCK
2.000MHz CLOCK
START_S TIMER_RESET
COUNT_CLEAR
COUNT_ENABLE
DATA_STORE
LED BAR1_
LED BAR1_
LED BAR1_
COUNT
IDLE
WAIT
INPUTS
OUTPUTS
Start SYNCHRONIZER CLOCK
TIME_UP
START_S
RESET
RESET
CLR
SIGNAL_S
CLOCK
ENA
DATA_STORE
Figure 1 Frequency Counter Block Diagram
Figure 3 Synchronizer
One more thing we will need to do is to add a synchronous reset capability to the divide-by-2000 counter that you designed in Experiment #4. This is a very simple change, we simply OR the external reset input with the reset logic, as shown below. Note that the logic in FREQCNT.BDF already incorporates this change.
Figure 4 Divide-by-2000 Counter with Reset Input
To begin your controller design;
Net name
Pin
Purpose
INPUT 2.000MHz CLK0 10 Master clock for FPGA INPUT Start PB1 28 Signal to initiate a frequency capture INPUT Reset PB4 35 Master reset signal, when asserted it should place controller in state IDLE and reset all synchronizer flip-flops to 0. INPUT External signal
S1_1 (^36) External signal to be measured – you must place S1-1 in the OFF position. OUTPUT IDLE BAR1_1 48 Indicator for state IDLE, connects to Q (^) IDLE OUTPUT COUNT BAR1_2 49 Indicator for state COUNT, connects to Q (^) COUNT OUTPUT WAIT BAR1_3 50 Indicator for state WAIT, connects to Q (^) WAIT
Review the Experiment 6 project requirements. You will be required to furnish a more formal project proposal with the Experiment 6 prelab report, but if your project idea ends up being unsuitable for one reason or another your team may end up having to start over after doing significant work on it. To minimize that sort of thing, as a team , you will submit a single page document containing a narrative and/or diagrammatic description of your proposed project to be accomplished in Lab 6. This will allow your instructor a chance to quickly review it and give you rapid feedback before you invest any significant time in it. Only one submission is required for each team.
Submit:
W ARNING : All lab results and all answers to questions or discussion are to appear in the lab reports of individual students. All tangible lab results are to be identical (unless indicated otherwise). When a printout of results is specified, a copy should be made for each team member. All answers to questions or discussion are to be the work of individual students, not the lab team. Evidence of collaboration on these aspects of a report within or between teams will be noted and is subject to University disciplinary action.
In addition to the equipment already on the lab bench, your instructor will have you check out a plastic tray containing:
W ARNING – LAB EQUIPMENT HANDLING : Much of the lab equipment is small and delicate. In particular, this applies to the XESS prototyping boards, scopes, scope probes, and logic analyzer probes. So please be careful and handle the equipment with a light and careful touch and do not use the scope probes with the grabbers removed. Perform wiring on the board ONLY with the power disconnected.
CHECKPOINT: Show your instructor your schematic and your Pin-Out File verifying the correct pin assignments.
CHECKPOINT: Have your instructor observe the signal generator waveform BEFORE connecting to the FPGA board.
Logic for controller outputs
Output signal logic expressions