VHDL Basics. Component model Code model Entity Architecture Identifiers and objects Operations for relations. Bengt Oelmann -- copyright

Relevanta dokument
GRUNDER I VHDL. Innehåll. Komponentmodell Kodmodell Entity Architecture Identifierare och objekt Operationer för jämförelse

Styrteknik: Binära tal, talsystem och koder D3:1

VHDL testbänk. Mall-programmets funktion. Låset öppnas när tangenten 1 trycks ned och sedan släpps. William Sandqvist

Support Manual HoistLocatel Electronic Locks

Michael Q. Jones & Matt B. Pedersen University of Nevada Las Vegas

Styrteknik : Funktioner och funktionsblock

VHDL2. Sekvensnätsexemplet

VHDL och laborationer i digitalteknik

VHDL2. Sekvensnätsexemplet

PARALLELL OCH SEKVENTIELL DATABEHANDLING. Innehåll

LUNDS TEKNISKA HÖGSKOLA Institutionen för Elektro- och Informationsteknik

Digitalteknik, fortsättningskurs Föreläsning VHDL Very High Speed Integrated Circuit Hardware Description Language

Calculate check digits according to the modulus-11 method

Beijer Electronics AB 2000, MA00336A,

Introduktion C-programmering

1. Compute the following matrix: (2 p) 2. Compute the determinant of the following matrix: (2 p)

Repetition C-programmering

Exempel på ett litet Ada-program

denna del en poäng. 1. (Dugga 1.1) och v = (a) Beräkna u (2u 2u v) om u = . (1p) och som är parallell

Tentamen Grundläggande programmering

Angående buffer. clk clear >=1 =9?

1. Varje bevissteg ska motiveras formellt (informella bevis ger 0 poang)

Preschool Kindergarten

Pre-Test 1: M0030M - Linear Algebra.

Föreläsning 4 IS1300 Inbyggda system

Programmerbara kretsar och VHDL 2. Föreläsning 10 Digitalteknik, TSEA22 Oscar Gustafsson Institutionen för systemteknik

Module 1: Functions, Limits, Continuity

Viktig information för transmittrar med option /A1 Gold-Plated Diaphragm

2.1 Installation of driver using Internet Installation of driver from disk... 3

Konstruktion av digitala system - VHDL

DESIGN AV SEKVENTIELL LOGIK

F ξ (x) = f(y, x)dydx = 1. We say that a random variable ξ has a distribution F (x), if. F (x) =

Alias 1.0 Rollbaserad inloggning

FORTA M315. Installation. 218 mm.

Recitation 4. 2-D arrays. Exceptions

Isometries of the plane

PORTSECURITY IN SÖLVESBORG

Vad kännetecknar en god klass. Vad kännetecknar en god klass. F12 Nested & Inner Classes

Programmerbara kretsar och VHDL. Föreläsning 9 Digitalteknik Mattias Krysander Institutionen för systemteknik

Resultat av den utökade första planeringsövningen inför RRC september 2005

Materialplanering och styrning på grundnivå. 7,5 högskolepoäng

TDDC30. Kursledning Kursledare: Jonas Lindgren. Labassistent: Jonas Lindgren Labassistent: Niklas Holma Labassistent: Erik Nilsson

LOG/iC2. Introduction

Programmering I Tobias Wrigstad fredag, 2009 augusti 28

GU / Chalmers Campus Lindholmen Tentamen Programutveckling LEU 482 / TIG167

8 < x 1 + x 2 x 3 = 1, x 1 +2x 2 + x 4 = 0, x 1 +2x 3 + x 4 = 2. x 1 2x 12 1A är inverterbar, och bestäm i så fall dess invers.

VHDL 1. Programmerbara kretsar

Isolda Purchase - EDI

Grafisk teknik IMCDP IMCDP IMCDP. IMCDP(filter) Sasan Gooran (HT 2006) Assumptions:

Förändrade förväntningar

Schenker Privpak AB Telefon VAT Nr. SE Schenker ABs ansvarsbestämmelser, identiska med Box 905 Faxnr Säte: Borås

KOMBINATORISKA FUNKTIONER...1

