Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
78 Views

I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

Screenshot 2020-04-03 at 5.12.42 PM.png

0 Kudos
9 Replies
Highlighted
Valued Contributor III
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

Your testbench is not toggling the clock, so nothing is going to happen.

 

#iwork4intel

Highlighted
Beginner
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

thanks I will check with that.....

0 Kudos
Highlighted
Beginner
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

still I am facing the same problem tough my test bench clk toggling now....Screenshot 2020-04-07 at 9.07.58 AM.png

0 Kudos
Highlighted
Valued Contributor III
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

You changed your always block so it is no longer clocked. Put it back to always @(posedge clk).

 

#iwork4intel

0 Kudos
Highlighted
Beginner
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

Screenshot 2020-04-07 at 9.47.04 AM.png

0 Kudos
Highlighted
Beginner
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

still the same

0 Kudos
Highlighted
Valued Contributor III
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

I'm not familiar with this simulation tool, but perhaps you have to initialize or reset cout to a value instead of xxxx.

 

#iwork4intel

0 Kudos
Highlighted
Beginner
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

its online tool edaplayground (icarus Verilog 0.10.0)

count depends on the inputs given i.e the reset and enable and I am giving both logic so according to that logic the output should be produced...

0 Kudos
Highlighted
Beginner
6 Views

Re: I am writting the Verilog code and test bench for 4 bit shync up counter but I am not getting the desired output my code is below I should get cout as increased by 1 but I am not getting it when enable is high.

I got it...Screenshot 2020-04-07 at 2.52.36 PM.png

0 Kudos