is always@(posedge clk) similar to rising_edge(clk)??

Status
Not open for further replies.

brunokasimin

Member level 4
Joined
Jun 13, 2008
Messages
70
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,828
always @(posedge clk)

hello,

is always@(posedge clk) similar to rising_edge(clk)??

thx
 

Re: always @(posedge clk)

very similar.

Async set and clear are also listed as edge signals. The difference is whether or not the signal appears in a condition in the always block.
Code:
always @(posedge clk or posedge rst)
begin
  if (rst)          // listed signal used here, has priority
    do <= 8'h5A;    // constants only for async set and async clear
  else              // clk not mentioned
    do <= di;       // sync updates, by clk
end
 

Re: always @(posedge clk)

hello,

for example, here is a verilog code:

always @(posedge clk)
begin
err <= 0;
if (ce && (addr[0] || addr[1]))
err <= 1;
end

so, i can write a vhdl code here like this:

elsif rising_edge(clk) then
err <= '0';
if(ce && (addr(0) or addr(1))) then
err <='1';
end if;
end if;

Comments are really appreciated
 

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