DS 2023-quartus代写-Assignment 3
时间:2023-05-11
DS 2023 Project Assignment 3
Professor Jonathan H. Manton
4 May 2023
Report Requirements
Refer to Practical Assignment 1 for report requirements.
Final Project Submission
In addition to the four project reports, you will also be required to submit your Quartus
project containing your final code, as a single Zip archive.
1 Watch
1.1 Option 1
If you have already assembled your clock, stop watch and count-down timer into a
working watch, then you can choose to complete the following two tasks and skip all
those tasks listed in Section 1.2.
Task 1
With the assistance of a block diagram, explain how you assembled your clock.
Task 2
Include as an appendix to your report the full code for your working clock.
1
1.2 Option 2
If you did not choose Option 1, you must instead work your way through the following
tasks, culminating in a working watch featuring a clock, stop watch and count-down
timer. All three functions (clock, stop watch and count-down timer) can and should use
the Display module (the upper right dashed quadrilateral in Figure 1). They also take
as inputs KEY0, KEY1 and KEY2 (except for the stop watch that does not use KEY1).
Therefore, throughout your past work, you should have created the equivalent of the
following structure (if not, you should be able to refactor it into the following structure
without difficulty). You can use your own names and make other changes if you feel it
justified.
1 module Clock(
2 input clk , mode , inc , dec ,
3 output [4:0] hours ,
4 output [5:0] mins , secs ,
5 output [2:0] blank
6 );
7 // ...
8 endmodule
9
10 module StopWatch(
11 input clk , reset , startStop ,
12 output [5:0] mins , secs ,
13 output [6:0] hundredths
14 );
15 // ...
16 endmodule
17
18 module CountdownTimer(
19 input clk , reset , inc , startStop ,
20 output [4:0] hours ,
21 output [5:0] mins , secs ,
22 output buzzer
23 );
24 // ...
25 endmodule
26
27 module Display(
28 input [7:0] num2 , num1 , num0 ,
29 input [2:0] blank ,
30 output [6:0] HEX5 , HEX4 , HEX3 , HEX2 , HEX1 , HEX0
31 );
32 // ...
33 endmodule
2
Task 3
Create a new project in Quartus. Within it, add all the above modules to it,
including any extra modules required by those modules. (Cut-and-paste from your
previous work.) In your top-level module Watch, start by connecting the Clock
to the Display, so to speak, and check it works. Then repeat for the StopWatch
and for the CountdownTimer. Make a note in your report of any difficulties you
overcame.
Time
Flash
KEY1KEY2 KEY0
Demulti-
plexer
Mode
Fast
Advance
Fast
Advance
7-Segment
Decoder
7-Segment
Decoder
7-Segment
Decoder
Binary to
Decimal
Binary to
Decimal
Binary to
Decimal
7-Segment
Decoder
7-Segment
Decoder
7-Segment
Decoder
7-Segment
Display
7-Segment
Display
7-Segment
Display
7-Segment
Display
7-Segment
Display
7-Segment
Display
Hours
Minutes
Seconds
Clock lines are not shown
Figure 1: Block diagram of our clock design. Refer to Assignment #2 for details.
3
Task 4
Add to your current project a 4-to-1 MUX whose bit width is a parameter. In
your top-level module, connect two switches to the select input of an appropriate
instance of this MUX. Connect an instance each of Clock, StopWatch and Count-
downTimer to this MUX, and connect the output of the MUX to an instance
of Display. Connect KEY0, KEY1 and KEY2 directly to Clock, StopWatch and
CountdownTimer. (This will mean pressing a key will affect all three functions at
once; this is for testing purposes only.) Confirm your design works, and explain
in your report what behaviour you observed and why you believe it is correct.
Task 5
Continuing on, add a demultiplexer to each of KEY0, KEY1 and KEY2, so that
they go to the instance of the correct module (Clock, StopWatch or Countdown-
Timer) based on the position of the two switches. In this way, changing the
switches should change both where the KEYs go and where the input to Display
is coming from. Show the relevant code in your report.
Task 6
Next, replace the two switches for selecting the mode by KEY3. Upon each press
of KEY3, your watch should cycle through the three modes: clock, stop watch
and count-down timer. Furthermore, use LED9 (clock), LED8 (stop watch) and
LED7 (count-down timer) to show the current mode. Show the relevant code in
your report.
Task 7
Include as an appendix to your report the full code for your working clock.
essay、essay代写