2-4线译码器

//2-4线译码器
module cy4(input[1:0] A,//输入端口声明
           input E,//输入端口声明
           output reg[3:0]Y//输出端口声明
          );
always @(A,E)
if(E == 1)  Y <= 4'b1111;      
else 
   begin
     case(A)
      2'b00: Y <= 4'b1110;
      2'b01: Y <= 4'b1101;
      2'b10: Y <= 4'b1011;
      2'b11: Y <= 4'b0111;
     endcase
   end
endmodule 

这里写图片描述

猜你喜欢

转载自blog.csdn.net/qq_41982581/article/details/82498287
2-4