SlideShare a Scribd company logo
1 of 19
Apr. 3, 2000 Systems Architecture I 1
Introduction to VHDL
(CS 570)
Jeremy R. Johnson
Wed. Nov. 8, 2000
Apr. 3, 2000 Systems Architecture I 2
Introduction
• Objective: To provide an introduction of digital design and
simulation. To introduce the hardware description language
VHDL and the VHDL simulator and design tool Active-HDL.
• Behavioral models
• Structural models
• Discrete event simulation
– signals
– events
– waveforms
– concurrency
Apr. 3, 2000 Systems Architecture I 3
VHDL
• VHSIC Hardware Description Language
– Very High Speed Integrated Circuit
• IEEE standard
– IEEE 1076-1987
– IEEE 1076-1993
• A language for describing digital designs with several
levels of abstraction
– behavioral (describe what the design does)
– structural (describe how the design is implemented)
• Tools exist for verifying designs and synthesizing hardware
layout from designs specified in VHDL
Apr. 3, 2000 Systems Architecture I 4
VHDL Simulation
• Since a VHDL program is a description of a design it, by
itself, does not compute anything
• To verify a design, it must be simulated on a set of inputs
• Computation is “event driven”
– when inputs change (an event) the corresponding outputs are
computed using rules specified in the design
– The state of the design may also change (sequential logic - e.g.
memory, registers, or any state variables)
– changes propagate throughout the system
– there may be delays
– operations may occur concurrently
Apr. 3, 2000 Systems Architecture I 5
VHDL constucts
• Entity
• Port
• Architecture
– implementation of an entity
– support for both behavioral and structural models
• Signal
– std_ulogic (from IEEE 1164 library)
– input/output signals
– internal signals inside an architecture
– assignment
– delays
• Vectors of signals (bus)
Apr. 3, 2000 Systems Architecture I 6
Half Adder
entity half_adder is
port(a,b : in std_ulogic;
sum,carry : out std_ulogic);
end half_adder;
a
b
sum
carry
Apr. 3, 2000 Systems Architecture I 7
MUX
entity mux is
port(I0, I1, I2, I3 : in std_ulogic;
Sel : in std_ulogic_vector (1 downto 0);
Z : out std_ulogic);
end mux;
I0
I1
I2
I3
Z
Sel
Apr. 3, 2000 Systems Architecture I 8
32-Bit ALU
entity ALU32 is
port(a,b : in std_ulogic_vector (31 downto 0);
Op : in std_ulogic_vector (2 downto 0);
result : in std_ulogic_vector (31 downto 0);
zero : out std_ulogic;
CarryOut : out std_ulogic;
overflow : out std_ulogic);
end ALU32;
a
b
CarryOut
Overflow
Result
Zero
Op
Apr. 3, 2000 Systems Architecture I 9
Half Adder Behavioral Implementation
library IEEE;
use IEEE.std_logic_1164.all;
entity half_adder is
port(a,b : in std_ulogic;
sum,carry : out std_ulogic);
end half_adder;
architecture concurrent_behavior of half_adder is
begin
sum <= (a xor b) after 5 ns;
carry <= (a and b) after 5 ns;
end concurrent_behavior;
Apr. 3, 2000 Systems Architecture I 10
Half Adder Structural Implementation
library IEEE;
use IEEE.std_logic_1164.all;
entity half_adder is
port(a,b : in std_ulogic;
sum,carry : out std_ulogic);
end half_adder;
architecture structural of half_adder is
component and_2
port(x,y : in std_logic;
c : out std_logic);
end component
Apr. 3, 2000 Systems Architecture I 11
Half Adder Implementation (cont)
component xor_2
port(x,y : in std_logic;
c : out std_logic);
end component;
begin
X1 : xor_2 port map(x => a, y => b, c =>sum);
A1 : and_2 port map(x => a, y => b, c => carry);
end structural;
Apr. 3, 2000 Systems Architecture I 12
Simulation Model
• Signal changes are called events
• Whenever an input signal changes the output is
recomputed
– changes are propogated
– there may be a delay
• Updates occur concurrently
• The history of changes on a signal produces a waveform
(value vs. time)
– shows delays and dependencies
Apr. 3, 2000 Systems Architecture I 13
Boolean Functions
• A boolean variable has two
possible values (true/false)
(1/0).
• A boolean function has a
number of boolean input
variables and has a
boolean valued output.
• A boolean function can be
described using a truth
table
• There are 22n
boolean
function of n variables.
s x0 x1 f
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
f
x0
x1
s
Multiplexor function
Apr. 3, 2000 Systems Architecture I 14
Boolean Expressions
• A boolean expression is a boolean function.
• Any boolean function can be written as a boolean expression
– Disjunctive normal form (sums of products)
– For each row in the truth table where the output is
true, write a product such that the corresponding
input is the only input combination that is true
– Not unique
• E.G. (multiplexor function)
s  x0  x1 + s  x0  x1 + s  x0  x1 + s  x0  x1
s x0 x1 f
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
Apr. 3, 2000 Systems Architecture I 15
Simplification of Boolean Expressions
• Simplifying multiplexor expression using Boolean algebra
s  x0  x1 + s  x0  x1 + s  x0  x1 + s  x0  x1
= s  x0  x1 + s  x0  x1 + s  x1  x0 + s  x1  x0 (commutative law)
= s  x0  (x1 + x1) + s  x1  (x0 + x0) (distributive law)
= s  x0  1 + s  x1  1 (inverse law)
= s  x0 + s  x1 (identity law)
• Verify that the boolean function corresponding to this
expression as the same truth table as the original function.
Apr. 3, 2000 Systems Architecture I 16
Logic Circuits
• A single line labeled x is a logic circuit. One end is the input
and the other is the output. If A and B are logic circuits so
are:
• and gate
• or gate
• inverter (not)
A
B
A
A
B
Apr. 3, 2000 Systems Architecture I 17
Logic Circuits
• Given a boolean expression it is easy to write down the
corresponding logic circuit
• Here is the circuit for the original multiplexor expression
x0
x1
s
Apr. 3, 2000 Systems Architecture I 18
Logic Circuits
• Here is the circuit for the simplified multiplexor expression
x0
x1
s
Apr. 3, 2000 Systems Architecture I 19
Multiplexer
• A multiplexor is a switch which routes n inputs to one output.
The input is selected using a decoder.
d0
d1
d2
d3
s0
s1

