SlideShare a Scribd company logo
1 of 68
Download to read offline
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
! "! "
% &
'
'
'
' ( )
% *
' + ,
' -. -
' (
'
' +
#
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)"/ " " 0)"
% + > & )
/ & & $
' !
" #
! $ !
! % #
% > & & $
'
! &'$(
" $ ) %
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0 " 1 " *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 " "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 '2220 "5 '2220 "
% '222 (93 ..#
' ( ( @39BB4:59;4496A
% '222 #(93 ..
' ( > D &
@39BB4:595;59BA
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
5 * "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 ",/ "& " "4 ",/ "& " "
% * - &
& $
' . , & &
' . & &
' . #
% -
' 1 2 &
'
&
(
Copyright © 2005 by W. D. Bishop. All Rights Reserved
" 6 ; ," 6 ; ,
% , - -
, &
% + ,
% & / ieee
std_logic_1164 , $
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
+
Copyright © 2005 by W. D. Bishop. All Rights Reserved
2" 7 "2" 7 "
/ "*, "/ "*, "
%
- J 9 &
% . /
% . - -
Entity
Architecture 1
Architecture 2
Architecture n…
Configuration
1 Configuration n
Configuration2
-
Copyright © 2005 by W. D. Bishop. All Rights Reserved
2"2"
% . G /
% & $
3"
;". 9
:".
&
% =
.
Copyright © 2005 by W. D. Bishop. All Rights Reserved
2" ) "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" ) "28 2" ) "
% & /
.< $
4! 2<
+ ? -
9
"
ENTITY andgate IS
PORT ( a : IN std_logic;
b : IN std_logic;
c : OUT std_logic );
END andgate;
Copyright © 2005 by W. D. Bishop. All Rights Reserved
66
% + $
' - - K
' .& &
'
% + $
IN
OUT
INOUT >
BUFFER >
4! 2<
.
L M
"
Copyright © 2005 by W. D. Bishop. All Rights Reserved
6 $ " %6 $ " %
% 338C9344: , &
' / )
std_logic_1164 ,
' &
) $
std_logic
std_logic_vector(<max> DOWNTO <min>)
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
77
% . G
%
% * / - &
& ) &
$
' +
' .
' + &
' (
9
Copyright © 2005 by W. D. Bishop. All Rights Reserved
7 "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;
Copyright © 2005 by W. D. Bishop. All Rights Reserved
28 7 "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,"0,"
% ( &
% (
% ( &
% (
% 9 $
' /
'
-
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0," 5 " "0," 5 " "
N0G* 6N1G* 3
" )
% > &
% + &
% .
&
.
Copyright © 2005 by W. D. Bishop. All Rights Reserved
33 , 5 " ", 5 " "
% 1 9 2
9
, &
% & 9
ieee.std_logic_1164$
' 9 C
' 9 4
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
33 99
% 9 C ; 1NXG NZG2
$
% ! &
% 9C
NZGN0G* 6
NXG* , &N1G* 3
3 9
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
33 ..
% 9 4 B
$
NXG* , &
NZGN0G* 6
NWG! , , &N1G* 3
NLG! ,6N-GG
NHG! ,3NUG)
3 .
% ( &
% ( &
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
"" 33..
% * ) 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
33'" )'" )
% 9 &
9
% > 9 & ,& &
% > 9
/
* +REAL
> - -.INTEGER
> - -.BIT_VECTOR
> -BIT
/)
#9
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0)" 0 "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;
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0)" 0 "$ " %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 10 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 "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 " $ " %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;
9
Copyright © 2005 by W. D. Bishop. All Rights Reserved
7 ," " 0 " $ " %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 "6 0 "
%
% +
% +
' ( &
% * / - 9 9
,
' 9 9
,
' & -
9
Copyright © 2005 by W. D. Bishop. All Rights Reserved
6 0 "6 0 "
% , &
& $
% .
0 &
% + -
0
CASE..WHEN..END CASEWITH..SELECT..WHEN
IF..ELSIF..ELSE..END IFWHEN..ELSE
'" 6! 6
9#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
6 0 " $ " %6 0 " $ " %
SIGNAL reset, clock, d, q :std_logic;
PROCESS (reset, clock)
-- reset and clock are in the sensitivity list to
-- indicate that they are important inputs to the process
BEGIN
-- IF keyword is only valid in a process
IF (reset = ’0’) THEN
q <= 0;
ELSIF (clock’EVENT AND clock = ’1’) THEN
q <= d;
END IF;
END PROCESS;
4! 2<
9
& 9
& "
EVENT
"
99
Copyright © 2005 by W. D. Bishop. All Rights Reserved
6 0 " $ " %6 0 " $ " %
SIGNAL a, b, c, d :std_logic;
PROCESS (a, b, d)
-- a, b, and d are in the sensitivity list to indicate that
-- the outputs of the process are sensitive to changes in them
BEGIN
-- CASE keyword is only valid in a process
CASE d IS
WHEN ‘0’ =>
c <= a AND b;
WHEN OTHERS =>
c <= ‘1’;
END CASE;
END PROCESS;
4! 2<
"
9
Copyright © 2005 by W. D. Bishop. All Rights Reserved
:: 33: 28: 28
% EVENT -
9
% EVENT ,
,
% , * 9* & &$
9(
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0 * " * :0 * " * : 33::
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY dffe IS
PORT( rst, clk, ena, d : IN std_logic;
q : OUT std_logic );
END dffe;
ARCHITECTURE synthesis1 OF dffe IS
BEGIN
PROCESS (rst, clk)
BEGIN
IF (rst = ‘1’) THEN
q <= ‘0’;
ELSIF (clk’EVENT) AND (clk = ‘1’) THEN
IF (ena = ‘1’) THEN
q <= d;
END IF;
END IF;
END PROCESS;
END synthesis1;
9+
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ 80 = " // 80 = " /
% / *( 1* (
2
% *( .(
% * - / *(
/ &
9-
Copyright © 2005 by W. D. Bishop. All Rights Reserved
:" 0 " 28:" 0 " 28
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY vending IS
PORT(
reset : IN std_logic;
clock : IN std_logic;
buttons : IN std_logic_vector(1 DOWNTO 0);
lights : OUT std_logic_vector(1 DOWNTO 0)
);
END vending;
'
" , "
!
, $ % "
!
, $ % "
2
, "
7 ""$ %
"$ %
9.
Copyright © 2005 by W. D. Bishop. All Rights Reserved
:" 0 " 28 $ " %:" 0 " 28 $ " %
ARCHITECTURE synthesis1 OF vending IS
TYPE statetype IS (Idle, Opt1, Opt2, Error);
SIGNAL currentstate, nextstate : statetype;
BEGIN
fsm1: PROCESS( buttons, currentstate )
BEGIN
CASE currentstate IS
WHEN Idle =>
lights <= “00”;
CASE buttons IS
WHEN “00” =>
nextstate <= Idle;
WHEN “01” =>
nextstate <= Opt1;
WHEN “10” =>
nextstate <= Opt2;
WHEN OTHERS =>
nextstate <= Error;
END CASE;
WHEN Opt1 =>
lights <= “01”;
IF buttons /= “01” THEN
nextstate <= Idle;
END IF;
Copyright © 2005 by W. D. Bishop. All Rights Reserved
:" 0 " 28 $ " %:" 0 " 28 $ " %
WHEN Opt2 =>
lights <= “10”;
IF buttons /= “10” THEN
nextstate <= Idle;
END IF;
WHEN Error =>
lights <= “11”;
IF buttons = “00” THEN
nextstate <= Idle;
END IF;
END CASE;
END PROCESS;
fsm2: PROCESS( reset, clock )
BEGIN
IF (reset = ‘0’) THEN
currentstate <= Idle;
ELSIF (clock’EVENT) AND (clock = ‘1’) THEN
currentstate <= nextstate;
END IF;
END PROCESS;
END synthesis1;
Copyright © 2005 by W. D. Bishop. All Rights Reserved
Department of Electrical and Computer Engineering
University of Waterloo
2828
7 " ) " ) & * " *
: * & " " ) ",
"3 " "
7 ) '> ? " )
& = " & " ",
"
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28/ " " 28
% & / )
% - 0 &
' )
!
#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28 7/ " " 28 7
% andnand
& $
% std_logic
9
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28 7/ " " 28 7 33 0 "0 "
% andnand
& $
ENTITY andnand IS
PORT ( a : IN std_logic;
b : IN std_logic;
q : OUT std_logic;
qbar : OUT std_logic );
END andnand;
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " / 28/ " " / 28
%
andnand
% < synthesis1
(
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28/ " " 28 33 0 "0 "
% andnand
& $
ARCHITECTURE synthesis1 OF andnand IS
BEGIN
q <= a AND b;
qbar<= a NAND b;
END synthesis1;
+
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28 7/ " " 28 7
% quadmux
# ;9 P & &$
C
3
C
C
<
<
<
"
std_logic_vector
std_logic
std_logic_vector
std_logic_vector
)6
-
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28 7/ " " 28 7 33 0 "0 "
% quadmux
& $
ENTITY quadmux IS
PORT ( a : IN std_logic_vector(3 DOWNTO 0);
b : IN std_logic_vector(3 DOWNTO 0);
sel : IN std_logic;
c : OUT std_logic_vector(3 DOWNTO 0) );
END quadmux;
.
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28/ " " 28
%
quadmux
% ? # ;9 P &
$
% < synthesis1
b[3..0]1
a[3..0]0
c[3..0]sel
(
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28/ " " 28 33 0 "0 "
% quadmux
& $
ARCHITECTURE synthesis1 OF quadmux IS
BEGIN
WITH sel SELECT
c <= a WHEN ‘0’,
b WHEN OTHERS;
END synthesis1;
(
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28 #/ " " 28 #
% ) (
(
% ( ( &
&$
(
Copyright © 2005 by W. D. Bishop. All Rights Reserved
/ " " 28 #/ " " 28 # 33 0 "0 "
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY seven_seg IS
PORT( dataIn : IN std_logic_vector(3 DOWNTO 0);
segments : OUT std_logic_vector(7 DOWNTO 0) );
END seven_seg;
ARCHITECTURE synthesis1 OF seven_seg IS
BEGIN
WITH dataIn SELECT
segments <= “10000001” WHEN “0000”, -- 0
“11001111” WHEN “0001”, -- 1
“10010010” WHEN “0010”, -- 2
“10000110” WHEN “0011”, -- 3
“11001100” WHEN “0100”, -- 4
“10100100” WHEN “0101”, -- 5
“10100000” WHEN “0110”, -- 6
“10001111” WHEN “0111”, -- 7
“10000000” WHEN “1000”, -- 8
“10000100” WHEN “1001”, -- 9
“11111111” WHEN OTHERS;
END synthesis1;
(#
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0 = " 280 = " 28
% ) 79
&
% , 79 & &$
(9
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0 = " 280 = " 28 33 0 "0 "
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY dregister IS
PORT( rst, clk, ena : IN std_logic;
d : IN std_logic_vector(7 DOWNTO 0);
q : OUT std_logic_vector(7 DOWNTO 0) );
END dregister;
ARCHITECTURE synthesis1 OF dregister IS
BEGIN
PROCESS (rst, clk)
BEGIN
IF (rst = ‘1’) THEN
q <= X”00”;
ELSIF (clk’EVENT) AND (clk = ‘1’) THEN
IF (ena = ‘1’) THEN
q <= d;
END IF;
END IF;
END PROCESS;
END synthesis1;
(
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0 = " 280 = " 28
% ) :;9
&
% , :;9 & &$
32-Bit Counter
value[31..0]reset
enable
clock
((
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0 = " 280 = " 28 33 0 "0 "
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY counter IS
PORT(
reset : IN std_logic;
clock : IN std_logic;
enable : IN std_logic;
value : OUT std_logic_vector(31 DOWNTO 0)
);
END counter;
(+
Copyright © 2005 by W. D. Bishop. All Rights Reserved
0 = " 280 = " 28 @@ 0 "$ " %0 "$ " %
ARCHITECTURE synthesis1 OF counter IS
-- The unsigned type is used
SIGNAL count : unsigned(31 DOWNTO 0); -- so that unsigned arithmetic
-- will be synthesized
BEGIN
PROCESS (reset, clock)
BEGIN
IF (reset = ‘1’) THEN
count <= X”00000000”;
ELSIF (clock’EVENT) AND (clock = ‘1’) THEN
IF (enable = ‘1’) THEN
count <= count + 1;
END IF;
END IF;
END PROCESS;
-- Here, the count value is
value <= std_logic_vector(count); -- converted to std_logic_vector
-- using a conversion function
END synthesis1;
(-
Copyright © 2005 by W. D. Bishop. All Rights Reserved
7 ;" , "7 ;" , "
%
:;C & $
! " , ? >"=
"!" ! ">
? (
% - / /
( 3C3- ;;:- C;5
& $
,. . & H

More Related Content

What's hot

Overview of digital design with Verilog HDL
Overview of digital design with Verilog HDLOverview of digital design with Verilog HDL
Overview of digital design with Verilog HDLanand hd
 
What are Flip Flops and Its types.
What are Flip Flops and Its types.What are Flip Flops and Its types.
What are Flip Flops and Its types.Satya P. Joshi
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoderUnsa Shakir
 
Verilog overview
Verilog overviewVerilog overview
Verilog overviewposdege
 
Computer Oragnization Flipflops
Computer Oragnization FlipflopsComputer Oragnization Flipflops
Computer Oragnization FlipflopsVanitha Chandru
 
Discrete cosine transform
Discrete cosine transformDiscrete cosine transform
Discrete cosine transformaniruddh Tyagi
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.Omkar Rane
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flopShuaib Hotak
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Dhaval Kaneria
 

What's hot (20)

Vhdl introduction
Vhdl introductionVhdl introduction
Vhdl introduction
 
Overview of digital design with Verilog HDL
Overview of digital design with Verilog HDLOverview of digital design with Verilog HDL
Overview of digital design with Verilog HDL
 
What are Flip Flops and Its types.
What are Flip Flops and Its types.What are Flip Flops and Its types.
What are Flip Flops and Its types.
 
Basics of Vhdl
Basics of VhdlBasics of Vhdl
Basics of Vhdl
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with Examples
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoder
 
CMOS Logic Circuits
CMOS Logic CircuitsCMOS Logic Circuits
CMOS Logic Circuits
 
Hdl
HdlHdl
Hdl
 
Verilog overview
Verilog overviewVerilog overview
Verilog overview
 
Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
 
Computer Oragnization Flipflops
Computer Oragnization FlipflopsComputer Oragnization Flipflops
Computer Oragnization Flipflops
 
Discrete cosine transform
Discrete cosine transformDiscrete cosine transform
Discrete cosine transform
 
Latches and flip flops
Latches and flip flopsLatches and flip flops
Latches and flip flops
 
Shift Registers
Shift RegistersShift Registers
Shift Registers
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flop
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
 
Adder
Adder Adder
Adder
 

Similar to Vhdl ppt

Steering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonSteering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonUIEpreviews
 
Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500Cisco Russia
 
OSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle ManagerOSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle ManagerSkills Matter
 
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеТанки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеYandex
 
Cooper Union - SociaLite - Open 2011
Cooper Union - SociaLite - Open 2011Cooper Union - SociaLite - Open 2011
Cooper Union - SociaLite - Open 2011the nciia
 
Ledtalks vsl lighting
Ledtalks vsl lightingLedtalks vsl lighting
Ledtalks vsl lightingRolandSyntens
 
[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programming[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programmingnpinto
 
BK City - TU Delft - Redesign Atrium with Space Frame + Barrel Vault
BK City - TU Delft - Redesign Atrium with  Space Frame + Barrel Vault BK City - TU Delft - Redesign Atrium with  Space Frame + Barrel Vault
BK City - TU Delft - Redesign Atrium with Space Frame + Barrel Vault Nicholas Socrates
 
110304 smart grid cleantech innovation
110304 smart grid cleantech innovation110304 smart grid cleantech innovation
110304 smart grid cleantech innovationHiroshi Yagi
 
Guide juridique web 2.0
Guide juridique web 2.0Guide juridique web 2.0
Guide juridique web 2.0MarketingZ
 
Guide juridique web2.0
Guide juridique web2.0Guide juridique web2.0
Guide juridique web2.0CEFRIO
 
GIS and Google Earth In Geography
GIS and Google Earth In GeographyGIS and Google Earth In Geography
GIS and Google Earth In GeographyOllie Bray
 
TRUenergy Gas Storage SPE Presentation
TRUenergy Gas Storage SPE PresentationTRUenergy Gas Storage SPE Presentation
TRUenergy Gas Storage SPE PresentationAlex Goiye
 
Tcs gmp parents_a3_posterv2 amends
Tcs gmp parents_a3_posterv2 amendsTcs gmp parents_a3_posterv2 amends
Tcs gmp parents_a3_posterv2 amendslorge007
 
EWD 3 Training Course Part 21: Persistent JavaScript Objects
EWD 3 Training Course Part 21: Persistent JavaScript ObjectsEWD 3 Training Course Part 21: Persistent JavaScript Objects
EWD 3 Training Course Part 21: Persistent JavaScript ObjectsRob Tweed
 

Similar to Vhdl ppt (20)

Steering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonSteering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff Patton
 
Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500Архитектура коммутаторов Cisco Catalyst 6500
Архитектура коммутаторов Cisco Catalyst 6500
 
OSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle ManagerOSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle Manager
 
OSGi - beyond the myth
OSGi -  beyond the mythOSGi -  beyond the myth
OSGi - beyond the myth
 
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеТанки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
 
Cooper Union - SociaLite - Open 2011
Cooper Union - SociaLite - Open 2011Cooper Union - SociaLite - Open 2011
Cooper Union - SociaLite - Open 2011
 
Ledtalks vsl lighting
Ledtalks vsl lightingLedtalks vsl lighting
Ledtalks vsl lighting
 
[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programming[Harvard CS264] 04 - Intermediate-level CUDA Programming
[Harvard CS264] 04 - Intermediate-level CUDA Programming
 
How oracle 12c flexes its muscles against oracle 11g r2
How oracle 12c flexes its muscles against oracle 11g r2How oracle 12c flexes its muscles against oracle 11g r2
How oracle 12c flexes its muscles against oracle 11g r2
 
BK City - TU Delft - Redesign Atrium with Space Frame + Barrel Vault
BK City - TU Delft - Redesign Atrium with  Space Frame + Barrel Vault BK City - TU Delft - Redesign Atrium with  Space Frame + Barrel Vault
BK City - TU Delft - Redesign Atrium with Space Frame + Barrel Vault
 
110304 smart grid cleantech innovation
110304 smart grid cleantech innovation110304 smart grid cleantech innovation
110304 smart grid cleantech innovation
 
All about Apache ACE
All about Apache ACEAll about Apache ACE
All about Apache ACE
 
Guide juridique web 2.0
Guide juridique web 2.0Guide juridique web 2.0
Guide juridique web 2.0
 
Guide juridique web2.0
Guide juridique web2.0Guide juridique web2.0
Guide juridique web2.0
 
GIS and Google Earth In Geography
GIS and Google Earth In GeographyGIS and Google Earth In Geography
GIS and Google Earth In Geography
 
TRUenergy Gas Storage SPE Presentation
TRUenergy Gas Storage SPE PresentationTRUenergy Gas Storage SPE Presentation
TRUenergy Gas Storage SPE Presentation
 
Tcs gmp parents_a3_posterv2 amends
Tcs gmp parents_a3_posterv2 amendsTcs gmp parents_a3_posterv2 amends
Tcs gmp parents_a3_posterv2 amends
 
EWD 3 Training Course Part 21: Persistent JavaScript Objects
EWD 3 Training Course Part 21: Persistent JavaScript ObjectsEWD 3 Training Course Part 21: Persistent JavaScript Objects
EWD 3 Training Course Part 21: Persistent JavaScript Objects
 
Nur sprechenden Unternehmen kann geholfen werden
Nur sprechenden Unternehmen kann geholfen werdenNur sprechenden Unternehmen kann geholfen werden
Nur sprechenden Unternehmen kann geholfen werden
 
Device deployment
Device deploymentDevice deployment
Device deployment
 

Recently uploaded

CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

Vhdl ppt

  • 1. Copyright © 2005 by W. D. Bishop. All Rights Reserved Department of Electrical and Computer Engineering University of Waterloo ! " # $
  • 2. Copyright © 2005 by W. D. Bishop. All Rights Reserved ! "! " % & ' ' ' ' ( ) % * ' + , ' -. - ' ( ' ' +
  • 3. # Copyright © 2005 by W. D. Bishop. All Rights Reserved ! " $ " %! " $ " % % / ' ' ( 0 '
  • 4. Copyright © 2005 by W. D. Bishop. All Rights Reserved Department of Electrical and Computer Engineering University of Waterloo !& &!& &
  • 5. Copyright © 2005 by W. D. Bishop. All Rights Reserved % % & % / '" "'" " V ery High Speed Integrated Circuit H ardware D escription L anguage
  • 6. ( 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& % & / )
  • 7. + Copyright © 2005 by W. D. Bishop. All Rights Reserved ' " " ,)' " " ,) % ' ' / & ' / & % & ' & ' < )
  • 8. - Copyright © 2005 by W. D. Bishop. All Rights Reserved ' " " ,)$ " %' " " ,)$ " % % ' & *+=. ' % ' .(
  • 9. . Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 0)"/ " " 0)" % + > & ) / & & $ ' ! " # ! $ ! ! % # % > & & $ ' ! &'$( " $ ) % #
  • 10. Copyright © 2005 by W. D. Bishop. All Rights Reserved 0 " 1 " *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
  • 11. Copyright © 2005 by W. D. Bishop. All Rights Reserved 28 " "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
  • 12. Copyright © 2005 by W. D. Bishop. All Rights Reserved 5 '2220 "5 '2220 " % '222 (93 ..# ' ( ( @39BB4:59;4496A % '222 #(93 .. ' ( > D & @39BB4:595;59BA
  • 13. # Copyright © 2005 by W. D. Bishop. All Rights Reserved 5 * "5 * " % & % * - & $ ' + - -: - = & -< & E ,-<E- 3447" ' + F". - G = -; - H + - "-( * - .-;66;" ' ( > & I , -* & -; - = &9 -< & E ,-<E- ;66C"
  • 14. Copyright © 2005 by W. D. Bishop. All Rights Reserved Department of Electrical and Computer Engineering University of Waterloo : " ": " "
  • 15. Copyright © 2005 by W. D. Bishop. All Rights Reserved 4 ",/ "& " "4 ",/ "& " " % * - & & $ ' . , & & ' . & & ' . # % - ' 1 2 & ' &
  • 16. ( Copyright © 2005 by W. D. Bishop. All Rights Reserved " 6 ; ," 6 ; , % , - - , & % + , % & / ieee std_logic_1164 , $ LIBRARY ieee; USE ieee.std_logic_1164.ALL;
  • 17. + Copyright © 2005 by W. D. Bishop. All Rights Reserved 2" 7 "2" 7 " / "*, "/ "*, " % - J 9 & % . / % . - - Entity Architecture 1 Architecture 2 Architecture n… Configuration 1 Configuration n Configuration2
  • 18. - Copyright © 2005 by W. D. Bishop. All Rights Reserved 2"2" % . G / % & $ 3" ;". 9 :". & % =
  • 19. . Copyright © 2005 by W. D. Bishop. All Rights Reserved 2" ) "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;
  • 20. Copyright © 2005 by W. D. Bishop. All Rights Reserved 28 2" ) "28 2" ) " % & / .< $ 4! 2< + ? - 9 " ENTITY andgate IS PORT ( a : IN std_logic; b : IN std_logic; c : OUT std_logic ); END andgate;
  • 21. Copyright © 2005 by W. D. Bishop. All Rights Reserved 66 % + $ ' - - K ' .& & ' % + $ IN OUT INOUT > BUFFER > 4! 2< . L M "
  • 22. Copyright © 2005 by W. D. Bishop. All Rights Reserved 6 $ " %6 $ " % % 338C9344: , & ' / ) std_logic_1164 , ' & ) $ std_logic std_logic_vector(<max> DOWNTO <min>)
  • 23. # Copyright © 2005 by W. D. Bishop. All Rights Reserved 77 % . G % % * / - & & ) & $ ' + ' . ' + & ' (
  • 24. 9 Copyright © 2005 by W. D. Bishop. All Rights Reserved 7 "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;
  • 25. Copyright © 2005 by W. D. Bishop. All Rights Reserved 28 7 "28 7 " % & / .< $ ARCHITECTURE synthesis1 OF andgate IS BEGIN c <= a AND b; END synthesis1; 4! 2< , & AND .< "
  • 26. ( Copyright © 2005 by W. D. Bishop. All Rights Reserved / "*, "/ "*, " % . & % > - / % % &
  • 27. + Copyright © 2005 by W. D. Bishop. All Rights Reserved 0,"0," % ( & % ( % ( & % ( % 9 $ ' / '
  • 28. - Copyright © 2005 by W. D. Bishop. All Rights Reserved 0," 5 " "0," 5 " " N0G* 6N1G* 3 " ) % > & % + & % . &
  • 29. . Copyright © 2005 by W. D. Bishop. All Rights Reserved 33 , 5 " ", 5 " " % 1 9 2 9 , & % & 9 ieee.std_logic_1164$ ' 9 C ' 9 4
  • 30. # Copyright © 2005 by W. D. Bishop. All Rights Reserved 33 99 % 9 C ; 1NXG NZG2 $ % ! & % 9C NZGN0G* 6 NXG* , &N1G* 3 3 9
  • 31. # Copyright © 2005 by W. D. Bishop. All Rights Reserved 33 .. % 9 4 B $ NXG* , & NZGN0G* 6 NWG! , , &N1G* 3 NLG! ,6N-GG NHG! ,3NUG) 3 . % ( & % ( &
  • 32. # Copyright © 2005 by W. D. Bishop. All Rights Reserved "" 33.. % * ) 94$ std_ulogic std_ulogic_vector( <max> DOWNTO <min>) ? std_logic std_logic_vector( <max> DOWNTO <min> ) % ? &
  • 33. ## Copyright © 2005 by W. D. Bishop. All Rights Reserved 33'" )'" ) % 9 & 9 % > 9 & ,& & % > 9 / * +REAL > - -.INTEGER > - -.BIT_VECTOR > -BIT /)
  • 34. #9 Copyright © 2005 by W. D. Bishop. All Rights Reserved 0)" 0 "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;
  • 35. # Copyright © 2005 by W. D. Bishop. All Rights Reserved 0)" 0 "$ " %0)" 0 "$ " % % 36 ' 9& O E ( ' O + ? .+( ' O < % ) % ( ) , & % ) 4:
  • 36. #( Copyright © 2005 by W. D. Bishop. All Rights Reserved % & $ % / & , !, ! P< ?P ? < ?? <<.<.<
  • 37. #+ Copyright © 2005 by W. D. Bishop. All Rights Reserved ! !! ! % & $ Q 10 2 KQ 1< 0 2 R 1 2 S 1= 2 % & $ T 1. 2 9 1( 2 U 1 2 K 1 2
  • 38. #- Copyright © 2005 by W. D. Bishop. All Rights Reserved 7 ," " 0 "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
  • 39. #. Copyright © 2005 by W. D. Bishop. All Rights Reserved 7 ," " 0 " $ " %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;
  • 40. 9 Copyright © 2005 by W. D. Bishop. All Rights Reserved 7 ," " 0 " $ " %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;
  • 41. 9 Copyright © 2005 by W. D. Bishop. All Rights Reserved 6 0 "6 0 " % % + % + ' ( & % * / - 9 9 , ' 9 9 , ' & -
  • 42. 9 Copyright © 2005 by W. D. Bishop. All Rights Reserved 6 0 "6 0 " % , & & $ % . 0 & % + - 0 CASE..WHEN..END CASEWITH..SELECT..WHEN IF..ELSIF..ELSE..END IFWHEN..ELSE '" 6! 6
  • 43. 9# Copyright © 2005 by W. D. Bishop. All Rights Reserved 6 0 " $ " %6 0 " $ " % SIGNAL reset, clock, d, q :std_logic; PROCESS (reset, clock) -- reset and clock are in the sensitivity list to -- indicate that they are important inputs to the process BEGIN -- IF keyword is only valid in a process IF (reset = ’0’) THEN q <= 0; ELSIF (clock’EVENT AND clock = ’1’) THEN q <= d; END IF; END PROCESS; 4! 2< 9 & 9 & " EVENT "
  • 44. 99 Copyright © 2005 by W. D. Bishop. All Rights Reserved 6 0 " $ " %6 0 " $ " % SIGNAL a, b, c, d :std_logic; PROCESS (a, b, d) -- a, b, and d are in the sensitivity list to indicate that -- the outputs of the process are sensitive to changes in them BEGIN -- CASE keyword is only valid in a process CASE d IS WHEN ‘0’ => c <= a AND b; WHEN OTHERS => c <= ‘1’; END CASE; END PROCESS; 4! 2< "
  • 45. 9 Copyright © 2005 by W. D. Bishop. All Rights Reserved :: 33: 28: 28 % EVENT - 9 % EVENT , , % , * 9* & &$
  • 46. 9( Copyright © 2005 by W. D. Bishop. All Rights Reserved 0 * " * :0 * " * : 33:: LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY dffe IS PORT( rst, clk, ena, d : IN std_logic; q : OUT std_logic ); END dffe; ARCHITECTURE synthesis1 OF dffe IS BEGIN PROCESS (rst, clk) BEGIN IF (rst = ‘1’) THEN q <= ‘0’; ELSIF (clk’EVENT) AND (clk = ‘1’) THEN IF (ena = ‘1’) THEN q <= d; END IF; END IF; END PROCESS; END synthesis1;
  • 47. 9+ Copyright © 2005 by W. D. Bishop. All Rights Reserved / 80 = " // 80 = " / % / *( 1* ( 2 % *( .( % * - / *( / &
  • 48. 9- Copyright © 2005 by W. D. Bishop. All Rights Reserved :" 0 " 28:" 0 " 28 LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY vending IS PORT( reset : IN std_logic; clock : IN std_logic; buttons : IN std_logic_vector(1 DOWNTO 0); lights : OUT std_logic_vector(1 DOWNTO 0) ); END vending; ' " , " ! , $ % " ! , $ % " 2 , " 7 ""$ % "$ %
  • 49. 9. Copyright © 2005 by W. D. Bishop. All Rights Reserved :" 0 " 28 $ " %:" 0 " 28 $ " % ARCHITECTURE synthesis1 OF vending IS TYPE statetype IS (Idle, Opt1, Opt2, Error); SIGNAL currentstate, nextstate : statetype; BEGIN fsm1: PROCESS( buttons, currentstate ) BEGIN CASE currentstate IS WHEN Idle => lights <= “00”; CASE buttons IS WHEN “00” => nextstate <= Idle; WHEN “01” => nextstate <= Opt1; WHEN “10” => nextstate <= Opt2; WHEN OTHERS => nextstate <= Error; END CASE; WHEN Opt1 => lights <= “01”; IF buttons /= “01” THEN nextstate <= Idle; END IF;
  • 50. Copyright © 2005 by W. D. Bishop. All Rights Reserved :" 0 " 28 $ " %:" 0 " 28 $ " % WHEN Opt2 => lights <= “10”; IF buttons /= “10” THEN nextstate <= Idle; END IF; WHEN Error => lights <= “11”; IF buttons = “00” THEN nextstate <= Idle; END IF; END CASE; END PROCESS; fsm2: PROCESS( reset, clock ) BEGIN IF (reset = ‘0’) THEN currentstate <= Idle; ELSIF (clock’EVENT) AND (clock = ‘1’) THEN currentstate <= nextstate; END IF; END PROCESS; END synthesis1;
  • 51. Copyright © 2005 by W. D. Bishop. All Rights Reserved Department of Electrical and Computer Engineering University of Waterloo 2828 7 " ) " ) & * " * : * & " " ) ", "3 " " 7 ) '> ? " ) & = " & " ", "
  • 52. Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28/ " " 28 % & / ) % - 0 & ' ) !
  • 53. # Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28 7/ " " 28 7 % andnand & $ % std_logic
  • 54. 9 Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28 7/ " " 28 7 33 0 "0 " % andnand & $ ENTITY andnand IS PORT ( a : IN std_logic; b : IN std_logic; q : OUT std_logic; qbar : OUT std_logic ); END andnand;
  • 55. Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " / 28/ " " / 28 % andnand % < synthesis1
  • 56. ( Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28/ " " 28 33 0 "0 " % andnand & $ ARCHITECTURE synthesis1 OF andnand IS BEGIN q <= a AND b; qbar<= a NAND b; END synthesis1;
  • 57. + Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28 7/ " " 28 7 % quadmux # ;9 P & &$ C 3 C C < < < " std_logic_vector std_logic std_logic_vector std_logic_vector )6
  • 58. - Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28 7/ " " 28 7 33 0 "0 " % quadmux & $ ENTITY quadmux IS PORT ( a : IN std_logic_vector(3 DOWNTO 0); b : IN std_logic_vector(3 DOWNTO 0); sel : IN std_logic; c : OUT std_logic_vector(3 DOWNTO 0) ); END quadmux;
  • 59. . Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28/ " " 28 % quadmux % ? # ;9 P & $ % < synthesis1 b[3..0]1 a[3..0]0 c[3..0]sel
  • 60. ( Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28/ " " 28 33 0 "0 " % quadmux & $ ARCHITECTURE synthesis1 OF quadmux IS BEGIN WITH sel SELECT c <= a WHEN ‘0’, b WHEN OTHERS; END synthesis1;
  • 61. ( Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28 #/ " " 28 # % ) ( ( % ( ( & &$
  • 62. ( Copyright © 2005 by W. D. Bishop. All Rights Reserved / " " 28 #/ " " 28 # 33 0 "0 " LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY seven_seg IS PORT( dataIn : IN std_logic_vector(3 DOWNTO 0); segments : OUT std_logic_vector(7 DOWNTO 0) ); END seven_seg; ARCHITECTURE synthesis1 OF seven_seg IS BEGIN WITH dataIn SELECT segments <= “10000001” WHEN “0000”, -- 0 “11001111” WHEN “0001”, -- 1 “10010010” WHEN “0010”, -- 2 “10000110” WHEN “0011”, -- 3 “11001100” WHEN “0100”, -- 4 “10100100” WHEN “0101”, -- 5 “10100000” WHEN “0110”, -- 6 “10001111” WHEN “0111”, -- 7 “10000000” WHEN “1000”, -- 8 “10000100” WHEN “1001”, -- 9 “11111111” WHEN OTHERS; END synthesis1;
  • 63. (# Copyright © 2005 by W. D. Bishop. All Rights Reserved 0 = " 280 = " 28 % ) 79 & % , 79 & &$
  • 64. (9 Copyright © 2005 by W. D. Bishop. All Rights Reserved 0 = " 280 = " 28 33 0 "0 " LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY dregister IS PORT( rst, clk, ena : IN std_logic; d : IN std_logic_vector(7 DOWNTO 0); q : OUT std_logic_vector(7 DOWNTO 0) ); END dregister; ARCHITECTURE synthesis1 OF dregister IS BEGIN PROCESS (rst, clk) BEGIN IF (rst = ‘1’) THEN q <= X”00”; ELSIF (clk’EVENT) AND (clk = ‘1’) THEN IF (ena = ‘1’) THEN q <= d; END IF; END IF; END PROCESS; END synthesis1;
  • 65. ( Copyright © 2005 by W. D. Bishop. All Rights Reserved 0 = " 280 = " 28 % ) :;9 & % , :;9 & &$ 32-Bit Counter value[31..0]reset enable clock
  • 66. (( Copyright © 2005 by W. D. Bishop. All Rights Reserved 0 = " 280 = " 28 33 0 "0 " LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY counter IS PORT( reset : IN std_logic; clock : IN std_logic; enable : IN std_logic; value : OUT std_logic_vector(31 DOWNTO 0) ); END counter;
  • 67. (+ Copyright © 2005 by W. D. Bishop. All Rights Reserved 0 = " 280 = " 28 @@ 0 "$ " %0 "$ " % ARCHITECTURE synthesis1 OF counter IS -- The unsigned type is used SIGNAL count : unsigned(31 DOWNTO 0); -- so that unsigned arithmetic -- will be synthesized BEGIN PROCESS (reset, clock) BEGIN IF (reset = ‘1’) THEN count <= X”00000000”; ELSIF (clock’EVENT) AND (clock = ‘1’) THEN IF (enable = ‘1’) THEN count <= count + 1; END IF; END IF; END PROCESS; -- Here, the count value is value <= std_logic_vector(count); -- converted to std_logic_vector -- using a conversion function END synthesis1;
  • 68. (- Copyright © 2005 by W. D. Bishop. All Rights Reserved 7 ;" , "7 ;" , " % :;C & $ ! " , ? >"= "!" ! "> ? ( % - / / ( 3C3- ;;:- C;5 & $ ,. . & H