Swedish adaptation of ISO TC 211 Quality principles. Erik Stenborg

Digitalteknik syntes Arne Linde 2012

and u = och x + y z 2w = 3 (a) Finn alla lösningar till ekvationssystemet

Writing with context. Att skriva med sammanhang

Programmerbara kretsar och VHDL. Föreläsning 9 Digitalteknik Mattias Krysander Institutionen för systemteknik

Schenker Privpak AB Telefon VAT Nr. SE Schenker ABs ansvarsbestämmelser, identiska med Box 905 Faxnr Säte: Borås

Scalable Dynamic Analysis of Binary Code

Digitalteknik och Datorarkitektur 5hp

Kurskod: TAMS28 MATEMATISK STATISTIK Provkod: TEN1 05 June 2017, 14:00-18:00. English Version

12.6 Heat equation, Wave equation

IE1206 Embedded Electronics

Hjälpmedel: Appendix A. VHDL-syntax. (bifogas detta prov) Appendix B.2. IEEE-package (bifogas detta prov)

std_logic & std_logic_vector

Foto: Rona Proudfoot (some rights reserved) Datorarkitektur 1. Datapath & Control. December

Chapter 2: Random Variables

Uttagning för D21E och H21E

Quicksort. Koffman & Wolfgang kapitel 8, avsnitt 9

Dokumentnamn Order and safety regulations for Hässleholms Kretsloppscenter. Godkänd/ansvarig Gunilla Holmberg. Kretsloppscenter

Tentamen i Matematik 2: M0030M.

Grafisk teknik IMCDP. Sasan Gooran (HT 2006) Assumptions:

6 th Grade English October 6-10, 2014

FÖRBERED UNDERLAG FÖR BEDÖMNING SÅ HÄR

Provlektion Just Stuff B Textbook Just Stuff B Workbook

Webbregistrering pa kurs och termin

-c wc. Pre- Next state Out- Vi ser att tillstånden är redan sorterade i grupper med olika utsignaler,

Högskolan i Skövde (SK, JS) Svensk version Tentamen i matematik

Boiler with heatpump / Värmepumpsberedare

Datasäkerhet och integritet

Second handbook of research on mathematics teaching and learning (NCTM)

Webbreg öppen: 26/ /

Exempelsamling Assemblerprogrammering

Imperative Programming

DESIGN AV KOMBINATORISK LOGIK

OBS!! Detta är DEL 2 av tentan. För att få ut denna måste du ha lämnat in del 1. Om du inte fått ut del 1 bör du meddela skrivningsvakten. OBS!!

(D1.1) 1. (3p) Bestäm ekvationer i ett xyz-koordinatsystem för planet som innehåller punkterna

Programmerbara kretsar och VHDL 1. Föreläsning 9 Digitalteknik, TSEA22 Oscar Gustafsson, Mattias Krysander Institutionen för systemteknik

Programmerbara kretsar och VHDL. Föreläsning 10 Digitalteknik, TSEA22 Mattias Krysander Institutionen för systemteknik

Digital elektronik CL0090


Libers språklåda i engelska Grab n go lessons

Taking Flight! Migrating to SAS 9.2!

För att justera TX finns det ett tool med namnet MMDVMCal. t.ex. /home/pi/applications/mmdvmcal/mmdvmcal /dev/ttyacm0

Grafisk teknik. Sasan Gooran (HT 2006)

Virtuellt VA med digitala tvillingar

729G04 Programmering och diskret matematik. Python 2: Villkorssatser, sanningsvärden och logiska operatorer

TDDC30. Objektorienterad programmering i Java, datastrukturer och algoritmer. Föreläsning 1 Jonas Lindgren, Institutionen för Datavetenskap, LiU

Documentation SN 3102

SVENSK STANDARD SS-EN ISO 19108:2005/AC:2015

Transkript:

BO 1 VHDL Basics Outline Component model Code model Entity Architecture Identifiers and objects Operations for relations Bengt Oelmann -- copyright 2002 1 Component model Model for describing components External interface Internal function Ports: external connections to the component VHDL-komponent A B C The component s - Behaviour or - Structure X Y Function: a number of parallel processes Bengt Oelmann -- copyright 2002 2

