Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduccin
2. Unidades de Compilacin
Declaracin de Library Usage
Declaracin de Entity
Declaracin de Architecture
Declaracin de Package
Declaracin de Configuration
-- ref. 11
-- ref. 3
-- ref. 4
-- ref. 10
-- ref. 14
3. Declaracin de Entity
entity n_input_nand is
generic (n:integer := 2);
port (data : in bit_vector( 1 to n);
result :out bit );
end n_input_nand;
-- modo : in |out |inout |buffer |linkage
5. Operadores
and, or, xor, nand, nor, xnor, not
=, /=, <, <=, >, >=
sll, srl
sla, sra
rol, ror
+, -, *, **, /, mod, abs, rem
&
6. Tipos de Datos
6.1 Tipos de Datos Predefinidos
0 y 1
integer
array de bit
natural
true y false
positive
7 bit ASCII
real
array de caracteres
hr,min,sec,ms,us,ns,ps,fs
Boolean
sigtype
sigtype
Boolean
time
time
sigtype
Boolean
Boolean
bit
2
0
Z
X
X
Verdad si actividad en sig
Copia de sig retrasada en T
Valor del driver de sig
Verdad si evento en sig
Tiempo desde ultima actividad
Tiempo desde el ultimo evento
Valor antes del ultimo evento
Actividad (now T) to now
Evento (now T) to now
Cambia la actividad de sig
9. Instrucciones
9.1 Instruccione concurrentes.
bit
bit_vector
boolean
character
string
time
sigactive
sigdelayed(T)
sigdriving_value
sigevent
siglast_active
siglast_event
siglast_value
sigquiet(T)
sigstable(T)
sigtransactio
integer
fourval
fourval
fourval
fourval
7. Declaraciones
4. Declaracin de Architecture
lgicos :
relacionales :
shift left/right logicos :
shift left/rightaritmeticos:
rotar left/right logicos:
matematicos :
concatenacion:
fourvalpos(Z)
fourvalpred(1)
fourvalrightof(1)
fourvalsucc(Z)
fourvalval(3)
8. Atributos
-- type my_array is array (9downto 0) of any_type;
-- variable an_array :my_array;
-- type fourval is (0, 1, Z, X );
-- signal sig :sigtype;
-- constant T:time := 10 ns;
Attribute
my_arrayhigh
my_arrayleft
my_arraylow
my_arrayright
my_arrayascending
my_arraylength
my_arrayrange
my_arrayreverse_range
Result type
any_type
any_type
any_type
any_type
boolean
integer
integer
integer
Result
9
9
0
0
false
10
9 downto 0
0 to 9
top_block :block
-- declaraciones
-- ref. 7
begin
-- instrucciones concurrentes -- ref. 9
end block;
fourvalleftof(0)
fourvalleftof(1)
fourval
fourval
error
0
12. Subprogramas
9.2 Instrucciones Secuenciales
null;
-- no hace nada
wait on sig1, sig2 until (sig =1 ) for 30 ns;
wait until (clockevent and clock =1 );
read_flag := 0; -- asignacin de variable
if (x<y) then max := y;
elsif (x>y)then max := x;
else max := x; -- optional
end if;
-- opcional
procedure clock_buffer
(
signal local_clk :inout bit;
signal clk_pin :in bit;
constant clock_skew :in time )is
begin
-- ejemplo de efectos en un procedure
case a is
when 1 | 0 => d <= 1;
when Z
=> d<= 0;
when others => d<= X; -- opcional
end case;
while (x<y) loop
next when (x>5);
x:= x+1;
end loop;
for iin (0to 100 ) loop
x:= x+i;
exit when (x=0);
end loop;
-- uso de next
-- ref. 7
-- ref. 7