Posts
Showing posts from January, 2025
Latest Post
Verilog: 4 Bit Counter Behavioral Modelling using If Else Statement
- Get link
- X
- Other Apps
Verilog Code for 4 Bit Counter Behavioral Modelling using If Else Statement module 4_bit_Count( input clock, reset, output [3:0]dout ); reg [3:0]dout; initial dout = 0; always @ (posedge (clock)) begin if (reset) dout <= 0; else dout <= dout + 1; end endmodule Xillinx Output: 4 Bit Counter Behavioral Modelling Response Also See: List of Verilog Programs
Verilog: Full Adder Behavioral Modelling with Testbench Code
- Get link
- X
- Other Apps
Verilog Code Full Adder Behavioral Modelling module Full_Adder ( input a, b, cin; output sum, carry ); always @(a or b or cin) assign {carry,sum} = a + b + cin; 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; cin=1; #100 a=1; b=0; cin=1; #100 a=1; b=1; cin=1; end initial begin #100 $ monitor (“a=%b, b=%b, cin=%b, sum=%b, carry=%b”, a, b, cin, sum, carry); end endmodule Xilinx Output: Verilog code for Full Adder Behavioral Modelling
Verilog Code for Gray to Binary Dataflow Modelling
- Get link
- X
- Other Apps
Verilog Code for Gray to Binary Dataflow Modelling module gray_to_binary( input g0, input g1, input g2, input g3, output b0, output b1, output b2, output b3 ); assign b0 = g0;buf(b0,g0); assign b1 = g0 ^ g1; assign b2 = g0 ^ g1 ^ g2; assign b3 = g0 ^ g1 ^ g2 ^ g3; endmodule //Testbench code for Gray to Binary Dataflow Modelling initial begin ...
VLSI: 2-4 Decoder Dataflow Modelling with Testbench
- Get link
- X
- Other Apps
Verilog Code for 2-4 Decoder Dataflow Modelling module decoder_2_to_4( input a0, input a1, output d0, output d1, output d2, output d3 ); assign an0 = ~ a0; assign an1 = ~ a1; assign d0 = an0 & an1; assign d1 = a0 & an1; assign d2 = an0 & a1; assign d3 = a0 & a1; endmodule //Testbench code for 2-4 Decoder Dataflow Modelling initial begin ...