More Related Content

Similar to vhdl.ppt Verilog Hardware Description Language

Sequential and combinational alu
Sequential and combinational alu Sequential and combinational alu
Sequential and combinational alu
Piyush Rochwani
 
Digital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA ImplementationDigital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA Implementation
Amber Bhaumik
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
kusuma11
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
kusuma11
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
kusuma11
 

Similar to vhdl.ppt Verilog Hardware Description Language (20)

Lec 2 digital basics
Lec 2 digital basicsLec 2 digital basics
Lec 2 digital basics
 
Sequential and combinational alu
Sequential and combinational alu Sequential and combinational alu
Sequential and combinational alu
 
Amit vish
Amit vishAmit vish
Amit vish
 
Digital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA ImplementationDigital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA Implementation
 
integrated circutits -324567654-12-345-.pptx
integrated circutits -324567654-12-345-.pptxintegrated circutits -324567654-12-345-.pptx
integrated circutits -324567654-12-345-.pptx
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
 
341-12-4-2001.ppt
341-12-4-2001.ppt341-12-4-2001.ppt
341-12-4-2001.ppt
 
Unit 2 module-2
Unit 2 module-2Unit 2 module-2
Unit 2 module-2
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdf
 
Digital Basics
Digital BasicsDigital Basics
Digital Basics
 
Video lectures for bba
Video lectures for bbaVideo lectures for bba
Video lectures for bba
 
Chapter1
Chapter1Chapter1
Chapter1
 
Binary parallel adder, decimal adder
Binary parallel adder, decimal adderBinary parallel adder, decimal adder
Binary parallel adder, decimal adder
 
ALU arithmetic logic unit
ALU  arithmetic logic unitALU  arithmetic logic unit
ALU arithmetic logic unit
 
Lata digital electronics
Lata digital electronicsLata digital electronics
Lata digital electronics
 
Chapter1.ppt
Chapter1.pptChapter1.ppt
Chapter1.ppt
 
computer logic and digital design chapter 1
computer logic and digital design chapter 1computer logic and digital design chapter 1
computer logic and digital design chapter 1
 
Lect 1 unit 2.pdf
Lect 1 unit 2.pdfLect 1 unit 2.pdf
Lect 1 unit 2.pdf
 

Recently uploaded

electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
benjamincojr
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
rahulmanepalli02
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
MaherOthman7
 

Recently uploaded (20)

handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
 
History of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationHistory of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & Modernization
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdf
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Students
 

