Advertisement
itsme_rudj

1:8 Demultiplexer Structure

Dec 8th, 2023
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 0.64 KB | Source Code | 0 0
  1. module demux_12(a,s,c);
  2.   input a;
  3.   input s;
  4.   output [1:0]c;
  5.   assign c[1] = (a & ~s);
  6.   assign c[0] = (a & s);
  7. endmodule
  8.  
  9. module demux_14(a,s,c);
  10.   input a;
  11.   input[1:0]s;
  12.   output [3:0] c;
  13.   wire [1:0] c1;
  14.  
  15.   demux_12 intermediate(.a(a),.s(~s[1]),.c(c1));
  16.   demux_12 out (.a(c1[0]),.s(~s[0]),.c(c[1:0]));
  17.   demux_12 out2(.a(c1[1]),.s(~s[0]),.c(c[3:2]));
  18. endmodule
  19.  
  20. module demux_18(a,s,c);
  21.   input a;
  22.   input[2:0]s;
  23.   output [7:0]c;
  24.   wire [1:0] c1;
  25.  
  26.   demux_12 intermediate(.a(a),.s(~s[2]),.c(c1));
  27.   demux_14 out1(.a(c1[0]),.s(~s[1:0]),.c(c[7:4]));
  28.   demux_14 out2(.a(c1[1]),.s(~s[1:0]),.c(c[3:0]));
  29. endmodule
  30.  
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement