DHD Lab
DHD Lab
Submitted by :
Jayram.A (BT21ECE052)
Thahesh.P(BT21ECE018)
Vinit.R( BT21ECE009)
Viswatej.A (BT21ECE017)
Semester 6
Submitted to :
Anamika singh
(Course Instructor)
Department of Electronics and Communication Engineering,
VNIT Nagpur
1.0
Digital Timer
Aim: To Design a Digital Timer which has the following functionalities
1. Up timer
2. Down timer
3. Alarm
4. Reset
Code: :
1
2 module seg7(
3 input [3:0] data in,
4 output reg [7:0] display out
5 );
6
29 default:
30 display out = 8'b11000000; //default case
31 endcase
32 end
33
34 endmodule
35
36 module digital clock(
37 input clk 50mhz, // 50 MHz system clock input
38 input reset,
39 input up, // up input
40 input stop,
41 output [31:0] display out, // 7−segment display output
42 output reg alarm led // Alarm LED output
43 );
44
45 reg clk 1hz; // 1 Hz clock signal
46 reg [27:0] counter;
47 reg [5:0] seconds;
48 reg [5:0] minutes;
49 reg [5:0] timer mode; // 0 = Up timer, 1 = Down timer
50
51 // Set the alarm time (1:00)
52 parameter ALARM MINUTE = 6'd0;
53 parameter ALARM SECOND = 6'd05;
54
RTL Viewer: :
1.0
Flow Chart: :
Conclusion : Therefore Digital Timer has been designed on the FPGA board
through the Quartus software.