Posts

Showing posts from March, 2022

Ads

Verilog: 8 to 1 Multiplexer (8-1 MUX) Dataflow Modelling with Testbench Code

Image
  Verilog Code for 8 to 1 Multiplexer Dataflow Modelling module mux_8to1(     input a, input b, input c, input D0, input D1, input D2, input D3, input D4, input D5, input D6, input D7, output out, ); module m81( output out, input D0, D1, D2, D3, D4, D5, D6, D7, S0, S1, S2); assign S1bar=~S1; assign S0bar=~S0; assign S2bar=~S2; assign out = (D0 & S2bar & S1bar & S0bar) | (D1 & S2bar & S1bar & S0) | (D2 & S2bar & S1 & S0bar) + (D3 & S2bar & S1 & S0) + (D4 & S2 & S1bar & S0bar) + (D5 & S2 & S1bar & S0) + (D6 & S2 & S1 & S0bar) + (D7 & S2 & S1 & S0); endmodule //Testbench code for 8-1 MUX Dataflow Modelling initial begin // Initialize Inputs a= 0;b = 0;c = 0;D0 = 1;D1 = 0;D2 = 0;D3 = 0;D4 = 0;D5 = 0;D6 = 0;D7 = 0; // Wait 100 ns for global reset to finish #100; // Add stimulus here #100; a = 0;b = 0;c = 1;d0 = 0;d1 = 1;d2 =

Verilog: 2 to 1 Multiplexer (2-1 MUX) Dataflow Modelling with Testbench Code

Image
  Verilog Code for 2 to 1 Multiplexer Dataflow Modelling module two_to_1_mux(      output Y,      input D0, D1, S,      wire T1, T2, Sbar );      assign T1 = D1 & S;      assign   T2 = D0 & Sbar;      assign Sbar = ~ S;      assign Y = T1 | T2; endmodule //Testbench code for 2-1 MUX (Multiplexer) Dataflow Modelling initial  begin // Initialize Inputs      S = 0; D0 = 0; D1 = 0; // Wait 100 ns for global reset to finish      #100; // Add stimulus here      #100; S = 0;D0 = 0;D1 = 1;      #100; S = 0;D0 = 1;D1 = 0;      #100; S = 0;D0 = 1;D1 = 1;      #100; S = 1;D0 = 0;D1 = 0;      #100; S = 1;D0 = 0;D1 = 1;      #100; S = 1;D0 = 1;D1 = 0;      #100; S = 1;D0 = 1;D1 = 1;   end Xillinx Output: 2-1 MUX Dataflow Modelling Also See: List of Verilog Programs

Ads

Popular posts from this blog

VLSI: BCD to Excess 3 and Excess 3 to BCD Dataflow Modelling

Full Subtractor Verilog Code in Structural/Gate Level Modelling with Testbench

VLSI: 4-1 MUX Dataflow Modelling with Testbench

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

1 to 4 DEMUX (Demultiplexer) Verilog CodeStructural/Gate Level Modelling with Testbench