-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathASK_modulator.vt
101 lines (76 loc) · 2.87 KB
/
ASK_modulator.vt
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Copyright (C) 1991-2013 Altera Corporation
// Your use of Altera Corporation's design tools, logic functions
// and other software and tools, and its AMPP partner logic
// functions, and any output files from any of the foregoing
// (including device programming or simulation files), and any
// associated documentation or information are expressly subject
// to the terms and conditions of the Altera Program License
// Subscription Agreement, Altera MegaCore Function License
// Agreement, or other applicable license agreement, including,
// without limitation, that your use is for the sole purpose of
// programming logic devices manufactured by Altera and sold by
// Altera or its authorized distributors. Please refer to the
// applicable agreement for further details.
// *****************************************************************************
// This file contains a Verilog test bench template that is freely editable to
// suit user's needs .Comments are provided in each section to help the user
// fill out necessary details.
// *****************************************************************************
// Generated on "04/20/2024 06:47:33"
// Verilog Test Bench template for design : ASK_modulator
//
// Simulation tool : ModelSim (Verilog)
//
`timescale 1 ns/ 1 ps
module ASK_modulator_tb();
reg button0;
reg button1;
reg button2;
reg button3;
reg switch_button;
reg clk;
reg rst;
// wires
wire clk_dac;
wire [7:0] data_out;
ASK_modulator i1 (
.button2(button2),
.button3(button3),
.switch_button(switch_button),
.button0(button0),
.button1(button1),
.clk(clk),
.clk_dac(clk_dac),
.data_out(data_out),
.rst(rst)
);
initial
begin
clk<=0;
rst<=1;
button0<=1;
button1<=1;
#200 rst <= 0; // start 4ASK
#100 rst <= 1;
#100 button0 <= 0;
#100 button0 <= 1;
#100 button1 <= 0;
#100 button1 <= 1;
// input 01 to 4ASK
#100 switch_button <= 0;
#100 switch_button <= 1;
#100 button2 <= 0;// input 0
#100 button2 <= 1;
#100 button3 <= 0;// 1
#100 button3 <= 1;
#100000
// input 11 to ASK
#100 button3 <= 0;// input 1
#100 button3 <= 1;
#100 button3 <= 0;// 1
#100 button3 <= 1;
#1000
$display("Running testbench");
end
always #10 clk <= ~clk;
endmodule