Altera_Forum
Honored Contributor
15 years agovhdl querry
Dear Friends,
I have been studying a code -- write_req <= fifo_i_addr_wren and u_cmd(1); p_data_req:process(phy_clk) begin if rising_edge(phy_clk) then if reset_phy_clk = '1' then write_req_1 <= '0'; write_req_2 <= '0'; else write_req_1 <= write_req; write_req_2 <= write_req_1; end if; end if; end process p_data_req; data_req <= write_req_2; In this code the data_req is a delayed (2 clock cycles) of write_req. I tried to understand this code - How is this delayed by 2 clock cycles? I am a conventional C coder. This is for delay of 2 cycles. If i use the same logiccc can I do for > 2 delays? How is this executed? I know that the process if-else is executed sequentially. Can anyone explain the logic here? How is this implemented in hardware? Is it done using a mux ? How does this work out then pls? Regards, Vinod.