Question

In: Electrical Engineering

Type up Verilog Verilog program , test bench and screenshot of the wavefore using verilog xilinx....

Type up Verilog Verilog program , test bench and screenshot of the wavefore using verilog xilinx. (PLEASE ONLY ANSWER IF YOU UNDERSTAND HOW TO USE XILINX.

******************no need to show me the state diagram or state table just the verilog code , test bench and the screenshot of the waveforem ****************

Implement the function given below using each of the following methods. As few 16-1 multiplexers as possible. Behavioral Verilog. F( w , x, y , z) = ?(2 , 4 , 5 , 8 , 11 , 12 , 14 , 15) 1) show code and simulation results

Solutions

Expert Solution

verilog code

module mux16_to_1(i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,w,x,y,z, F);

       //select lines w,x,y,z
       //inputs i0 to i15
input w,x,y,z,i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15;
output reg F;
   //behavioral block
   always @ (w or x or y or z or i0 or i1 or i2
                   or i3 or i4 or i5 or i6 or i7 or i8
                    or i9 or i10 or i11 or i12 or i13 or i14 or i15   )

       F =(~w & ~x & ~y & ~z & i0) | (~w & ~x & ~y & z & i1) |
           (~w & ~x & y & ~z & i2) | (~w & ~x & y & z & i3) |
           (~w & x & ~y & ~z & i4) | (~w & x & ~y & z & i5) |
           (~w & x & y & ~z & i6) | (~w & x & y & z & i7) |
           (w & ~x & ~y & ~z & i8) | (w & ~x & ~y & z & i9) |
           (w & ~x & y & ~z & i10) | (w & ~x & y & z & i1) |
           (w & x & ~y & ~z & i12) | (w & x & ~y & z & i13) |
           (w & x & y & ~z & i14) | (w & x & y & z & i15);
          
endmodule

Testbench

module behav_test_bench_v;

   // Inputs
   reg i0;
   reg i1;
   reg i2;
   reg i3;
   reg i4;
   reg i5;
   reg i6;
   reg i7;
   reg i8;
   reg i9;
   reg i10;
   reg i11;
   reg i12;
   reg i13;
   reg i14;
   reg i15;
   reg w;
   reg x;
   reg y;
   reg z;

   // Outputs
   wire F;

   // Instantiate the Unit Under Test (UUT)
   mux16_to_1 uut (
       .i0(i0),
       .i1(i1),
       .i2(i2),
       .i3(i3),
       .i4(i4),
       .i5(i5),
       .i6(i6),
       .i7(i7),
       .i8(i8),
       .i9(i9),
       .i10(i10),
       .i11(i11),
       .i12(i12),
       .i13(i13),
       .i14(i14),
       .i15(i15),
       .w(w),
       .x(x),
       .y(y),
       .z(z),
       .F(F)
   );

   initial begin
       // Initialize Inputs
       i0 = 0;
       i1 = 0;
       i2 = 1;
       i3 = 0;
       i4 = 1;
       i5 = 1;
       i6 = 0;
       i7 = 0;
       i8 = 1;
       i9 = 0;
       i10 = 0;
       i11 = 1;
       i12 = 1;
       i13 = 0;
       i14 = 1;
       i15 = 1;
       w = 0;
       x = 0;
       y = 0;
       z = 0;

       // Wait 100 ns for global reset to finish
       #100;
  
       // Add stimulus here

       end

initial begin

# 5 w=0; x=0; y=0; z=1;   //0000 combination for wxyz
# 5 w=0; x=0; y=1; z=0;   //0001 combination
# 5 w=0; x=0; y=1; z=1;
# 5 w=0; x=1; y=0; z=0;
# 5 w=0; x=1; y=0; z=1;
# 5 w=0; x=1; y=1; z=0;
# 5 w=0; x=1; y=1; z=1;
# 5 w=1; x=0; y=0; z=0;
# 5 w=1; x=0; y=0; z=1;
# 5 w=1; x=0; y=1; z=0;
# 5 w=1; x=0; y=1; z=1;
# 5 w=1; x=1; y=0; z=0;
# 5 w=1; x=1; y=0; z=1;
# 5 w=1; x=1; y=1; z=0;
# 5 w=1; x=1; y=1; z=1;

end
     
  
endmodule

waveforms


Related Solutions

Implement a 4x4 multiplier using gate level (verilog code and test bench)
Implement a 4x4 multiplier using gate level (verilog code and test bench)
Using the conditional assignment statements, write the verilog code for 16:1 Mux. Write the test bench...
Using the conditional assignment statements, write the verilog code for 16:1 Mux. Write the test bench for this module.
Implement a JK Flip flop using behavioral modeling in verilog, also write its test bench code.
Implement a JK Flip flop using behavioral modeling in verilog, also write its test bench code.
Implement 1x4 de-multiplexer using data flow modeling in verilog, also write its test bench.
Implement 1x4 de-multiplexer using data flow modeling in verilog, also write its test bench.
Write the VERILOG code for an arithmetic/logic unit (ALU) with a test bench that does the...
Write the VERILOG code for an arithmetic/logic unit (ALU) with a test bench that does the following with 4 bit inputs , and can be tested in on nexys 4 board This is to be implement on : ISE Design Suite - Xilinx /* ALU Arithmetic and Logic Operations ---------------------------------------------------------------------- |ALU_Sel| ALU Operation ---------------------------------------------------------------------- | 0000 | ALU_Out = A + B; ---------------------------------------------------------------------- | 0001 | ALU_Out = A - B; ---------------------------------------------------------------------- | 0010 | ALU_Out = A * B;...
Can anyone write a Verilog code and a test bench for a universal shift register with...
Can anyone write a Verilog code and a test bench for a universal shift register with 4 bits using D flip flop? Thanks
Write the Verilog code and test bench for the following circuits: - Mealy State machine design...
Write the Verilog code and test bench for the following circuits: - Mealy State machine design for a Serial Adder Circuit - Moore State Machine design for a Serial Adder Circuit
verilog code of a 64 x64 array with 128 parameters please include test bench
verilog code of a 64 x64 array with 128 parameters please include test bench
code an 8 bit LFSR random number generator in system verilog. Write a test bench, load...
code an 8 bit LFSR random number generator in system verilog. Write a test bench, load the seed 11111111, and generate the first 10 random numbers.
Present a screenshot of the following Program to open up the created file in C++ language....
Present a screenshot of the following Program to open up the created file in C++ language. The list of random numbers will be below the instructions I have provided for you a file named Random.txt for use in this program. This file contains a long list of random numbers. You are to write a program that opens the file, reads all the numbers from the file and calculates the following: A. The number of numbers in the file B. The...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT