19
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Embed Size (px)

Citation preview

Page 1: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

CEC 220 Digital Circuit DesignIntroduction to VHDL

Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Page 2: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Lecture Outline

Wed, February 25 CEC 220 Digital Circuit Design

• Introduction to VHDL VHDL - (VHSIC) Hardware Description Language

o VHSIC - Very High Speed Integrated Circuit

Slide 2 of 19

Page 3: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDL

Wed, February 25 CEC 220 Digital Circuit Design

• Large digital systems are unwieldy to design manually E.g., design a h.264 video transcoder

• Hardware Description Languages (HDL) allow for design automation Design Simulation Synthesis Verification

RTL: Register Transfer Level

ESL: Electronic Sys Level

Slide 3 of 19

Page 4: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDL

Wed, February 25 CEC 220 Digital Circuit Design

• History of VHDL In December 1987, VHDL became IEEE Standard 1076-198 In September 1993, VHDL was restandardized to clarify and

enhance the language (IEEE Standard 1076-1993) In February 2008 VHDL 2008 (i.e., VHDL 4.0) was approved

and IEEE 1076-2008 was published in January 2009.

• VHDL is an international standard specification language for describing digital hardware used by industry worldwide

• VHDL enables hardware modelling from gates to system-level

Slide 4 of 19

Page 5: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDL

Wed, February 25 CEC 220 Digital Circuit Design

• VHDL can describe a digital system at The Behavioral level, The Structural level, or The Data-Flow level.

• Example of a full adder: Behavioral level:

o A functional description:C <= A + B;

» A, B, and C may be integers and ‘+’ an arithmetic operator– No implementation details– A high-level description

Slide 5 of 19

Page 6: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDL

Wed, February 25 CEC 220 Digital Circuit Design

Structural level:o Schematic with gates:

Data-Flow level :o Logic equations:

– Sum <= A xor … ;– Cout <= (A and B) or … ;

• VHDL leads naturally to a top-down design methodology

Slide 6 of 19

Page 7: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• Basic example:

E <= D or (A and B);

Signal_Name <= Expression;

Behavioral Description

Slide 7 of 19

Page 8: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• Basic example

Assignment operator

Concurrent statements

Evaluated anytime variables changes

If a delay time is not specified then the default is used

Dataflow Description

Slide 8 of 19

Page 9: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• A Second Example:

CLK <= not CLK after 10 ns;

A concurrent statement

nsec

Slide 9 of 19

Page 10: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• Consequences of a concurrent statement

Slide 10 of 19

Page 11: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• VHDL Syntax: Signal names and other VHDL identifiers may contain

letters, numbers, and the underscore character (_). An identifier must start with a letter, and it cannot end with

an underscore. VHDL is mostly case insensitive. Thus, C123 and ab_23 are legal identifiers, but 1ABC and

ABC_ are not. Every VHDL statement must be terminated with a

semicolon. White space is ignored. In VHDL double dash (--) precedes a comment. Words such as and, or, and after are reserved words with

special meanings.

Slide 11 of 19

Page 12: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• VHDL Operators: Binary Logical Operators: and, or, nand, nor, xor, xnor Relational Operators: =, /=, <, <=, >, >= Shift Operators: sll, srl, sla, sra, rol, ror Arithmetic Operators: +, -, &, *, /, mod, rem

concatenation

Slide 12 of 19

Page 13: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLPrecedence of VHDL Operators

Wed, February 25 CEC 220 Digital Circuit Design

• Highest precedence first, then left to right within same precedence group, Use parenthesis to control order. Unary operators take an operand on the right.

Slide 13 of 19

Page 14: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLPrecedence of VHDL Operators

Wed, February 25 CEC 220 Digital Circuit Design Slide 14 of 19

Page 15: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• Vector Operations

Vector Notation:

Slide 15 of 19

Page 16: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• VHDL Models for Multiplexers

sel <= A & B; -- select signalwith sel select F <= I0 when “00”, I1 when “01”, I2 when “10”, I3 when “11”;

F <= I0 when (A = ‘0’) else I1;

Conditional assignment Selective assignmentSlide 16 of 19

Page 17: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• Examples: Implement the following VHDL conditional statement using

two 2:1 MUXs: o F <= A when D=‘1’ else (B when E = ‘1’ else C);

Given that A <= “01101” and B <= “11100”, what is the value of:o F<= (not B & ‘1’ or A & ‘1’) and ‘1’ & A;

(000111 or 011011) and 101101 (011111) and 101101

001101Slide 17 of 19

Page 18: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Introduction to VHDLVHDL Description of Combinational Logic Circuits

Wed, February 25 CEC 220 Digital Circuit Design

• Examples: Draw the circuit represented by the

following VHDL statements: o F <= not A and not B and I0;

G <=not A and B and I1;

Write the VHDL statements for 2-input NAND gates with 4-ns delays to implement a function

F <= X nand Y after 4 ns;

X <= A nand B after 4 ns;Y <= C nand D after 4 ns;

0

A

B

I

F

1

A

B

I

G

Slide 18 of 19

Page 19: CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19

Next Lecture

Wed, February 25 CEC 220 Digital Circuit Design

• More VHDL Entity, architecture, modules, arrays, …

Slide 19 of 19