CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.

Slides:



Advertisements
Similar presentations
LECTURE 4: The VHDL N-bit Adder
Advertisements

Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
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.
ECE 331 – Digital System Design
AND Gate: A Logic circuit whose output is logic ‘1’ if and only if all of its inputs are logic ‘1’.
Data Flow Modeling of Combinational Logic Simple Testbenches
Digital Arithmetic and Arithmetic Circuits
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
DSD,USIT,GGSIPU1 Entity declaration –describes the input/output ports of a module entity reg4 is port ( d0, d1, d2, d3, en, clk : in std_logic; q0, q1,
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
1 Combinational Logic Lecture #6. 모바일컴퓨터특강 2 강의순서 Decoder 3x8 Mux 4x1 Mux 8x1 Mux 8x1 4bits Half Adder Full Adder Ripple carry Adder 4-bit Adder.
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.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
L26 – Datapath ALU implementation
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
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:
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.
ENG2410 Digital Design LAB #5 Modular Design and Hierarchy using VHDL.
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 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
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.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
CEC 220 Digital Circuit Design More VHDL Fri, February 27 CEC 220 Digital Circuit Design Slide 1 of 15.
George Mason University Data Flow Modeling in VHDL ECE 545 Lecture 7.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 3: The VHDL N-bit Adder Instructor: Francis G. Wolff Case Western Reserve.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
CS/EE 3700 : Fundamentals of Digital System Design
Data Flow Modeling in VHDL
ECOM 4311—Digital System Design with VHDL
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
George Mason University Data Flow Modeling of Combinational Logic ECE 545 Lecture 5.
Explain Half Adder and Full Adder with Truth Table.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
LAB #5 Modular Design and Hierarchy using VHDL
Combinational logic circuit
Basic Language Concepts
ECE 3130 Digital Electronics and Design
Systems Architecture Lab: Introduction to VHDL
Describing Combinational Logic Using Processes
Dataflow Style Combinational Design with VHDL
ENG6530 Reconfigurable Computing Systems
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Hardware Descriptive Languages these notes are taken from Mano’s book
ECE 331 – Digital System Design
HDL Programming Fundamentals
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Modeling of Combinational Logic
VHDL (VHSIC Hardware Description Language)
Hardware Descriptive Languages these notes are taken from Mano’s book
VHDL Structural Architecture
Concurrent vs Sequential
Chapter 5 – Number Representation and Arithmetic Circuits
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 331 – Digital System Design
XOR Function Logic Symbol  Description  Truth Table 
CprE / ComS 583 Reconfigurable Computing
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
Digital Logic with VHDL
Presentation transcript:

CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural

2 VHDL Concepts Entity and Architecture – similar to symbol and schematic views of a logic circuit: symbol schematic

3 VHDL Example Entity declaration for the 2 to 1 MUX from today’s quiz. ENTITY mux2_1 IS PORT (in0, in1, sel: IN STD_LOGIC; yout: OUT STD_LOGIC); END mux2_1;

4 VHDL Example Logic circuit for a 2-1 MUX device Helpful for understanding architecture In0 In1 sel yout

5 VHDL Example Behavioral architecture for the 2 to 1 MUX ARCHITECTURE a1 OF mux2_1 IS P1: PROCESS (sel, in0, in1) BEGIN IF (sel = ‘0’) THEN yout <= in0; ELSE yout <= in1; END IF; END P1; END a1; In0 In1 sel yout

6 VHDL Example Structural architecture for the 2 to 1 MUX ARCHITECTURE a2 OF mux2_1 IS SIGNAL sel_not, in0_and, in1_and: STD_LOGIC; COMPONENT OR_GATE PORT(x,y: IN STD_LOGIC; z: OUT STD_LOGIC); COMPONENT AND_GATE PORT (x,y: IN STD_LOGIC; z: OUT STD_LOGIC); COMPONENT INV_GATE PORT (x: IN STD_LOGIC; z: OUT STD_LOGIC); BEGIN U1: AND_GATE PORT MAP (in0, sel_not, in0_and); U2: AND_GATE PORT MAP (in1, sel, in1_and); U3: INV_GATE PORT MAP (sel, sel_not); U4: OR_GATE PORT MAP (in0_and, in1_and, yout); END a2; U1 U3 U4 U2 In0 In1 sel yout

7 VHDL Example Dataflow architecture for the 2 to 1 MUX ARCHITECTURE a3 OF mux2_1 IS BEGIN yout <= ((in0 AND NOT(sel)) OR (in1 AND sel)); END a3; In0 In1 sel yout

8 Configuration for 2 to 1 MUX bbbb CONFIGURATION mux_behav OF mux2_1 IS FOR a1; END FOR; END mux_behav;

9 Half Adder Circuit Looking at the truth table for a half adder, it is easy to visualize the circuit B A S C A B C S

10 Full Adder Circuit The circuit at right shows a full adder constructed from two half adders. XOR generates the sum output AND generates the carry output half adder

11 Full Adder – Entity & Architecture -- Dataflow model for a full adder circuit -- Library Statement declares the standard ieee synthesis library LIBRARY ieee; USE ieee.std_logic_1164.ALL; -- Entity declares the inputs and outputs using a PORT statement ENTITY fulladder IS PORT(Ain, Bin, Cin: IN STD_LOGIC; Cout, Sout: OUT STD_LOGIC); END fulladder; -- Architecture defines the function or entity -- In this case the function is defined using Boolean equations ARCHITECTURE dataflow OF fulladder IS BEGIN -- Concurrent Signal Assignment Statements Sout <= Ain XOR Bin XOR Cin; Cout <= (Ain AND Bin) OR (Ain AND Cin) OR (Bin AND Cin); END dataflow;

12 Full Adder - Architecture -- In this case the function is defined by a circuit structure ARCHITECTURE structural OF fulladder IS COMPONENT AND2 PORT( A, B: IN STD_LOGIC; F: OUT STD_LOGIC); END COMPONENT; COMPONENT OR3 PORT( A, B, C: IN STD_LOGIC; F: OUT STD_LOGIC); END COMPONENT; COMPONENT XOR2 PORT( A, B: IN STD_LOGIC; F: OUT STD_LOGIC); END COMPONENT; SIGNAL AXB, AB, BC, AC: STD_LOGIC; BEGIN F1: XOR2 port map (Ain, Bin, AXB); F2: XOR2 port map (AXB, Cin, Sout); F3: AND2 port map (Ain, Bin, AB); --Port Map Statements F4: AND2 port map (Bin, Cin, BC); F5: AND2 port map (Ain, Cin, AC); F6: OR3 port map (AB, BC, AC, Cout); END structural;

13 Binary Addition: 4-Bit Numbers The following example illustrates the addition of two 4-bit numbers A(A 3 A 2 A 1 A 0 ) and B(B 3 B 2 B 1 B 0 ): How would this change for a BCD adder?

14 Binary Addition: 4-Bit Numbers The addition can be split-up in bit slices Each slice performs the addition of the bits A i, B i and the Carry-in bit C i C i <= carry-out bit of the previous slice Each slice is simply a full adder

15 4-Bit Binary Adder Circuit for a 4-bit parallel binary adder constructed from full adder building blocks

16 4-Bit Adder - Entity LIBRARY ieee; USE ieee.std_logic_1164.ALL; -- VHDL model of a 4-bit adder constructed from four full adders ENTITY four_bit_adder_st IS PORT (A, B : IN STD_LOGIC_VECTOR(3 downto 0); SUM : OUT STD_LOGIC_VECTOR(3 downto 0); CIN : IN STD_LOGIC; COUT : OUT STD_LOGIC); END four_bit_adder_st; C in C out

17 4-Bit Adder Structural -- The architecture in this case is a structural one ARCHITECTURE structural OF four_bit_adder_st IS -- First all the components are declared. The full adder is -- declared only once, even though it will be used 4 times. COMPONENT fulladder PORT(Ain, Bin, Cin: IN STD_LOGIC; Cout, Sout: OUT STD_LOGIC); END COMPONENT; -- The full adders are connected by carry signals. These must -- be declared also. SIGNAL C : STD_LOGIC_VECTOR(1 to 3); -- Port map statements are used to define full adder instances -- and how they are connected. BEGIN F1: fulladder port map (A(0),B(0),CIN,C(1),SUM(0)); F2: fulladder port map (A(1),B(1),C(1),C(2),SUM(1)); F3: fulladder port map (A(2),B(2),C(2),C(3),SUM(2)); F4: fulladder port map (A(3),B(3),C(3),COUT,SUM(3)); END structural;

18 4-Bit Adder Structural -- The architecture in this case is a dataflow one ARCHITECTURE dataflow OF four_bit_add_df IS -- Again there will be internal carry signals that are not -- inputs or outputs. These must be declared as signals. SIGNAL C : STD_LOGIC_VECTOR(1 to 3); -- Concurrent signal assignments can be used to describe -- each of the 4 outputs and the carry signals. BEGIN SUM(0) <= A(0) XOR B(0) XOR Cin; C(1) <= (A(0) AND B(0)) OR (A(0) AND Cin) OR (B(0) AND Cin); SUM(1) <= A(1) XOR B(1) XOR C(1); C(2) <= (A(1) AND B(1)) OR (A(1) AND C(1)) OR (B(1) AND C(1)); SUM(2) <= A(2) XOR B(2) XOR C(2); C(3) <= (A(2) AND B(2)) OR (A(2) AND C(2)) OR (B(2) AND C(2)); SUM(3) <= A(3) XOR B(3) XOR C(3); COUT <= (A(3) AND B(3)) OR (A(3) AND C(3)) OR (B(3) AND C(3)); END dataflow;

19 4-Bit Adder Behavioral -- This is the current Lab assignment Work with Anil to get this done!