UNIT 6: Mixed-Type Description

Slides:



Advertisements
Similar presentations
HDL Programming Fundamentals
Advertisements

UNIT 8: Synthesis Basics
1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
Verilog Intro: Part 1.
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.
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
Binary-to-BCD Converter
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
1 H ardware D escription L anguages Basic Language Concepts.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Binary-to-BCD Converter
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
VHDL Basics. VHDL BASICS 2 OUTLINE –Component model –Code model –Entity –Architecture –Identifiers and objects –Operations for relations VHDL ET062G &
EE3A1 Computer Hardware and Digital Design Lecture 2 Introduction to VHDL.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
16/11/2006DSD,USIT,GGSIPU1 Packages The primary purpose of a package is to encapsulate elements that can be shared (globally) among two or more design.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
CS/EE 3700 : Fundamentals of Digital System Design
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
5-1 Logic System Design I VHDL Design Principles ECGR2181 Reading: Chapter 5.0, 5.1, 5.3 port ( I: in STD_LOGIC_VECTOR (1 to 9); EVEN, ODD: out STD_LOGIC.
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Unit 4 Structural Descriptions SYLLABUS Highlights of Structural descriptions Organization of the Structural descriptions Binding State Machines Generate(HDL),Generic(VHDL),
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Unit 7 Mixed Language Descriptions SYLLABUS Highlights of Mixed-Language Description, How to invoke One language from the Other Mixed-language Description.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Combinational logic circuit
Basic Language Concepts
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
Describing Combinational Logic Using Processes
Behavioral Style Combinational Design with VHDL
UNIT 8: Synthesis Basics
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Dataflow Style Combinational Design with VHDL
Part IV: VHDL CODING.
HDL Programming Fundamentals
Behavioral Style Combinational Design with VHDL
Combinational Circuits Using VHDL
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
UNIT 3: Behavioral Descriptions
UNIT 2: Data Flow description
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)
VHDL Discussion Subprograms
VHDL Structural Architecture
Concurrent vs Sequential
Sequntial-Circuit Building Blocks
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL Discussion Subprograms
Data Flow Description of Combinational-Circuit Building Blocks
Data Flow Description of Combinational-Circuit Building Blocks
An overview of the Verilog HDL.
EEE2243 Digital System Design Chapter 1: Verilog HDL (Combinational) by Muhazam Mustapha, February 2012.
4-Input Gates VHDL for Loops
(Sequential-Circuit Building Blocks)
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

UNIT 6: Mixed-Type Description Writing with several styles (data flow, behavioral, structural,..) in the same module 7.1 Why Mixed-Type Description? Each type (style) has its own advantages. The system can be divided into segments, each segment is described using the most suitable style HDL Programming Fundamentals

HDL Programming Fundamentals 7.2 VHDL User-Defined Type type week_days is (mon, tues, wed, th, fr, sat, sun); type states is (S0, S1, S2, S3); type grades is (A, B, C, D, F, I); If we write signal scores : grades; Then scores can take A, B, C, D, F, or I HDL Programming Fundamentals

HDL Programming Fundamentals 7.3 VHDL Packages Packages may include type and subtype declarations, constant definitions, function and procedure, and component declarations. Listing 7.2 An Example of a VHDL package library ieee; use ieee.std_logic_1164.all; package codes is type op is (add,mul, divide, none); end; use work. codes; entity ALUS2 is port (a, b: in std_logic_vector(3 downto 0); cin: in std_logic; opc :in op; z: out std_logic_vector(7 downto 0); cout: buffer std_logic); end ALUS2; HDL Programming Fundamentals

7.3.1 Implementation of Arrays 7.3.1.1 Single-Dimensional Arrays a) VHDL type datavector is array (3 downto 0) of wordarray; subtype wordarray is std_logic_vector (1 downto 0); b) Verilog reg [1:0] datavector[0:3]; This declares an array by the name of datavector; it has 4 elements; each element is 2 bits. An example of this array is: datavector[0] = 2'b01; datavector[1] = 2'b10; datavector[2] = 2'b10; datavector[3] = 2'b11; HDL Programming Fundamentals

HDL Programming Fundamentals Example 7.1 Find the greatest among N elements of an Arrays a) VHDL Description library IEEE; use IEEE.STD_LOGIC_1164.all; --Build a package for an array package array_pkg is constant N: integer := 4; --N+1 is the number of elements in the array. constant M: integer := 3; --M+1 is the number of bits of each element --of the array. subtype wordN is std_logic_vector (M downto 0); type strng is array (N downto 0) of wordN; end array_pkg; use IEEE.STD_LOGIC_1164.ALL; use work.array_pkg.all; -- The above statement makes the package array_pkg visible in --this module -- A program to find the greatest value among elements of an array entity array1 is generic (N:integer :=4; M: integer := 3); --N+1 is the number of elements in the array; M=1 is the --number of bits of each element. Port ( a : inout strng; z : out std_logic_vector (M downto 0)); end array1; HDL Programming Fundamentals

