Question: the question : find a verilog code for 4 bit up /down counter with testbench by using behavioral modeling with using (parameter .... s0=4'b0000,s1=4'b0001...s15=4'b1111) (use

the question : find a verilog code for 4 bit up /down counter with testbench by using behavioral modeling with using (parameter .... s0=4'b0000,s1=4'b0001...s15=4'b1111)

(use edaplayground).

this is an example but this is for 3 bit counter

the question : find a verilog code for 4 bit up /down

testbench.sv design.sv SV/Verilog Testbench 1 // Code your testbench here 2 // or browse Examples 3 5 6 module test; 7 8 reg clock, reset; 9 reg [2:0] count; 10 11 counter ci (count, clock, reset); 12 13 initial 14 begin 15 clock - 1'b; 16 repeat (20) 17 #10 clock = clock; 18 end 19 20 initial 21 reset-1; 22 23 24 25 initial 26 Smonitor ($time, "count-%b", count); b 27 28 endmodule module counter Coutput [2: ] count_val, input clock, reset); SV/Verilog Design 3 reg [2: 6] state; 4 5 parameter so = 3'6000, S1 - 3'b001, S2 = 3'b010, S3 = 3'b011, 54 - 3'5100, = S5 - 3'b101, 56 - 3'b110, S7 - 3'bili; 6 7 8 always @ posedge clock, negedge reset) 9 if (reset == ) State

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!