Posts

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; ...

Verilog: 4 Bit Full Adder with Carry Select Dataflow Modelling with Testbench Code

  Verilog Code for 4 Bit Full Adder with Carry Select Dataflow Modelling: module FACS(       input [3:0]x,cin,       input [3:0]y,            output [3:0]s,       output cout,  );  //for carry '0'       fa f0(a0,c0,0,x[0],y[0]);       fa f1(a1,c1,c0,x[1],y[1]);       fa f2(a2,c2,c1,x[2],y[2]);       fa f3(a3,c3,c2,x[3],y[3]);  //for carry '1'       fa f4(a4,c4,1,x[0],y[0]);       fa f5(a5,c5,c4,x[1],y[1]);       fa f6(a6,c6,c5,x[2],y[2]);       fa f7(a7,c7,c6,x[3],y[3]);  //two:one MUX      mux m0(s[0],cin,a0,a4);       mux m1(s[1],cin,a1,a5);       mux m2(s[2],cin,a2,a6);       mux m3(s[3],cin,a3,a7);       mux m4(c...

Popular posts from this blog

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

VLSI: 1-4 DEMUX (Demultiplexer) Dataflow Modelling with Testbench

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

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

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