1 / 12

Curs 03 Sinte za logică a circuitelor secvenţiale

Curs 03 Sinte za logică a circuitelor secvenţiale. Descrierea VHDL a circuitelor elementare secven ţiale. Bistabile Registre Numărătoare. Descrierea VHDL a bistabilului D. library ieee; use ieee.std_logic_1164.all; entity dff is port ( clk : in std_logic; d : in std_logic;

stuart
Télécharger la présentation

Curs 03 Sinte za logică a circuitelor secvenţiale

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Curs 03Sinteza logică acircuitelor secvenţiale

  2. Descrierea VHDL a circuitelor elementare secvenţiale • Bistabile • Registre • Numărătoare

  3. Descrierea VHDL a bistabilului D library ieee; use ieee.std_logic_1164.all; entity dff is port ( clk : in std_logic; d : in std_logic; q : out std_logic); end dff; architecture beh of dff is begin process (clk) begin if (rising_edge(clk)) then q <= d; end if; end process; end beh; procesul este controlat NUMAI de semnalul de ceas: nu este transparent la variaţiile datei de intrare comportamentul circuitului este controlat de FRONTUL activ al semnalului de ceas; pe frontul activ al semnalului de ceas circuitul trece într-o nouă stare, altfel rămâne în vechea stare prin generarea unei celule de memorie. Logica sincronă a circuitului

  4. Descrierea VHDL a unui latch library ieee; use ieee.std_logic_1164.all; entity d_latch is port ( clk : in std_logic; d : in std_logic; q : out std_logic); end d_latch; architecture beh of d_latch is begin process (clk,d) begin if (clk=’1’) then q <= d; end if; end process; end beh; procesul este controlat de semnalul de ceas ŞI de data de intrare: este transparent atât la variaţiile semnalului de ceas cât şi ale datei de intrare tranziţia în noua stare se face pe PALIERUL activ al semnalului de ceas; altfel, se rămâne în vechea stare prin generarea unei celule de memorie.

  5. Inserarea semnalelor de inţializare SINCRONE semnal de iniţializare entity dff_rsinc is port ( clk : in std_logic; reset : in std_logic; d : in std_logic; q : out std_logic); end dff_rsinc; architecture beh of dff_rsinc is begin process (clk) begin if (rising_edge(clk)) then if (reset=’1’) then q <= ’0’; else q <= d; end if; end if; end process; end beh; procesul este controlat NUMAI de semnalul de ceas: procesul NUeste transparent la variaţia semnalelor sincrone (iniţializare şi data de intrare) comportamentul circuitului este controlat de FRONTUL activ al semnalului de ceas semnalul de iniţializare este PRIORITAR descrie logica sincronă: controlată de semnalul de ceas

  6. Inserarea semnalelor de inţializare ASINCRONE procesul este controlat de semnalul de ceas ŞI de semnalele de iniţializare architecture beh of dff_rasinc is begin process (clk, reset) begin if (reset=’1’) then q <= ’0’; elsif (rising_edge(clk)) then q <= d; end if; end process; end beh; descrie logica ASINCRONĂ: nu este controlată de semnalul de ceas; este PRIORITARĂ descrie logica SINCRONĂ: este controlată de semnalul de ceas

  7. Inserarea a 2 semnalelor de inţializare architecture beh of dff_rpasinc is begin process (clk, reset, preset) begin if (reset=’1’) then q <= ’0’; elsif (preset=’1’) then q <= ’1’; elsif (rising_edge(clk)) then .... end if; end process; end beh; logica ASINCRONĂ: se impune pentru semnalele de iniţializare o anumită prioritate (nu se utilizează CASE) logica SINCRONĂ

  8. Descrierea VHDL a registrului paralel-paralel library ieee; use ieee.std_logic_1164.all; entity reg_p8 is generic (size: natural :=8); port ( clk : in std_logic; reset : in std_logic; -- asincron load : in std_logic; -- sincron d : in std_logic_vector (size-1 downto 0); q : out std_logic_vector (size-1 downto 0)); end reg_p8; architecture beh of reg_p8 is begin process (clk, reset) begin if (reset=’1’) then q <=(others=>’0’); elsif (rising_edge(clk)) then if (load = ‘1’) then q <= d; end if; end if; end process; end beh; logica ASINCRONĂ: logica SINCRONĂ:semnalul de încărcare load - prioritar

  9. Descrierea VHDL a operaţiei de deplasare, respectiv de rotire în registre 1. se declară un semnal intern tmp care stochează starea curentă a registrului: DEPLASARE DREAPTA: tmp <= ’0’ & tmp(size-1 downto 1); ROTIRE DREAPTA: tmp <= tmp(0) & tmp(size-1 downto 1); 2. valoarea lui tmp se atribuie ieşirii registrului în exteriorul procesului care descrie comportamentul registrului

  10. Exemplu VHDL de registru de deplasare stânga architecture beh of reg_p8 is signal tmp : std_logic_vector(size-1 downto 0); begin process (clk, reset) begin if (reset=’1’) then tmp <=(others=>’1’); elsif (rising_edge(clk)) then if (load = ‘1’) then tmp <= d; else tmp <= tmp(size-2 downto 0) & ‘0’;end if; end if; end process; q <= tmp; end beh;

  11. Generarea accidentală a registrelor COD VHDL SCHEMA GENERATĂ DUPĂ SINTEZA LOGICĂ

  12. în proces se precizează modul în care numărătorul îşi schimbă starea valorile semnalelor de ieşire se precizează în exteriorul procesului Descrierea VHDL a numărătoarelor binare conţine “+” pt. tipul std_logic library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity counter is generic (size: natural :=4); port ( clk,rst : in std_logic; d : in std_logic_vector (size-1 downto 0); q : out std_logic_vector (size-1 downto 0)); end counter; architecture beh of counter is signal tmp : std_logic_vector (size-1 downto 0); begin process (clk,rst) begin if (rst='1') then tmp <= (others=>’0’); elsif (rising_edge(clk)) then tmp <= tmp+1; end if; end process; q <= tmp; q <= tmp WHEN (oe=’1’) ELSE (others =>’Z’); end beh; semnal intern – specifică starea curentă a numărătorului operaţia de numărare starea numărătorului se atribuie ieşirii în EXTERIORUL procesului buffer TS

More Related