Professional Documents
Culture Documents
Curso 2012-13
Introduccin
Comportamiento
Flujo de datos
Estructural
Abstraccin
Muy complejo!
Ejemplo sencillo
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY mi_mux IS
-- Multiplexor 2a1
PORT( a: in std_logic;
b: in std_logic;
sel: in std_logic;
z: out std_logic );
END;
ARCHITECTURE dataflow OF mi_mux IS
BEGIN
mi_
mux
b
sel
Ejemplo sencillo
Librera
Entidad
Arquitectura
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
Final de sentencia
Comentario
ENTITY mi_mux IS
-- Multiplexor 2a1
PORT( a: in std_logic;
b: in std_logic;
sel: in std_logic;
z: out std_logic );
a
END;
mi_
mux
b
sel
Libreras
Hace visible la librera IEEE
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
Hace visible el
package std_logic_1164
USE WORK.TYPES.ALL;
Entidad
Define la interfaz externa del diseo
Caja negra (nica)
ENTITY mi_entity IS
entradas
mi_entity
salidas
ent_sal
Arquitectura
Especifica la funcionalidad del diseo
configuration
Asignacin de seales:
nuevo_estado <= S0;
Operadores matemticos:
+, -, *
Operadores lgicos:
and, or, not, nand, nor, xor
Comparaciones:
Igualdad, desigualdad: =, /=
Mayor que, menor que: >, <
Mayor o igual que, menor o igual que: >=, <=
Procesos
clock: PROCESS
BEGIN
WAIT FOR 50 ns;
clk <= NOT clk;
END PROCESS;
valor
wait explcito
Secuencialidad y Concurrencia
Sentencia if
IF X = '0' THEN
nuevo_estado <= S0;
ELSE
nuevo_estado <= S2;
END IF;
Sentencia for
FOR i IN 15 DOWNTO 0
IF data_in(i) =
pb_temp
ELSE
pb_temp
END IF;
END LOOP;
LOOP
'0' THEN
<= '0';
<= '1';
Sentencia case
CASE current_state IS
WHEN RESET =>
count_end <=
...
WHEN RAMPA1 =>
count_clk_en
...
WHEN others =>
count_end <=
up_down
<=
END CASE;
'0';
'-';
'-';
Bancos de pruebas
testbench
Estmulos
entradas
mi_entity
salidas