HDL Programming Fundamentals architecture max of array1 is begin com: process (a) variable grtst: word4; --enter the data of the array. a <= ("0110", "0111", "0010", "0011", "0001"); grtst := "0000"; lop1: for i in 0 to N loop if (grtst <= a(i)) then grtst := a(i); report " grtst is less or equal than a"; -- use the above report statement if you want to monitor the --progress of the program else report "grtst is greater than a"; -- Use the above report statement to monitor the end if; end loop lop1; z <= grtst; end process com; end max; HDL Programming Fundamentals

HDL Programming Fundamentals b) Verilog Description module array1( start ,grtst ); parameter N = 4; parameter M = 3; input start; output [3:0] grtst; reg [M:0] a[0:N]; /*The above statement is declaring an array of N+1 elements; each element is M bits. */ reg [3:0] grtst; integer i; always @ (start) begin a [0] = 4'b0110; a[1] = 4'b0111; a[2] = 4'b0010; a[3] = 4'b0011; a[4] = 4'b0001; grtst = 4'b0000; HDL Programming Fundamentals

HDL Programming Fundamentals for (i = 0; i <= N; i= i +1) begin if (grtst <= a[i]) grtst = a[i]; $display ( " grtst is less or equal than a"); // use the above statement to monitor the program end else $display ( " grtst is greater than a"); endmodule HDL Programming Fundamentals

HDL Programming Fundamentals Example 7.2 Multiplication of two signed N-Element Vectors Using Arrays Listing 7.4 7.3.1.2 Two-Dimensional Arrays VHDL allows for multidimensional arrays. Standard Verilog allows only for single dimensional array. In VHDL, two dimensional arrays are described by the use of type statements. For example, the statements: subtype wordg is integer ; type singl is array (2 downto 0) of wordg; type doubl is array (1 downto 0) of single describe a two dimensional array; each single dimensional array has 3 elements; each element is an integer. An example of such two dimensional array is the array y y = ((10 5 6), (3 -2 7)) The elements of the array y are: y(0)(0) = 7 refers to element 0 of array 0 y(1)(1) = 5 refers to element 1 of array 1 y(2)(0) = 3 refers to element 2 of array 0 y(2)(1) = 10 refers to element 2 of array 0 HDL Programming Fundamentals

HDL Programming Fundamentals Example 7.3 Two-Dimensional Array HDL Programming Fundamentals

HDL Programming Fundamentals Example 7.4 Matrix Addition + Listing 7.6 HDL Programming Fundamentals

HDL Programming Fundamentals 7.4 Mixed-Type Description Examples Example 7.5 HDL Description of an Arithmetic-Logic Unit (ALU) HDL Programming Fundamentals

Operation Code (opc) Operation 00 Addition 01 Multiplication Table7.1 Operation Code (opc) Operation 00 Addition 01 Multiplication 10 Integer Division 11 No Operation HDL Programming Fundamentals

HDL Programming Fundamentals Example 7.6 HDL Description of a 16x8 Static RAM. Listing 7.8 HDL Programming Fundamentals

HDL Programming Fundamentals Table 7.2 Function Table of Static RAM. CS R_ Data_out Memory function 0 x Z (high impedance) The memory is deselected. 1 1 M (ABUS) This is a read; M refers to memory locations. contents of memory location pointed by ABUS is placed on the output data. 1 0 This is a write cycle; data in the Data_in are stored in M(ABUS) HDL Programming Fundamentals

HDL Programming Fundamentals Example 7.7 Description of a Finite Sequential State Machine Listing 7.9 HDL Programming Fundamentals

HDL Programming Fundamentals Case Study 7.1 HDL Description of a Basic Computer Listing 7.10 HDL Programming Fundamentals

HDL Programming Fundamentals

HDL Programming Fundamentals

HDL Programming Fundamentals

HDL Programming Fundamentals

HDL Programming Fundamentals

HDL Programming Fundamentals Summary Mixed-Type Description has been covered Packages are an essential construct in VHDL code. It may include: User-defined types, Components, Functions, and Procedures. VHDL, in contrast to Verilog, allows for multidimensional arrays. HDL Programming Fundamentals