关于以下程序,下列说法中正确的是module Learn10_2 (clk,rst_n,din,pos_clk,neg_clk)input clk,rst_n,din;output pos_clk,neg_clk;reg ctrl_this,ctrl_last;always@(posedge clk or negedge rst_n)beginif(!rst_n)beginctrl_this <= 0;ctrl_last <= 0;endelse beginctrl_this <= din;ctrl_last <=ctrl_thisendendassign pos_clk = ctrl_this&(!ctrl_last)endmodule
A: 该程序的功能是上升沿检测
B: 该程序是同步复位
C: pos_clk是一个长度为两个时钟周期的脉宽信号
D: 该程序的功能是下降沿检测
A: 该程序的功能是上升沿检测
B: 该程序是同步复位
C: pos_clk是一个长度为两个时钟周期的脉宽信号
D: 该程序的功能是下降沿检测
举一反三
- 要设计串行输入/8位并行输出的移位寄存器,关于端口定义正确的是( )。 A: module shift01(din,clk,rst_n,dout);input clk,rst_n;input din;output dout;...... B: module shift01(din,clk,rst_n,dout);input clk,rst_n;input [7:0] din;output dout;...... C: module shift01(din,clk,rst_n,dout);input clk,rst_n;input din;output [7:0] dout;...... D: module shift01(din,clk,rst_n,dout);input clk,rst_n;input [7:0] din;output[7:0] dout;......
- 下列哪一个表述是正确: A: always@(posedge CLK or RST) B: always@(posedge CLK or negedge RST or A) C: always@(posedge CLK or D or Q) D: always@(posedge CLK or negedge RST)
- 下列哪一个表述是正确: A: always@(posedge CLK or RST) B: always@(posedge CLK or negedge RST or A) C: always@(posedge CLK or D or Q) D: always@(posedge CLK or negedge RST)
- 要实现异步复位(低电平有效)、时钟使能(高电平有效)、上升沿触发的D触发器设计:module dff_s (data,rst,en,clk,q);input data,rst,en,clk;output reg q;always (1) begin if( 2 ) q<=1'b0;; else if (3) q<=data;endendmodule(1)应该填写( )。 A: @(posedge clk ) B: @(posedge clk or posedge rst or en) C: @(posedge clk or negedge rst) D: @(posedge clk or negedge rst or en)
- 含同步复位控制的D触发器module DFF2(input CLK, input D, input RST, output reg Q);always@(posedge CLK)Q<=____?0:D;endmodule空格处应该填入: A: CLK B: RST C: Q D: D