You are on page 1of 42

Department of Electrical and Computer Engineering

University of Waterloo





 !"

#
$




Copyright © 2005 by W. D. Bishop. All Rights Reserved


!"

% &
' 
' 
' 
' ()

% *
' +,
' -.-
' (
' 
' +

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


!"$"%

% /
' 
' (0
' 

  #

Copyright © 2005 by W. D. Bishop. All Rights Reserved


Department of Electrical and Computer Engineering
University of Waterloo

!&&

Copyright © 2005 by W. D. Bishop. All Rights Reserved


'""

%  


V ery High Speed Integrated Circuit


H ardware
D escription
L anguage

% 
&

% 
/

 

Copyright © 2005 by W. D. Bishop. All Rights Reserved


)*
% &(1(
2+34563476
' (& "("
' /&0/&

% &$
' 3473-&&
' 3478-&
' 3475-193658934752&
' 344:-1936589344:2&
' ;66;-1936589;66;2&

% &/
)

  (

Copyright © 2005 by W. D. Bishop. All Rights Reserved


'"",)

%   


' 

'  / &

'  / &


%   


&
' &
' <)

  +

Copyright © 2005 by W. D. Bishop. All Rights Reserved


'"",)$"%

%  


' &*+=.

' 
 

%  


' 
.(

  -

Copyright © 2005 by W. D. Bishop. All Rights Reserved


/""0)"

% +>& )
/&&$
'  !
" #
!$!
!%#

% >& &$
' 
!&'$(
"$)%
#

  .

Copyright © 2005 by W. D. Bishop. All Rights Reserved


0"1"*
% '222+(3.-+
' (?@+A

% '222+('4256527'!403..
' (?@39BB4:5937393A

% '222+(3..#
' (?@39BB4:59:5897A

% '222+(3
' (?@695:739::;89CA

% '222+(3
' (?@695:739:;C596A

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


28""
% '222+(3...
' (./9(/@695:73938C697A

% '222+(3..(
' (+,@39BB4:5974C97A

% '222+(#3..+
' ((+,@39BB4:594;:9BA

% '222+(93..
' (..((@39BB4:5984396A

% '222+( 38888
' ( +,@<()A

% '222+((3...
' (?1?2(@695:73937349;A

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


5'2220"
% '222(93..#
' ( (@39BB4:59;4496A

% '222#(93..
' (>D&
@39BB4:595;59BA

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


5*"

% &


% *-&
$

' +--: -=&-<&E,-<E-


3447"

' +F".-G=-; -


H+-"-(*-.-;66;"

' (>&I, -*


&-; -=&9-<&E,-<E-
;66C"

  #

Copyright © 2005 by W. D. Bishop. All Rights Reserved


Department of Electrical and Computer Engineering
University of Waterloo

:""

Copyright © 2005 by W. D. Bishop. All Rights Reserved


4",/"&""

% *-&
&$
' .,&&
' .&&
' . # 


% -
' 12&

' 
&

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


"6;,

% ,--
,&

% +,


% &/ieee 
std_logic_1164 ,$

LIBRARY ieee;

USE ieee.std_logic_1164.ALL;

  (

Copyright © 2005 by W. D. Bishop. All Rights Reserved


2"7"
/"*,"
% 
-J9&

% ./


% .--

Entity

1 Co n
n f ig
Configuration 2

tio u ra
a tio
ur n n
ig
nf
Co

Architecture 1 … Architecture n

Architecture 2

  +

Copyright © 2005 by W. D. Bishop. All Rights Reserved


2"

% .G/

% &$
3" 
;" .9

:" .
&

% =

  -

Copyright © 2005 by W. D. Bishop. All Rights Reserved


2")"

% &$

ENTITY entity_name IS
GENERIC(
generic_1_name : generic_1_type;
generic_2_name : generic_2_type;
generic_n_name : generic_n_type
);
PORT(
port_1_name : port_1_dir port_1_type;
port_2_name : port_2_dir port_2_type;
port_n_name : port_n_dir port_n_type
);
END entity_name;

  .

Copyright © 2005 by W. D. Bishop. All Rights Reserved


282")"

% &/
.<$

ENTITY andgate IS
PORT ( a : IN std_logic;
b : IN std_logic;
c : OUT std_logic );
END andgate;

4!2<

+?-
9
"

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


6

% +$
' --K
' .&&
' 

% +$ 4!2<
IN 
OUT  .
LM
INOUT > "
BUFFER >

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


6$"%

% 338C9344:,&

' /)
std_logic_1164 ,
' &
)$
std_logic
std_logic_vector(<max> DOWNTO <min>)

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


7

% .G


% 

% */-&
&)&
$
' +
' .
' +&
' (

  #

Copyright © 2005 by W. D. Bishop. All Rights Reserved


7"

% .&$

ARCHITECTURE architecture_name OF entity_name IS


BEGIN
-- Insert VHDL statements to assign outputs to
-- each of the output signals defined in the
-- entity declaration.
END architecture_name;

  9

Copyright © 2005 by W. D. Bishop. All Rights Reserved


287"

% &/
.<$

ARCHITECTURE synthesis1 OF andgate IS


BEGIN
c <= a AND b;
END synthesis1;

