Design a 3 to 8 Decoder Using Verilog Hdl
VLSI: 3-8 Decoder Structural/Gate Level Modelling with Testbench
Verilog Code for 3-8 Decoder Structural/Gate Level Modelling
3-8 Line Decoder |
module decoder3_to_8( input x, input y, input z, output d0, output d1, output d2, output d3, output d4, output d5, output d6, output d7 ); and(d0,xn,yn,zn),(d1,xn,yn,z),(d2,xn,y,zn),(d3,xn,y,z),(d4,x,yn,zn),(d5,x,yn,z),(d6,x,y,zn),(d7,x,y,z); not(xn,x),(yn,y),(zn,z); endmodule initial begin // Initialize Inputs x = 0;y = 0;z = 0; // Wait 100 ns for global reset to finish #100; // Add stimulus here #100;x = 0;y = 0;z = 1; #100;x = 0;y = 1;z = 0; #100;x = 0;y = 1;z = 1; #100;x = 1;y = 0;z = 0; #100;x = 1;y = 0;z = 1; #100;x = 1;y = 1;z = 0; #100;x = 1;y = 1;z = 1;
//Testbench code for 3-8 Decoder Structural/Gate Level Modelling
Output:
Popular posts from this blog
Full Subtractor Verilog Code in Structural/Gate Level Modelling with Testbench
Verilog Code for Full Subtractor Structural/Gate Level Modelling module full_sub(borrow,diff,a,b,c); output borrow,diff; input a,b,c; wire w1,w4,w5,w6; xor (diff,a,b,c); not n1(w1,a); and a1(w4,w1,b); and a2(w5,w1,c); and a3(w6,b,c); or o1(borrow,w4,w5,w6); endmodule //Testbench code for Full Subtractor Structural/Gate Level Modelling initial begin // Initialize Inputs a = 0; b = 0; c = 0; // Wait 100 ns for global reset to finish #100; // Add stimulus here #100; a = 0;b = 0;c = 1; #100; a = 0;b = 1;c = 0; #100; a = 0;b = 1;c = 1; #100; a = 1;b = 0;c = 0; #100; a = 1;b = 0;c = 1; #100; a = 1;b = 1;c = 0; #100; a = 1;b = 1;c = 1; end Output: RTL Schematic: Full Subtractor Verilog Other Verilog Programs: Go to Index of Verilog Programming
Verilog: 2 - 4 Decoder Structural/Gate Level Modelling with Testbench
Verilog Code for 2-4 Decoder Structural/Gate Level Modelling 2-4 Line Decoder module decoder_2_to_4( input a0, input a1, output d0, output d1, output d2, output d3 ); not (an0,a0),(an1,a1); and (d0,an0,an1),(d1,a0,an1),(d2,an0,a1),(d3,a0,a1); endmodule //Testbench code for 2-4 Decoder Structural/Gate Level Modelling initial begin // Initialize Inputs a0 = 0;a1 = 0; // Wait 100 ns for global reset to finish #100; // Add stimulus here #100; a0=1;a1=0; #100; a0=0;a1=1; #100; a0=1;a1=1; end Output: Verilog 2-4 Decoder Response Other Verilog Programs: Go to Index of Verilog Programming
1 to 4 DEMUX (Demultiplexer) Verilog CodeStructural/Gate Level Modelling with Testbench
Verilog Code for 1 to 4 DEMUX Structural/Gate Level Modelling 1-4 DEMUX module demux_1_to_4( input d, input s0, input s1, output y0, output y1, output y2, output y3 ); not(s1n,s1),(s0n,s0); and(y0,d,s0n,s1n),(y1,d,s0,s1n),(y2,d,s0n,s1),(y3,d,s0,s1); endmodule //Testbench code for 1 to 4 DEMUX Structural/Gate Level Modelling initial begin // Initialize Inputs d = 1; s0 = 0; s1 = 0; // Wait 100 ns for global reset to finish #100; // Add stimulus here #100;d = 1;s0 = 1;s1 = 0; #100;d = 1;s0 = 0;s1 = 1; #100;d = 1;s0 = 1;s1 = 1; end Output: Verilog 1-4 DEMUX Verilog Code Response Other Verilog Programs: Go to Index of Verilog Programming
Verilog: Half Adder Behavioral Modelling with Testbench Code
Verilog Code Half Adder Behavioral Modelling module Half_Adder ( input a, b; output sum, carry ); always @(a or b) assign {carry,sum} = a + b; endmodule // test-bench initial begin a=0; b=0; #100; //wait 100ns for global reset to finish //add stimulus here #100 a=0; b=1; #100 a=1; b=0; #100 a=1; b=1; end initial begin #100 $ monitor ("a=%b, b=%b, sum=%b, carry=%b", a, b, sum, carry); end endmodule Xilinx Output: Half Adder Verilog Code Behavioral Modelling
VLSI: BCD to Excess 3 and Excess 3 to BCD Dataflow Modelling
module bcd_ex3_Dataflow( input a, input b, input c, input d, output w, output x, output y, output z ); assign w = (a | (b & c) | (b & d)); assign x = (((~b) & c) | ((~b) & d) | (b & (~c) & (~d))); assign y = ((c & d) | ((~c) & (~d))); assign z = ~d; endmodule Excess 3 to BCD: module ex3_to_bcd( input w, input x, input y, input z, output a, output b, output c, output d ); assign a = ((w & x) | (w & y & z)); assign b = (((~x) & (~y)) | ((~x) & (~z)) | (x & y & z)); assign c = (((~y) & z) | (y & (~z))); assign d = ~z; endmodule
Design a 3 to 8 Decoder Using Verilog Hdl
Source: https://space-inst.blogspot.com/2020/05/vlsi-3-8-decoder-structuralgate-level.html
0 Response to "Design a 3 to 8 Decoder Using Verilog Hdl"
Postar um comentário