Verilog Assignment code

Status
Not open for further replies.

hareeshP

Member level 3
Joined
Jul 19, 2017
Messages
59
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
491
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;

 

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:
https://www.asic-world.com/verilog/veritut.html
 

can you please convert the above code into vhdl?
 

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.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…