Question

In: Electrical Engineering

Verilog coding module demux ( En, I0, I1, Y0, Y1, Y2, Y3 ); input En, I0,...

Verilog coding

module demux (

En, I0, I1, Y0, Y1, Y2, Y3 );

input En, I0, I1;

output reg Y0, Y1, Y2, Y3;

// Your behavioral description of Y

// using if-else or case statements

endmodule

Solutions

Expert Solution

Verilog code:

module demux (

En, I0, I1, Y0, Y1, Y2, Y3 );

input En, I0, I1;

output reg Y0, Y1, Y2, Y3;

always @(En,I0,I1)

begin

if(En == 0)

begin

Y0=1'b0;

Y1=1'b0;

Y2=1'b0;

Y3=1'b0;

end

else if (I1==0 && I0==0)

begin

Y0=1'b1;

Y1=1'b0;

Y2=1'b0;

Y3=1'b0;

end

else if (I1==0 && I0==1)

begin

Y0=1'b0;

Y1=1'b1;

Y2=1'b0;

Y3=1'b0;

end

else if (I1==1 && I0==0)

begin

Y0=1'b0;

Y1=1'b0;

Y2=1'b1;

Y3=1'b0;

end

else if (I1==1 && I0==1)

begin

Y0=1'b0;

Y1=1'b0;

Y2=1'b0;

Y3=1'b1;

end

end

endmodule

RTL Schematic:

Test Bench:

module dmuxtb;

// Inputs

reg En;

reg I0;

reg I1;

// Outputs

wire Y0;

wire Y1;

wire Y2;

wire Y3;

// Instantiate the Unit Under Test (UUT)

demux uut (

.En(En),

.I0(I0),

.I1(I1),

.Y0(Y0),

.Y1(Y1),

.Y2(Y2),

.Y3(Y3)

);

initial begin

// Initialize Inputs

En = 0;

I0 = 0;

I1 = 0;

// Wait 100 ns for global reset to finish

#100;

En = 1;

I0 = 0;

I1 = 0;

#100;

En = 1;

I0 = 0;

I1 = 1;

#100;

En = 1;

I0 = 1;

I1 = 0;

#100;

En = 1;

I0 = 1;

I1 = 1;

#100;

  

// Add stimulus here

end

  

endmodule

Simulation:


Related Solutions

Year (Cash Flow) Y0 (−$8,400) Y1 (4,100) Y2 (4,600) Y3 (3,000) a. What is the profitability...
Year (Cash Flow) Y0 (−$8,400) Y1 (4,100) Y2 (4,600) Y3 (3,000) a. What is the profitability index for the cash flows if the relevant discount rate is 9 percent? b. What is the profitability index for the cash flows if the relevant discount rate is 14 percent? c. What is the profitability index for the cash flows if the relevant discount rate is 26 percent?
Let Y1 < Y2 < Y3 < Y4 < Y5 be the order statistics of a...
Let Y1 < Y2 < Y3 < Y4 < Y5 be the order statistics of a random sample of size 5 from a continuous distribution with median m. What is P(Y2 < m < Y4)?
Let Y1 < Y2 < Y3 < Y4 be the order statistics of a random sample...
Let Y1 < Y2 < Y3 < Y4 be the order statistics of a random sample of size n = 4 from a distribution with pdf f(x) = 3X2, 0 < x < 1, zero elsewhere. (a) Find the joint pdf of Y3 and Y4. (b) Find the conditional pdf of Y3, given Y4 = y4. (c) Evaluate E(Y3|y4)
Let Y1 < Y2 < Y3 < Y4 < Y5 denote the order statistics of a...
Let Y1 < Y2 < Y3 < Y4 < Y5 denote the order statistics of a random sample of size 5 from a distribution having pdf f(x) = e−x, 0 < x < ∞, zero elsewhere. show that Y4 and Y5 – Y4 are independent. Hint: First find the joint pdf of Y4 and Y5.
What is the formula using RStudio to plot these 3 columns of data? Y1 Y2 Y3...
What is the formula using RStudio to plot these 3 columns of data? Y1 Y2 Y3 43595 43032 47474 27829 55141 35865 62946 40311 66920 47186 77191 56664 89661 68040 101373 64008 123904 79400 149453 96731 168672 100517 200977 89685 192985 105709 205667 120532 187450 127457 165613 117306 200871 106498 229394 79543 283229 106599 25092.23 289717 126328 24271.51 270585 160896 25828.99 279514 174346 27697.5 349768 176014 27956.23 339689 184417 29924.43 331610 174960 30216.83 351175 174960 32613.5 450569 104885 36053.17 421513...
1.Suppose you are faced with the following spot rates: y1 = 9% y2 = 10% y3...
1.Suppose you are faced with the following spot rates: y1 = 9% y2 = 10% y3 = 11% Now consider a bond with a $100 face value maturing in 3 years. The bond pays annual coupon payments at a 6% coupon rate. What is the bond price? Select one: a. $92.63 b. $87.97 c. $80.86 d. $85.49 e. $100 2.A bond will sell at a discount when Select one: a. the coupon rate is greater than the current yield, and...
Suppose that a firm produces three outputs y1, y2 and y3 with 3 inputs z1, z2...
Suppose that a firm produces three outputs y1, y2 and y3 with 3 inputs z1, z2 and z3. The input-output requirements matrix is given by A below: A = (3 1 2) (2 5 1) (1 1 3) If the firm wants to produce 10 units of y1, 20 units of y2 and 10 units of y3, how much of z1, z2 and z3 will it require?
Let Y1, Y2, Y3, and Y4be independent, identically distributed random variables from a population with a...
Let Y1, Y2, Y3, and Y4be independent, identically distributed random variables from a population with a mean μ and a variance σ2.  Consider a different estimator of μ: W =  Y1+  Y2+ Y3+ Y4. Let Y1, Y2, Y3, and Y4be independent, identically distributed random variables from a population with a mean μ and a variance σ2.  Consider a different estimator of μ: W = 1/8 Y1+ 1/3 Y2+ 1/6 Y3+ 3/8 Y4. This is an example of a weighted average of the Yi. Show...
Use Euler's method with step size 0.5 to compute the approximate y-values y1, y2, y3 and...
Use Euler's method with step size 0.5 to compute the approximate y-values y1, y2, y3 and y4 of the solution of the initial-value problem. y' = y − 5x, y(3) = 1. y1 = ______ y2 =______ y3 =_______ y4=________ Please show all work, neatly, line by line and justify steps so that I can learn. Thank you!
A jar contains 2 green marbles, G1 and G2, and 4 yellow marbles, Y1, Y2, Y3,...
A jar contains 2 green marbles, G1 and G2, and 4 yellow marbles, Y1, Y2, Y3, and Y4. Imagine that we do not know this. Suppose that our parameter p of interest is the proportion of marbles in the jar that are green. We will be allowed to take three marbles out the jar (all at once, without replacement). We will estimate p by looking at ˆp, the proportion of marbles in our sample that are green. (a) Write down...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT