Mridula Allani Fall 2010 (Refer to the comments if required) ELEC2200-001 Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)

Slides:



Advertisements
Similar presentations
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Advertisements

1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
History TTL-logic PAL (Programmable Array Logic)
Modeling & Simulating ASIC Designs with VHDL Reference: Smith text: Chapters 10 & 12.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Introduction to VHDL (part 2)
1 H ardware D escription L anguages Basic Language Concepts.
Modeling styles: 1. Structural Modeling: As a set of interconnected components (to represent structure), 2. Dataflow Modeling: As a set of concurrent assignment.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
INTRO TO VLSI DESIGN (CPE 448) (VHDL Tutorial ) Prof: Asuif Mahmood.
1 H ardware D escription L anguages Modeling Complex Systems.
VHDL – Dataflow and Structural Modeling and Testbenches ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
Fall 09, Aug 19 ELEC / Lecture 2 (from Prof. Nelson's and Prof. Stroud's course material) 1 ELEC / Computer Architecture.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
CPEN Digital System Design
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
Basic Overview of VHDL Matthew Murach Slides Available at:
L12 – VHDL Overview. VHDL Overview  HDL history and background  HDL CAD systems  HDL view of design  Low level HDL examples  Ref: text Unit 10, 17,
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
HARDWARE DESCRIPTION LANGUAGE (HDL). What is HDL? A type of programming language for sampling and modeling of electronic & logic circuit designs It can.
1 component OR_3 port (A,B,C: in bit; Z: out bit); end component ; Reserved Words  Declarations of Components and Entities are similar  Components are.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
M. Balakrishnan Dept of Computer Science & Engg. I.I.T. Delhi
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
Digital System Projects
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
ECOM 4311—Digital System Design with VHDL
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
Data Flow and Behavioral Modeling in VHDL 1 MS EMBEDDED SYSTEMS.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
An Introduction to V.H.D.L.. Need of a Compiler… main( ) { int x=10,y=20,z; z = x + y ; printf ( “ %d “, z ); getch( ) ; } What’s That ? Give me only.
Combinational logic circuit
Basic Language Concepts
Systems Architecture Lab: Introduction to VHDL
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
Design Entry: Schematic Capture and VHDL
Dataflow Style Combinational Design with VHDL
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
ENG6530 Reconfigurable Computing Systems
VHDL VHSIC Hardware Description Language VHSIC
ELEC 5200/6200 Computer Architecture and Design Review of VHDL
VHDL Hardware Description Language
Modeling Complex Behavior
CprE / ComS 583 Reconfigurable Computing
4-Input Gates VHDL for Loops
VHDL - Introduction.
Presentation transcript:

Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)

 Model and document digital systems  Hierarchical models  System, RTL (Register Transfer Level), gates  Different levels of abstraction  Behavior, structure  Verify circuit/system design via simulation  Synthesize circuits from HDL models ELEC Fall 2010, Nov 22 (Adopted from Profs. Nelson and Stroud)

 VHDL = VHSIC Hardware Description Language (VHSIC = Very High Speed Integrated Circuits)  Developed by DOD from 1983 – based on ADA  IEEE Standard /1993/200x  Based on the ADA language  Verilog – created in 1984 by Philip Moorby of Gateway Design Automation (merged with Cadence)  IEEE Standard /2001/2005  Based on the C language  IEEE P1800 “System Verilog” in voting stage & will be merged with 1364 ELEC Fall 2010, Nov 23 (Adopted from Profs. Nelson and Stroud)

 “Entity” describes the external view of a design/component  “Architecture” describes the internal behavior/structure of the component  Example: 1-bit full adder ELEC Fall 2010, Nov 24 A B Cin Sum Cout Full Adder (Adopted from Profs. Nelson and Stroud)

 External view comprises input/output signals (“ports”)  A “port” is defined by its signal name, direction and type: port_name: direction data_type;  direction:  in - driven into the entity from an external source  out - driven from within the entity  inout - bidirectional – drivers within the entity and external  data_type: any scalar or aggregate signal type ELEC Fall 2010, Nov 25 (Adopted from Profs. Nelson and Stroud)

 Type std_logic data values: ‘U’, ‘X’ – uninitialized/unknown ‘0’, ‘1’ – strongly-driven 0/1 ‘L’, ‘H’ – weakly-driven 0/1 (resistive) ‘Z’, ‘W’ - strong/weak “floating” ‘-’ - don’t care  Type std_logic_vector is array of std_logic  Include package: library IEEE; use IEEE.std_logic_1164.all; ELEC Fall 2010, Nov 26 (Adopted from Profs. Nelson and Stroud)

