-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo_top.v
70 lines (63 loc) · 1.52 KB
/
demo_top.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:28:25 03/19/2013
// Design Name:
// Module Name:
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module demo_top(
input wire clk, //master clock = 50MHz
input wire clr, //right-most pushbutton for reset
output wire [6:0] seg, //7-segment display LEDs
output wire [3:0] an, //7-segment display anode enable
output wire dp, //7-segment display decimal point
output wire [2:0] red, //red vga output - 3 bits
output wire [2:0] green,//green vga output - 3 bits
output wire [1:0] blue, //blue vga output - 2 bits
output wire hsync, //horizontal sync out
output wire vsync //vertical sync out
);
// 7-segment clock interconnect
wire segclk;
// VGA display clock interconnect
wire dclk;
// disable the 7-segment decimal points
assign dp = 1;
// generate 7-segment clock & display clock
clockdiv U1(
.clk(clk),
.clr(clr),
.segclk(segclk),
.dclk(dclk)
);
// 7-segment display controller
segdisplay U2(
.segclk(segclk),
.clr(clr),
.seg(seg),
.an(an)
);
// VGA controller
vga640x480 U3(
.dclk(dclk),
.clr(clr),
.hsync(hsync),
.vsync(vsync),
.red(red),
.green(green),
.blue(blue)
);
endmodule