数电实验报告
1. 题目要求
完成 XADC 对板上电位器产生的电压的采集。完成 1)或 2),选择完成 3)。
1)将采集结果通过 Led 灯显示,当电压为 1V 时,输出为 1111_1111_1111,当电压为 0.5V
时输出为 0111_1111_1111.
2)将输出显示到数码管上,当电压为 1V 时,显示 0FFF,当电压为 0V 时,显示 0000.
3)将二进制输出转换为相应电压值显示到数码管上(选作)。
2. 源代码
1) Xadc.v
module xadc_top(
input clk,
input rst_n,
input vauxp1,vauxn1,
output [11:0]led,
output [6:0]a_to_g,
output [3:0]an
);
wire [15:0]do_out;
wire drdy_out;
xadc_channel1 U0(
.dclk_in(clk),
.reset_in(rst_n),
.vauxp1(vauxp1),
.vauxn1(vauxn1),
.do_out(do_out),
.drdy_out(drdy_out)
);
xadc_result U3(
.clk(clk),
.rst_n(rst_n),
.do_out(do_out),
.drdy_out(drdy_out),
.led(led)
);
wire [3:0]Y2;
wire [3:0]Y1;
评论0