BO 2 Code model VHDL-component Declaration of entity Interface - Entity with ports Declaration of architecture Function - architecture Bengt Oelmann -- copyright 2002 3 Declare the interface of the VHDLcomponent MUX 2-1 a b y sel entity mux2 is port ( a: in STD_LOGIC; b: in STD_LOGIC; sel: in STD_LOGIC; y: out STD_LOGIC; ); end mux2; Bengt Oelmann -- copyright 2002 4

BO 3 The ports of the VHDL-component port defines inputs and outputs entity mux2 is port ( a: in STD_LOGIC; b: in STD_LOGIC; sel: in STD_LOGIC; y: out STD_LOGIC; ); end mux2; in/out defines the mode of the port Determines the direction of the dataflow std_logic is the datatype for the inputs and output Bengt Oelmann -- copyright 2002 5 Ports in VHDL Port-declaration is the most important thing in the entity-declaration Each port represents The external pins of the component Each port has a Port-name Mode Datatype An identifier that you create Direction of data Which values to port can be assigned Bengt Oelmann -- copyright 2002 6

BO 4 The modes of the port IN The signal goes only in to the component and the value is driven by another component. The input signal is used on the right side in the assignment: z <= a OR inport OUT The signal goes out from the component. It is not possible to read the value of the output. Is used on the left side in the assignment: outport <= a OR b BUFFER The signal goes out from the component. It is not possible to read the value of the output. Can be used on both sides in the assignment: buffer_port <= a OR b; z <= buffer_port OR c; INOUT The signal can go in both directions, either in or out -The value of the signal can be read by the component -The signal can be driven by other components -Can be used in both sides in an assignment Bengt Oelmann -- copyright 2002 7 Describing the function in the architecture MUX 2-1 a b y sel architecture mux2_arch of mux2 is begin mux2_1: process(a, b, sel) begin if sel = '0' then y <= a; else y <= b; end if; end process mux2_1; end mux2_arch; In the architecture the function is described: If sel is 0 then the value of a is put on the output y. Otherwise (sel=1) the value of b is put on the output y. Bengt Oelmann -- copyright 2002 8

BO 5 Declaration of the architecture Name of the architecture Name of the entity begin end for the architecture architecture mux2_arch of mux2 is begin mux2_1: process(a, b, sel) begin if sel = '0' then y <= a; else y <= b; end if; end process mux2_1; end mux2_arch; Process with sensitivity-list Sequential statements (if-then-else) in the process begin end for the process Bengt Oelmann -- copyright 2002 9 Structure of the architecture architecture name_arch of name is Declaration of signals begin Parallella satser Process 1 Signals are used for communication between components and parallel statements. Signals can only be declared at architecture-level (not in processes) Parallel statements Process 2 Inside a process the execution is sequential Parallel statements end name_arch; Processes and parallell statements are executed in parallel Bengt Oelmann -- copyright 2002 10

