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

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.