• 2021-04-14 问题

    下面是一个4位的双向移位寄存器程序,该程序正确吗?module UniversalShift (S1,S0,Din,Dsl,Dsr,Q,CP,CLR_); input S1, S0; //Select inputs input Dsl, Dsr; //Serial Data inputs input CP, CLR_; //Clock and Reset input [3:0] Din; //Parallel Data input output [3:0] Q; //Register output reg [3:0] Q; always @ (posedge CP or negedge CLR_) if (~CLR_) Q <= 4b0000; else case ({S1,S0}) 2b00: Q <= Q; //No change 2b01: Q <= {Dsr,Q[3:1]}; //Shift right 2b10: Q <= {Q[2:0],Dsl}; //Shift left 2b11: Q <= Din; //Parallel load input endcaseendmodule

    下面是一个4位的双向移位寄存器程序,该程序正确吗?module UniversalShift (S1,S0,Din,Dsl,Dsr,Q,CP,CLR_); input S1, S0; //Select inputs input Dsl, Dsr; //Serial Data inputs input CP, CLR_; //Clock and Reset input [3:0] Din; //Parallel Data input output [3:0] Q; //Register output reg [3:0] Q; always @ (posedge CP or negedge CLR_) if (~CLR_) Q <= 4b0000; else case ({S1,S0}) 2b00: Q <= Q; //No change 2b01: Q <= {Dsr,Q[3:1]}; //Shift right 2b10: Q <= {Q[2:0],Dsl}; //Shift left 2b11: Q <= Din; //Parallel load input endcaseendmodule

  • 2022-05-30 问题

    这段程序输出驱动共阳极数码管,下列叙述中正确的有:‍module Learn4_1(a,b,c,y); input a,b,c; output reg&#91;6:0&#93; y; always@(a or b or c) case({a,b,c}) 3'b000: y=7'b1111110; 3'b001: y=7'b0110000; 3'b010: y=7'b0110000; 3'b011: y=7'b1101101; 3'b100: y=7'b0110000; 3'b101: y=7'b1101101; 3'b110: y=7'b1101101; 3'b111: y=7'b1111001; default: y=7'b1111110; endcaseendmodule A: 数码管显示的字形为0至8; B: 数码管显示的字形为 0至7; C: 当a,b均为0时,若c为1,数码管显示1; D: 当a,b,c全为1时,数码管显示0;

    这段程序输出驱动共阳极数码管,下列叙述中正确的有:‍module Learn4_1(a,b,c,y); input a,b,c; output reg&#91;6:0&#93; y; always@(a or b or c) case({a,b,c}) 3'b000: y=7'b1111110; 3'b001: y=7'b0110000; 3'b010: y=7'b0110000; 3'b011: y=7'b1101101; 3'b100: y=7'b0110000; 3'b101: y=7'b1101101; 3'b110: y=7'b1101101; 3'b111: y=7'b1111001; default: y=7'b1111110; endcaseendmodule A: 数码管显示的字形为0至8; B: 数码管显示的字形为 0至7; C: 当a,b均为0时,若c为1,数码管显示1; D: 当a,b,c全为1时,数码管显示0;

  • 1