Forum Discussion

ASing173's avatar
ASing173
Icon for New Contributor rankNew Contributor
6 years ago

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.

9 Replies

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

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

    #iwork4intel

  • ASing173's avatar
    ASing173
    Icon for New Contributor rankNew Contributor

    still I am facing the same problem tough my test bench clk toggling now....

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

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

    #iwork4intel

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

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

    #iwork4intel

  • ASing173's avatar
    ASing173
    Icon for New Contributor rankNew Contributor

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