Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

posedge and negedge in verilog always block

Status
Not open for further replies.

sunidrak

Full Member level 1
Joined
Apr 12, 2012
Messages
97
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
Bengaluru, India
Activity points
1,738
hi

can anybody explain


always @(posedge clk or negedge rst)
if(rst)
q<=0;
else
q<=d;
.
.
.
if reset is active high and and i want apply it as posedge . . is it possible to do



regards
Sunil
 

The correct syntax is
Code:
always @(posedge clk or posedge rst)
if(rst)
q<=0;
else
q<=d

for active low reset

Code:
always @(posedge clk or negedge rst)
if(!rst)
q<=0;
else
q<=d;

Please consider that the required Verilog syntax for asynchronous register control hasn't to do with edges, it's actually describing level triggering.
 
  • Like
Reactions: tpetar

    tpetar

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top