+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Member level 3
    Points: 322, Level: 3

    Join Date
    Jul 2017
    Posts
    54
    Helped
    1 / 1
    Points
    322
    Level
    3

    Verilog Assignment code

    Hi All,
    Please anyone tell me how the below code works?

    Code Verilog - [expand]
    1
    
    assign  Reset = (a & cnt[19])? (ok_cnt[19]? b: 1'b1) : b;

    •   Alt1st August 2017, 10:23

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 35,066, Level: 45
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,423
    Helped
    1871 / 1871
    Points
    35,066
    Level
    45

    Re: Verilog Assignment code

    Reset is assigned based on the conditions on the RHS.

    ? is the conditional operator in verilog:
    (condition) ? (value when condition_is_true) : (value when condition_is_false);

    Remember in verilog, like C, any non-zero value counts as true.

    - - - Updated - - -

    Btw - google will get you many Verilog tutorials - here is the first hit for me:
    http://www.asic-world.com/verilog/veritut.html



    •   Alt1st August 2017, 10:29

      advertising

        
       

  3. #3
    Member level 3
    Points: 322, Level: 3

    Join Date
    Jul 2017
    Posts
    54
    Helped
    1 / 1
    Points
    322
    Level
    3

    Re: Verilog Assignment code

    can you please convert the above code into vhdl?



    •   Alt1st August 2017, 11:04

      advertising

        
       

  4. #4
    Advanced Member level 5
    Points: 35,066, Level: 45
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,423
    Helped
    1871 / 1871
    Points
    35,066
    Level
    45

    Re: Verilog Assignment code

    Quote Originally Posted by hareeshP View Post
    can you please convert the above code into vhdl?
    Following through the Verilog tutorials should mean you could do this yourself.



  5. #5
    Member level 3
    Points: 322, Level: 3

    Join Date
    Jul 2017
    Posts
    54
    Helped
    1 / 1
    Points
    322
    Level
    3

    Re: Verilog Assignment code

    actually i am following the vhdl tutorial and i wants convert a verilog source code into vhdl one. So i need to understand the logic used in verilog.



--[[ ]]--