交流用,别照搬
reg [7:0]Y;
always @(*) begin
Y=8'b0;
if(en==1)
case(Din)
3'd0:Y=8'b00000001;
3'd1:Y[1]=1;
3'd2:Y[2]=1;
3'd3:Y[3]=1;
3'd4:Y[4]=1;
3'd5:Y[5]=1;
3'd6:Y[6]=1;
3'd7:Y[7]=1;
endcase
else
Y=8'b00000000;
end
reg [7:0]Y;
integer i;
always @(*) begin
Y=8'b0;
if(en==1)
for(i=0;i<8;i=i+1)
if(Din==i)
Y[i]=1'b1;
end
reg [6 : 0] a_to_g;
always @(*) begin
case(x)
4'd0:a_to_g= 7'b0000001;
4'd1:a_to_g&#