2

Hi guys in the following process how the delayed assignment should be interpreted?

clk_process : process
begin
        clk <= '0','1' after 5 ns;
        wait for 10 ns;
end process;

Is it intepreted as...

clk is set to '0' for 5 ns then i changes into '1' and after 10 ns it is set again to '0'? or it is simply '0' for 5 ns and '1' for 5 ns?

I'm a bit confused...

user8469759
  • 618
  • 1
  • 11
  • 25

1 Answers1

3

The process has no sensitivity list, and a wait statement. It will therefore run repeatedly. The following stages can be seen:

  • Time = 0; set clk to '0', with a delayed assignment to '1' after 5 ns.
  • Start 10 ns wait.
  • Time = 5 ns. perform delayed assignment to '1'.
  • Time = 10 ns, wait statement has completed.
  • Go back to the start of the process

The end result is a clock, starting at '0', with a period of 10 ns.

scary_jeff
  • 1,977
  • 8
  • 11