Documente Academic
Documente Profesional
Documente Cultură
CONCEPTOS GENERALES
HISTORIA DE VHDL
Nace
Durante
VHDL
QU ES VHDL?
Lenguaje
de descripcin y modelado de
hardware
Su propsito inicial era solo el
modelado y simulacin lgica, dirigida
por eventos de sistemas digitales.
Actualmente se lo utiliza tambin para
la sntesis automtica de circuitos.
Diseado para describir (de forma tal
que los humanos puedan leer y
entender) la funcionalidad y la
organizacin de sistemas hardware.
PRINCIPALES USOS DE
VHDL
Modelado
Sntesis
Cdigo vhdl/verilog
NIVELES DE
ABSTRACCIN
Estructural
Una
Los
sub-mdulos se conectan
entre si por medio de seales.
Cada
NIVELES DE
ABSTRACCIN
RTL
Transferencia
a Nivel de Registros.
Es
Permite
la paralelizacin de
instrucciones.
Este
NIVELES DE
ABSTRACCIN
Modelo
Una
vez la estructura y el
comportamiento de un mdulo han sido
especificados, es posible simular el
mdulo ejecutando su descripcin
comportamental.
Esto
VHDL
EJECUCIN SERIE
EJECUCIN
CONCURRENTE
En
Ej.
PARALELISMO
El
Se
Entre
Se
EJEMPLO PARALELISMO
Y= A1xB1+A2xB2++ANxBN
A1
B1
A2
B2
AN
BN
Implementacin
Serie
X1
X2
Xn
AN
Xn
BN
Implementacin
Paralela
SINCRONIZACIN
Proceso 1
Unidad
de
Control
Proceso 2
Proceso N
VHDL
SINTAXIS DEL LENGUAJE
Ejemplo :
Las
Ejemplo:
Ejemplos
<=
Para asignar variables se utiliza :=
Para asignar seales se utiliza
TIPOS DE DATOS
Lgicos
STD_LOGIC
--'U','X','0','1','Z','W','L','H','-'
STD_LOGIC_VECTOR
BOOLEAN
--True or False
Escalares
INTEGER
--32 or 64 bits
NATURAL
--Integers >= 0
POSITIVE
--Integers > 0
REAL
--Floating-point
TIME
fs
OPERADORES
Aritmticos:
Suma
Resta
Multiplicacin
Divisin
Potenciacin
Valor
**
Absoluto abs()
OPERADORES
Desplazamiento:
OPERADORES
Relacionales:
Lgicos:
AND,
OR,
NOT,
NAND,
NOR
XOR
IGUAL QUE =
DIFERENTE QUE /=
Otros:
Concatenacin &
ELEMENTOS
SINTACTICOS
Comentarios:
doble
guin --
Identificadores:
no
Nmeros:
por
otras
bases as:
Binario
Hexa
2#1101110#
6#C9#
ELEMENTOS SINTACTICOS
Caracteres
entre
comillas simples H, o, l, a
Cadenas
entre
Bits
Entre
comillas simples 0, 1, Z
Cadenas
Binario
Octal
de bits:
B"11101001 o "11101001"
O"126"
Hexadecimal
X"FE"
ENTIDAD
SINTAXIS ENTIDAD
entity <entity_name> is
generic ( <generic_name> : <type> := <value>;
<other generics>...
);
port ( <port_name> : <mode> <type>;
<other ports>...
);
end <entity_name>;
EJEMPLO ENTIDAD
entity sumador is
generic ( N : INTEGER := 4
);
port ( A : in STD_LOGIC_VECTOR ( N-1 downto 0);
B : in STD_LOGIC_VECTOR ( N-1 downto 0);
C : out STD_LOGIC_VECTOR ( N-1 downto 0);
);
end sumador;
ARQUITECTURA
SINTAXIS ARQUITECTURA
architecture <arch_name> of <entity_name> is
-- declarative_items (signal declarations,
-- component declarations, etc.)
begin
-- architecture body
end <arch_name>;
EJEMPLO ARQUITECTURA
entity FA is
Port ( A : IN STD_LOGIC;
B : IN STD_LOGIC;
Cin : IN STD_LOGIC;
S : OUT STD_LOGIC;
Cout : OUT STD_LOGIC);
end FA;
architecture uno of FA
signal x : STD_LOGIC;
signal c0: STD_LOGIC;
signal c1: STD_LOGIC;
begin
x <= A xor B;
S <= Cin xor x;
c0 <= A and B;
c1 <= Cin and xor;
Cout <= c0 or c1;
end uno;
c1
c0