刚刚接触fpga。请大神帮忙解释下面这段Verilog HDL语言的意思! 30
always@(posedgelink_clk)begincase(count[2:0])3'd0:beginadc_a_mclk<=1'b0;adc_a_sclk<=1...
always @ (posedge link_clk)begin
case(count[2:0])
3'd0:begin
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd1:begin
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd2:begin
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
a_d_r1 <= data_rx1; // rs data
a_d_r2 <= data_rx2;
end
3'd3:begin
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
end 展开
case(count[2:0])
3'd0:begin
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd1:begin
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd2:begin
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
a_d_r1 <= data_rx1; // rs data
a_d_r2 <= data_rx2;
end
3'd3:begin
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
end 展开
2个回答
展开全部
always @ (posedge link_clk)begin
case(count[2:0])
3'd0:begin // cnout 为0 的时候,下面两个寄存器为0
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd1:begin // cnout 为1的时候,下面两个寄存器为0
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd2:begin// cnout 为2的时候,adc_a_mclk为1,adc_a_sclk为0 同时更新
// a_d_r1 a_d_r2 寄存器的值
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
a_d_r1 <= data_rx1; // rs data
a_d_r2 <= data_rx2;
end
3'd3:begin// cnout 为1的时候,adc_a_mclk为1,adc_a_sclk为0
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
end
综上 adc_a_mclk 类似一个4分频时钟,同时在 count为2的时候,锁存了两个寄存器的值
adc_a_sclk 貌似没用到
case(count[2:0])
3'd0:begin // cnout 为0 的时候,下面两个寄存器为0
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd1:begin // cnout 为1的时候,下面两个寄存器为0
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd2:begin// cnout 为2的时候,adc_a_mclk为1,adc_a_sclk为0 同时更新
// a_d_r1 a_d_r2 寄存器的值
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
a_d_r1 <= data_rx1; // rs data
a_d_r2 <= data_rx2;
end
3'd3:begin// cnout 为1的时候,adc_a_mclk为1,adc_a_sclk为0
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
end
综上 adc_a_mclk 类似一个4分频时钟,同时在 count为2的时候,锁存了两个寄存器的值
adc_a_sclk 貌似没用到
追问
什么叫四分频时钟啊!!
意法半导体(中国)投资有限公司
2023-06-12 广告
2023-06-12 广告
STM32F103C8T6是一款基于ARM Cortex-M3内核的微控制器,具有以下基本参数:1. 工作频率:72MHz2. 外部时钟:最高可达120MHz3. 存储器容量:64K bytes4. 数据总线宽度:32位5. 输入/输出端口...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
2015-07-28
展开全部
always @ (posedge link_clk)begin //link_clk上升沿时
case(count[2:0])
3'd0:begin //当count=0时,adc_a_mclk <= 1'b0;adc_a_sclk <= 1'b0;
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd1:begin //当count=0时,adc_a_mclk <= 1'b0;adc_a_sclk <= 1'b0;
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd2:begin //当count=0时,adc_a_mclk <= 1'b1;adc_a_sclk <= 1'b0;data_rx1赋值给a_d_r1,data_rx2赋值给a_d_r2
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
a_d_r1 <= data_rx1; // rs data
a_d_r2 <= data_rx2;
end
3'd3:begin //当count=0时,adc_a_mclk <= 1'b1;adc_a_sclk <= 1'b0;
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
end
case(count[2:0])
3'd0:begin //当count=0时,adc_a_mclk <= 1'b0;adc_a_sclk <= 1'b0;
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd1:begin //当count=0时,adc_a_mclk <= 1'b0;adc_a_sclk <= 1'b0;
adc_a_mclk <= 1'b0;
adc_a_sclk <= 1'b0;
end
3'd2:begin //当count=0时,adc_a_mclk <= 1'b1;adc_a_sclk <= 1'b0;data_rx1赋值给a_d_r1,data_rx2赋值给a_d_r2
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
a_d_r1 <= data_rx1; // rs data
a_d_r2 <= data_rx2;
end
3'd3:begin //当count=0时,adc_a_mclk <= 1'b1;adc_a_sclk <= 1'b0;
adc_a_mclk <= 1'b1;
adc_a_sclk <= 1'b0;
end
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询