ENTITY entity_name IS GENERIC (optional) (generic_name: type :=default_value; … generic_name: mode signal_type); PORT (signal_name: mode signal_type; … signal_name: mode signal_type); END ENTITY entity_name; ELEC Fall 2010, Nov 27 (Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 2(Adopted from Profs. Nelson and Stroud)8 a b XOR AND XOR AND OR c_in sum c_out FA h_s (a, b) c_o (a, b) h_s (h_s(a, b), c_in) c_o (h_s(a, b), c_in) HA

ENTITY Full_adder IS PORT ( -- I/O ports a: IN STD_LOGIC; -- a input b: IN STD_LOGIC; -- b input cin: IN STD_LOGIC; -- carry input sum: OUT STD_LOGIC; -- sum output cout: OUT STD_LOGIC); -- carry output END Full_adder ; ELEC Fall 2010, Nov 29 A B Cin Sum Cout Full Adder (Adopted from Profs. Nelson and Stroud)

ARCHITECTURE architecture_name OF entity_name IS -- data type definitions (ie, states, arrays, etc.) -- internal signal declarations -- component declarations -- function and procedure declarations BEGIN -- behavior of the model is described here using: -- component instantiations -- concurrent statements -- processes END ARCHITECTURE architecture_name; ELEC Fall 2010, Nov 210 (Adopted from Profs. Nelson and Stroud)

ARCHITECTURE dataflow OF Full_adder IS BEGIN sum <= a xor b xor cin; cout <= (a and b) or (a and cin) or (b and cin); END dataflow; ELEC Fall 2010, Nov 211 (Adopted from Profs. Nelson and Stroud)

ARCHITECTURE structure OF Full_adder IS COMPONENT xor IS-- declare component to be used PORT (x,y: IN STD_LOGIC; z: OUT STD_LOGIC); END COMPONENT xor; COMPONENT or IS-- declare component to be used PORT (x,y: IN STD_LOGIC; z: OUT STD_LOGIC); END COMPONENT or; COMPONENT and IS-- declare component to be used PORT (x,y,z: IN STD_LOGIC; p: OUT STD_LOGIC); END COMPONENT xor; SIGNAL x1,x2,x3,x4: STD_LOGIC;-- signal internal to this component BEGIN G1: xor PORT MAP (a, b, x1);-- instantiate 1 st xor gate G2: xor PORT MAP (x1, Cin, Sum); -- instantiate 2 nd xor gate G3: or PORT MAP (a, b, x2);-- instantiate 1 st or gate G4: or PORT MAP (a, Cin, x3); -- instantiate 2 nd or gate G5: or PORT MAP (b, Cin, x4);-- instantiate 3 rd or gate G6: and PORT MAP (x2, x3, x4, Cout); -- instantiate and gate END structure; ELEC Fall 2010, Nov 212 (Adopted from Profs. Nelson and Stroud) Full-adder

ARCHITECTURE structural OF Full_adder IS COMPONENT half_adder PORT(a,b : IN STD_LOGIC; sum, carry : OUT STD_LOGIC); END COMPONENT; COMPONENT or_2 PORT(a,b : IN STD_LOGIC; c : OUT STD_LOGIC); END COMPONENT; SIGNAL int1, int2, int3 : STD_LOGIC; BEGIN H1: half_adder port map(a=>A, b=>B, sum=>int1, carry=>int3); H2: half_adder port map(a=>s1, b=>C_in, sum=>sum, carry=>s2); O1: or_2 port map(a=> int2, b=>int3, c=>C_out); END structural; 13 ENTITY half_adder IS PORT (a,b : IN STD_LOGIC ; sum,carry : OUT STD_LOGIC); END half_adder; ARCHITECTURE dataflow OF half_adder IS BEGIN sum<= a xor b; carry <= a and b; END dataflow; ENTITY or_2 IS PORT (a,b : IN STD_LOGIC ; c : OUT STD_LOGIC); END or_2; ARCHITECTURE dataflow OF or_2 IS BEGIN c<= a or b; END dataflow; ELEC Fall 2010, Nov 2 Each Half-adder Full-adder (Adopted from Profs. Nelson and Stroud)

library ieee; use ieee.std_logic_1164. all ; ENTITY adder_4bit IS PORT (a, b: IN STD_LOGIC_VECTOR(3 DOWNTO 0); Cin : IN STD_LOGIC; sum: OUT STD_LOGIC_VECTOR (3 DOWNTO 0); Cout: OUT STD_LOGIC); END adder_4bit; ARCHITECTURE structural OF adder_4bit IS SIGNAL c: STD_LOGIC_VECTOR (4 DOWNTO 0); COMPONENT Full_adder PORT (a, b, c: IN STD_LOGIC; sum, carry: OUT STD_LOGIC); END COMPONENT; ELEC Fall 2010, Nov 214 BEGIN FA0: Full_adder PORT MAP (a(0), b(0), Cin, sum(0), c(1)); FA1: Full_adder PORT MAP (a(1), b(1), C(1), sum(1), c(2)); FA2: Full_adder PORT MAP (a(2), b(2), C(2), sum(2), c(3)); FA3: Full_adder PORT MAP (a(3), b(3), C(3), sum(3), c(4)); Cout <= c(4); END structural; (Adopted from Profs. Nelson and Stroud)

ARCHITECTURE behavioral OF Full_adder IS BEGIN Sum: PROCESS(a, b, cin) BEGIN sum <= a xor b xor cin; END PROCESS Sum; Carry: PROCESS(a, b, cin) BEGIN cout <= (a and b) or (a and cin) or (b and cin); END PROCESS Carry; END behavioral; ELEC Fall 2010, Nov 215 ARCHITECTURE behavioral OF Full_adder IS BEGIN PROCESS(a, b, cin) BEGIN sum <= a xor b xor cin; cout <= (a and b) or (a and cin) or (b and cin); END PROCESS; END behavioral; (Adopted from Profs. Nelson and Stroud)

 Allows conventional programming language methods to describe circuit behavior  Supported language constructs (“sequential statements”) – only allowed within a process:  variable assignment  if-then-else (elsif)  case statement  while (condition) loop  for (range) loop ELEC Fall 2010, Nov 216 (Adopted from Profs. Nelson and Stroud)

[label:] process ( sensitivity list ) declarations begin sequential statements end process;  Process statements executed once at start of simulation  Process halts at “end” until an event occurs on a signal in the “sensitivity list” ELEC Fall 2010, Nov 217 (Adopted from Profs. Nelson and Stroud)

ENTITY dff IS PORT (d,clk: IN STD_LOGIC; q: OUT STD_LOGIC); END dff; ARCHITECTURE behavioral OF dff IS BEGIN PROCESS(clk) -- “process sensitivity list” BEGIN IF (clk’event and clk=‘1’) THEN q <= d AFTER 1 ns; END IF; END PROCESS; END behavioral;  Process statements executed sequentially (sequential statements)  clk’event is an attribute of signal clk which is TRUE if an event has occurred on clk at the current simulation time ELEC Fall 2010, Nov 218 D Q CLK (Adopted from Profs. Nelson and Stroud)

ENTITY dff IS PORT (d,clk: IN STD_LOGIC; q: OUT STD_LOGIC); END dff; ARCHITECTURE behavioral OF dff IS BEGIN PROCESS -- no “sensitivity list” BEGIN WAIT ON clk; -- suspend process until event on clk IF (clk=‘1’) THEN q <= d AFTER 1 ns; END IF; END PROCESS; END behavioral;  Other “wait” formats: WAIT UNTIL (clk’event and clk=‘1’) WAIT FOR 20 ns;  Process executes endlessly if no sensitivity list or wait statement! ELEC Fall 2010, Nov 219 D Q CLK (Adopted from Profs. Nelson and Stroud)

 if-then-elsif-else statement if condition then (... sequence of statements...) elsif condition then (... sequence of statements...) else (... sequence of statements...) end if;  case statement case expression is when choices => sequence of statements when choices => sequence of statements... when others => sequence of statements end case; ELEC Fall 2010, Nov 220 (Adopted from Profs. Nelson and Stroud)

 while loop [ label:] while condition loop... sequence of statements... end loop [label] ;  for loop [ label: ] for loop_variable in range loop... sequence of statements... end loop [label] ; ELEC Fall 2010, Nov 221 (Adopted from Profs. Nelson and Stroud)

ARCHITECTURE functional OF Full_adder IS BEGIN PROCESS(A,B,Cin) BEGIN If (Cin = '0' and A = '0' and B = '0' ) then sum<= '0'; Cout <= '0'; elsif(Cin = '0' and A = '0' and B = '1') then sum <= '1' ; Cout <= '0'; elsif(Cin = '0' and A = '1' and B = '0' ) then sum <= '1' ; Cout <= '0'; elsif(Cin = '0' and A = '1' and B = '1' ) then sum<= '0'; Cout <= '1'; elsif(Cin = '1' and A = '0' and B = '0' ) then sum <= '1' ; Cout <= '0'; elsif(Cin = '1' and A = '0' and B = '1' ) then sum<= '0'; Cout <= '1'; elsif(Cin = '1' and A = '1' and B = '0' ) then sum<= '0'; Cout <= '1'; elsif(Cin = '1' and A = '1' and B = '1' ) then sum <= '1' ; Cout <= '1'; else sum <= 'X' ; Cout <= 'X'; end if; END PROCESS; END functional; ELEC Fall 2010, Nov 222(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 223 ENTITY counter_4bit IS PORT(Ld, Clr, Clk: IN STD_LOGIC; D: IN STD_LOGIC_VECTOR (3 DOWNTO 0); Cout: OUT STD_LOGIC; Qout: OUT STD_LOGIC_VECTOR (3 DOWNTO 0)); END counter_4bit; ARCHITECTURE behavioral OF counter_4bit IS SIGNAL Q: STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN Qout <= Q; Cout <= Q(3) and Q(2) and Q(1) and Q(0); PROCESS(Clk) BEGIN IF Clk'event and Clk = '1' THEN IF Clr = '0' THEN Q <= "0000"; ELSIF Ld = '0' THEN Q <= D; ELSE Q <= Q + 1; END IF; END PROCESS; END behavioral; (Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 224  VHDL mini-reference on Prof. Nelson’s website   VHDL resources on Prof. Stroud’s website   VHDL resources on Prof. Agrawal’s website         htm htm  (Adopted from Profs. Nelson and Stroud)

 Modelsim PE (Student Edition) can be downloaded from student-edition-hdl- simulation?quicktabs_4=1#quicktabs-4  Modelsim is installed on the Windows7 platform in Lab 310, Broun Hall. ELEC Fall 2010, Nov 225(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 226(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 227(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 228(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 229(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 230(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 231(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 232(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 233(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 234(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 235(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 236(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 237(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 238(Adopted from Profs. Nelson and Stroud)

ELEC Fall 2010, Nov 239(Adopted from Profs. Nelson and Stroud)