vhdl.ppt Verilog Hardware Description Language

  • 1. Apr. 3, 2000 Systems Architecture I 1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000
  • 2. Apr. 3, 2000 Systems Architecture I 2 Introduction • Objective: To provide an introduction of digital design and simulation. To introduce the hardware description language VHDL and the VHDL simulator and design tool Active-HDL. • Behavioral models • Structural models • Discrete event simulation – signals – events – waveforms – concurrency
  • 3. Apr. 3, 2000 Systems Architecture I 3 VHDL • VHSIC Hardware Description Language – Very High Speed Integrated Circuit • IEEE standard – IEEE 1076-1987 – IEEE 1076-1993 • A language for describing digital designs with several levels of abstraction – behavioral (describe what the design does) – structural (describe how the design is implemented) • Tools exist for verifying designs and synthesizing hardware layout from designs specified in VHDL
  • 4. Apr. 3, 2000 Systems Architecture I 4 VHDL Simulation • Since a VHDL program is a description of a design it, by itself, does not compute anything • To verify a design, it must be simulated on a set of inputs • Computation is “event driven” – when inputs change (an event) the corresponding outputs are computed using rules specified in the design – The state of the design may also change (sequential logic - e.g. memory, registers, or any state variables) – changes propagate throughout the system – there may be delays – operations may occur concurrently
  • 5. Apr. 3, 2000 Systems Architecture I 5 VHDL constucts • Entity • Port • Architecture – implementation of an entity – support for both behavioral and structural models • Signal – std_ulogic (from IEEE 1164 library) – input/output signals – internal signals inside an architecture – assignment – delays • Vectors of signals (bus)
  • 6. Apr. 3, 2000 Systems Architecture I 6 Half Adder entity half_adder is port(a,b : in std_ulogic; sum,carry : out std_ulogic); end half_adder; a b sum carry
  • 7. Apr. 3, 2000 Systems Architecture I 7 MUX entity mux is port(I0, I1, I2, I3 : in std_ulogic; Sel : in std_ulogic_vector (1 downto 0); Z : out std_ulogic); end mux; I0 I1 I2 I3 Z Sel
  • 8. Apr. 3, 2000 Systems Architecture I 8 32-Bit ALU entity ALU32 is port(a,b : in std_ulogic_vector (31 downto 0); Op : in std_ulogic_vector (2 downto 0); result : in std_ulogic_vector (31 downto 0); zero : out std_ulogic; CarryOut : out std_ulogic; overflow : out std_ulogic); end ALU32; a b CarryOut Overflow Result Zero Op
  • 9. Apr. 3, 2000 Systems Architecture I 9 Half Adder Behavioral Implementation library IEEE; use IEEE.std_logic_1164.all; entity half_adder is port(a,b : in std_ulogic; sum,carry : out std_ulogic); end half_adder; architecture concurrent_behavior of half_adder is begin sum <= (a xor b) after 5 ns; carry <= (a and b) after 5 ns; end concurrent_behavior;
  • 10. Apr. 3, 2000 Systems Architecture I 10 Half Adder Structural Implementation library IEEE; use IEEE.std_logic_1164.all; entity half_adder is port(a,b : in std_ulogic; sum,carry : out std_ulogic); end half_adder; architecture structural of half_adder is component and_2 port(x,y : in std_logic; c : out std_logic); end component
  • 11. Apr. 3, 2000 Systems Architecture I 11 Half Adder Implementation (cont) component xor_2 port(x,y : in std_logic; c : out std_logic); end component; begin X1 : xor_2 port map(x => a, y => b, c =>sum); A1 : and_2 port map(x => a, y => b, c => carry); end structural;
  • 12. Apr. 3, 2000 Systems Architecture I 12 Simulation Model • Signal changes are called events • Whenever an input signal changes the output is recomputed – changes are propogated – there may be a delay • Updates occur concurrently • The history of changes on a signal produces a waveform (value vs. time) – shows delays and dependencies
  • 13. Apr. 3, 2000 Systems Architecture I 13 Boolean Functions • A boolean variable has two possible values (true/false) (1/0). • A boolean function has a number of boolean input variables and has a boolean valued output. • A boolean function can be described using a truth table • There are 22n boolean function of n variables. s x0 x1 f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 f x0 x1 s Multiplexor function
  • 14. Apr. 3, 2000 Systems Architecture I 14 Boolean Expressions • A boolean expression is a boolean function. • Any boolean function can be written as a boolean expression – Disjunctive normal form (sums of products) – For each row in the truth table where the output is true, write a product such that the corresponding input is the only input combination that is true – Not unique • E.G. (multiplexor function) s  x0  x1 + s  x0  x1 + s  x0  x1 + s  x0  x1 s x0 x1 f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1
  • 15. Apr. 3, 2000 Systems Architecture I 15 Simplification of Boolean Expressions • Simplifying multiplexor expression using Boolean algebra s  x0  x1 + s  x0  x1 + s  x0  x1 + s  x0  x1 = s  x0  x1 + s  x0  x1 + s  x1  x0 + s  x1  x0 (commutative law) = s  x0  (x1 + x1) + s  x1  (x0 + x0) (distributive law) = s  x0  1 + s  x1  1 (inverse law) = s  x0 + s  x1 (identity law) • Verify that the boolean function corresponding to this expression as the same truth table as the original function.
  • 16. Apr. 3, 2000 Systems Architecture I 16 Logic Circuits • A single line labeled x is a logic circuit. One end is the input and the other is the output. If A and B are logic circuits so are: • and gate • or gate • inverter (not) A B A A B
  • 17. Apr. 3, 2000 Systems Architecture I 17 Logic Circuits • Given a boolean expression it is easy to write down the corresponding logic circuit • Here is the circuit for the original multiplexor expression x0 x1 s
  • 18. Apr. 3, 2000 Systems Architecture I 18 Logic Circuits • Here is the circuit for the simplified multiplexor expression x0 x1 s
  • 19. Apr. 3, 2000 Systems Architecture I 19 Multiplexer • A multiplexor is a switch which routes n inputs to one output. The input is selected using a decoder. d0 d1 d2 d3 s0 s1

Editor's Notes

  1. 1
  2. 2
  3. 13
  4. 14
  5. 15
  6. 16
  7. 17
  8. 18
  9. 19