BO 6 Example of parallel and sequential statements ENTITY ename IS Ports( a, b, c: IN bit; y, z, w: OUT bit; Deklarationer -- no variables allowed END ename ARCHITECTURE first OF ename IS Deklarationer -- no variables, but signals are OK BEGIN y <= a AND b; PROCESS (a,b,c) Deklarationer VARIABLE v: bit; BEGIN v := (a OR b); v := v AND c; w <= a XOR v; END PROCESS; -- no signals, but variables are OK Parallel processes Statements in processes are sequential z <= c XOR b; END first; Bengt Oelmann -- copyright 2002 11 Identifiers in VHDL Identifiers Are names on things that you create E.g. names for architectures, entities, processes, variables, signals Rules for naming Cannot be a reserved word in VHDL (e.g. for, if) VHDL is case-insensitive First character must be a letter Last character cannot be underscore (_) Two consecutive underscores are not allowed Bengt Oelmann -- copyright 2002 12

BO 7 Objects in VHDL Objects can hold a value Objects have class and type Class determines what kind of operations can be performed on the object Type determines what values the object can hold Objects can be initialized (only for simulation) They are declared in entity, architecture, process, or package Bengt Oelmann -- copyright 2002 13 Classes in VHDL Signal Their values are changed as a function of time They have a signal-driver and can be seen upon as a wire Variable Their values are changed immediately after assignment No timing is related to variables Constant Their values cannot be changed File Values to and from external file can be accessed Bengt Oelmann -- copyright 2002 14

BO 8 Datatypes in VHDL VHDL has hard requirements on typing Objects of different types cannot be mixed Functions for type-conversion must be used Two main categories of datatypes Scalar Can be assigned one single value Examples: enumeration, integer, float, physical Composite Can be assigned multiple values Examples: array, record Bengt Oelmann -- copyright 2002 15 Scalar Enumeration A list of discrete values the variable can be assigned to Ex: type weekday = (mon, tue, wed, thu, fri, sat, sun); Integer A set integers positive or negative A pre-defined datatype Integer is of 32-bits with sign 2 31 to +(2 31-1) When describing hardware a limited range can be used Ex: variable num: integer range 64 to 64 Bengt Oelmann -- copyright 2002 16

BO 9 Scalar Floating-point Pre-defined datatype is real 32-bits single precision Is never used for describing hardware Will result in too complex hardware Physical Datatype for physical units Ex. time, ma, Volt Has no meaning for describing hardware Bengt Oelmann -- copyright 2002 17 Examples of enumerated datatypes Pre-defined types (1076) type boolean is (FALSE, TRUE); type bit is ( 0, 1 ); Pre-defined types (1164) Std_logic Std_ulogic Arrays of these types and sub-types Access to these types by including: LIBRARY ieee; USE ieee.std_logic_1164.all; Bengt Oelmann -- copyright 2002 18

BO 10 Std_logic Definition av std_logic type std_ulogic is ( U, -- Uninitialized X -- Forcing unknown 0 -- Forcing zero 1 -- Forcing one Z -- High impedance W -- Weak unknown L -- Weak zero H -- Weak one - );-- Don t care subtype std_logic is resolved std_ulogic; library IEEE; use IEEE.std_logic_1164.all; First in the VHDL to include libraries (packages) Bengt Oelmann -- copyright 2002 19 Arrays Composite data types Examples of declarations of 8-bit vectors signal s1: bit_vector(7 downto 0); variable v1: bit_vector(7 downto 0); Assignment of the bit vector 11010010 s1 <= 11010010 ; v1 := 11010010 ; Least significant bit Most significant bit Bengt Oelmann -- copyright 2002 20

BO 11 Composite data types Ex: two-dimensional array type table6x2 is array (0 to 5, 1 downto 0) of bit; constant mytable: table6x2 := ( 00, 01, 10, 11, 01, 01 ); 0 1 2 3 4 5 1 0 0 1 1 0 0 0 0 1 0 1 1 1 Ex: Bit vectors for binary, octal and hexadecimal numbers X A3 -- = B 1010_0011 for a 8-bits vector O 27 -- = B 010_111 for a 6-bits vector Bengt Oelmann -- copyright 2002 21 Attribute Attribute Holds information about a signal, variable, data type, function. Example #1 type bitcount is integer range 3 to +5; -3-2 -1 0 +1 +2 +3 +4 +5 bitcount left bitcount right bitcount low bitcount high Bengt Oelmann -- copyright 2002 22

BO 12 Attribute Example #2 type byte is array (7 downto 0) of std_logic; 7 6 5 4 3 2 1 0 byte left byte right byte low byte high i går från 7 ner till 0 Example #3 for i in byte high downto byte low loop v_byte(i) := 1 ; end loop; Bengt Oelmann -- copyright 2002 23 Operators in VHDL Operators for Relations Arithmetic operationer Symbol Operation = eual /= Un-equal < Less than > Greater than <= Less-equal >= Greater-equal Symbol Operation + addidion - subtraktion * multiplikation / division abs Absolute value rem remainder mod modulus ** exponent Supported by synthesis tools Bengt Oelmann -- copyright 2002 24

BO 13 END of Lecture 2 Outline Component model Code model Entity Architecture Identifiers and objects Operations for relations Bengt Oelmann -- copyright 2002 25