4!2<

,&AND 
.<"

  

Copyright © 2005 by W. D. Bishop. All Rights Reserved


/"*,"

% .&


% >-/

% 


% 
&

  (

Copyright © 2005 by W. D. Bishop. All Rights Reserved


0,"

% (&

% (

% (&

% (

% 9$
' /
' 

  +

Copyright © 2005 by W. D. Bishop. All Rights Reserved


0,"5""

% >&


")
*3 N1G *6 N0G

% +&


% .
&

  -

Copyright © 2005 by W. D. Bishop. All Rights Reserved


3,5""

% 192
9
,&

% &9
ieee.std_logic_1164$
' 9 C
' 9 4

  .

Copyright © 2005 by W. D. Bishop. All Rights Reserved


3 9

% 9 C;1NXGNZG2
$

3 9
*3 N1G * ,& NXG
*6 N0G  NZG

% !&

% 9C


  #

Copyright © 2005 by W. D. Bishop. All Rights Reserved


3 .

% 9 4B
$

3 .
) NUG !,3 NHG
G N-G !,6 NLG
*3 N1G !, ,& NWG
*6 N0G  NZG
* ,& NXG

% (&

% (&


  #

Copyright © 2005 by W. D. Bishop. All Rights Reserved


"3.

% *)94$


std_ulogic
std_ulogic_vector( <max> DOWNTO <min>)

?
std_logic
std_logic_vector( <max> DOWNTO <min> )

% ?
&


  #

Copyright © 2005 by W. D. Bishop. All Rights Reserved


3'")

% 9&
9

) /
BIT >- 
BIT_VECTOR >- -.
INTEGER >- -.
REAL *+

% >9&,&&


% >9
/

  ##

Copyright © 2005 by W. D. Bishop. All Rights Reserved


0)"0"

% .)

% <)

% &$

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY simple_buffer IS
PORT ( din : IN std_logic;
dout : OUT std_logic );
END simple_buffer;

ARCHITECTURE behavioural1 OF simple_buffer IS


BEGIN
dout <= din AFTER 10 ns;
END behavioural1;

  #9

Copyright © 2005 by W. D. Bishop. All Rights Reserved


0)"0"$"%

%   36 


' 9&O E(
' O +?.+(
' O <

% )

% (
),&

% )4:

  #

Copyright © 2005 by W. D. Bishop. All Rights Reserved


,!

% &$

.< <.< <


? <?
P? P<?

% /
&

  #(

Copyright © 2005 by W. D. Bishop. All Rights Reserved


!!

% &$
Q 102
KQ 1<02
R 12
S 1=2

% &$
T 1.2
9 1(2
U 12
K 12

  #+

Copyright © 2005 by W. D. Bishop. All Rights Reserved


7,""0"
SIGNAL a, b, c : std_logic;
SIGNAL avec, bvec, cvec : std_logic_vector(7 DOWNTO 0);

-- Concurrent Signal Assignment Statements


-- NOTE: Both a and avec are produced concurrently
a <= b AND c;
avec <= bvec OR cvec;

-- Alternatively, signals may be assigned constants


a <= ’0’;
b <= ’1’;
c <= ’Z’;
avec <= "00111010"; -- Assigns 0x3A to avec
bvec <= X"3A"; -- Assigns 0x3A to bvec
cvec <= X"3" & X"A"; -- Assigns 0x3A to cvec

  #-

Copyright © 2005 by W. D. Bishop. All Rights Reserved


7,""0"$"%
SIGNAL a, b, c, d :std_logic;
SIGNAL avec :std_logic_vector(1 DOWNTO 0);
SIGNAL bvec :std_logic_vector(2 DOWNTO 0);

-- Conditional Assignment Statement


-- NOTE: This implements a tree structure of logic gates
a <= ’0’ WHEN avec = “00” ELSE
b WHEN avec = “11” ELSE
c WHEN d = ’1’ ELSE
’1’;

-- Selected Signal Assignment Statement


-- NOTE: The selection values must be constants
bvec <= d & avec;
WITH bvec SELECT
a <= ’0’ WHEN “000”,
b WHEN “011”,
c WHEN “1--”, -- Some tools won’t synthesize ‘-’ properly
’1’ WHEN OTHERS;

  #.

Copyright © 2005 by W. D. Bishop. All Rights Reserved


7,""0"$"%
SIGNAL a :std_logic;
SIGNAL avec, bvec :std_logic_vector(7 DOWNTO 0);

-- Selected Signal Assignment Statement


-- NOTE: Selected signal assignments also work
-- with vectors
WITH a SELECT
avec <= “01010101” WHEN ’1’,
bvec WHEN OTHERS;

  9

Copyright © 2005 by W. D. Bishop. All Rights Reserved


60"

% 

% +

% +

' (&


% */-99
,
' 99
,
' &-

  9

Copyright © 2005 by W. D. Bishop. All Rights Reserved


60"

% ,&
&$

!6 '"6
WHEN..ELSE IF..ELSIF..ELSE..END IF

WITH..SELECT..WHEN CASE..WHEN..END CASE

% .
0&

% +-
0

  9

Copyright © 2005 by W. D. Bishop. All Rights Reserved

You might also like