⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demultiplex.v

📁 是用verilog写的,解复接程序,可以把复接的反过来,一般用在解码程序中!
💻 V
字号:
module demultiplex(normal,Le,P1e,P2e,clk,rst);/*解复子函数*/
input normal,clk,rst;
output Le,P1e,P2e;
reg Le,P1e,P2e;
reg [3:0]count;
always@(posedge clk or posedge rst)/*设定计数器和复位*/
if(rst)count<=0;
else
   if(count<12) count<=count+4'b0001;

always@(normal)
begin
if(count<6)
 begin
  Le<=normal;         /*防止其他两个输出的随机变化*/
  P1e<=0;
  P2e<=0;
 end
else if(count>=6&&count<9) 
begin
 P1e<=normal;
 Le<=0;
 P2e<=0;
end
else if(count>=9&&count<12)
begin
 P2e<=normal;
 Le<=0;
 P1e<=0;
end
else
  begin
 P1e<=0;              /*将所得的数据后面的数复位*/
 Le<=0;
 P2e<=0;
end
end
endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -