vhdl process synchronous clocks

OP (Firma: 2s) #6121290
Lesenswert?

Question about *VHDL*:

When i run this it shows to synchronous clk signals
1
process 
2
begin
3

4
tb_CLK <= '1';
5
tb_SPI_CLK <='1';
6
wait for 1 ns;
7
tb_CLK <= '0' ;
8
tb_SPI_CLK <='0';
9
wait for 1 ns;
10

11
end process;

When I run this it shows both signals but tb_SPI_CLK is 1 clock tick 
shifted :(
Why doesnt it work sequentially in the process ?
1
process 
2
begin
3

4
tb_CLK <= '1';
5
tb_SPI_CLK <=tb_CLK ;
6
wait for 1 ns;
7
tb_CLK <= '0' ;
8
tb_SPI_CLK <=tb_CLK ;
9
wait for 1 ns;
10

11
end process;


Thank you :D
Gast #6121336
Lesenswert?

Signals are assigned at the end of a block 'same-time-assignments'.
1
tb_CLK <= '1';
2
tb_SPI_CLK <=tb_CLK ;
Assume, both signals are '0' at first. Then, at the 'wait', tb_SPI_CLK 
takes the value of tb_CLK, which is still '0' and tb_CLK is set to '1'.
The order of assignments which happen at the same time does not matter.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren