Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Similar documents
Hardware Description Language VHDL (1) Introduction

ELCT 501: Digital System Design

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

Digital Systems Design

IT T35 Digital system desigm y - ii /s - iii

Contents. Appendix D VHDL Summary Page 1 of 23

Review of Digital Design with VHDL

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

COE 405 Design Methodology Based on VHDL

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

VHDL BASIC ELEMENTS INTRODUCTION

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

Very High Speed Integrated Circuit Har dware Description Language

Outline. CPE/EE 422/522 Advanced Logic Design L07. Review: JK Flip-Flop Model. Review: VHDL Program Structure. Review: VHDL Models for a MUX

C-Based Hardware Design

Outline CPE 626. Advanced VLSI Design. Lecture 4: VHDL Recapitulation (Part 2) Signals. Variables. Constants. Variables vs.

Getting Started with VHDL

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

Performance Engineering of Real-Time and Embedded Systems. Introduction to VHDL

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

ENGIN 241 Digital Systems with Lab

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

VHDL 3 BASIC OPERATORS AND ARCHITECTURE BODY. Design descriptions & design constructions examples are taken from foundation series examples

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

Embedded Systems CS - ES

Introduction to VHDL #1

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

VHDL Examples Mohamed Zaky

Building Blocks. Entity Declaration. Entity Declaration with Generics. Architecture Body. entity entity_name is. entity register8 is

Architecture des Ordinateurs I

HDL. Hardware Description Languages extensively used for:

BASIC VHDL LANGUAGE ELEMENTS AND SEMANTICS. Lecture 7 & 8 Dr. Tayab Din Memon

Chapter 6 Combinational-Circuit Building Blocks

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Introduction to VHDL #3

Digital Design with FPGAs. By Neeraj Kulkarni

ECOM4311 Digital Systems Design

A bird s eye view on VHDL!

EEL 4783: Hardware/Software Co-design with FPGAs

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

VHDL Objects. Lecture 8: VHDL (2) Variables. VHDL Objects - Constant. Files. EE3109 Gopi K. Manne Fall 2007

ECE 3401 Lecture 10. More on VHDL

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Computer-Aided Digital System Design VHDL

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

[VARIABLE declaration] BEGIN. sequential statements

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

VHDL Part 2. What is on the agenda? Basic VHDL Constructs. Examples. Data types Objects Packages and libraries Attributes Predefined operators

Outline CPE 626. Advanced VLSI Design. Lecture 3: VHDL Recapitulation. Intro to VHDL. Intro to VHDL. Entity-Architecture Pair

Control and Datapath 8

Design units can NOT be split across different files

Mridula Allani Fall Fall

Concurrent Signal Assignment Statements (CSAs)

Multi-valued Logic. Standard Logic IEEE 1164 Type std_ulogic is ( U, uninitialized

VHDL for FPGA Design. by : Mohamed Samy

VHDL kod yerleşimi. kütüphaneler. Dış görünüş (entity: varlık) İşleyişi, yapısı (architecture: mimari)

Modeling Complex Behavior

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Hardware Modeling. VHDL Syntax. Vienna University of Technology Department of Computer Engineering ECS Group

Chapter 2 Basic Logic Circuits and VHDL Description

VHDL VS VERILOG.

Declarations. Lexical elements. Type declaration Subtype declaration Constant declaration Signal declaration Variable declaration.

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

CPE/EE 422/522. Chapter 8 - Additional Topics in VHDL. Dr. Rhonda Kay Gaede UAH. 8.1 Attributes - Signal Attributes that return a value

Lecture 12 VHDL Synthesis

Verilog Module 1 Introduction and Combinational Logic

VHDL Structural Modeling II

Verilog Design Principles

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

Generatore di parità. LIBRARY ieee; USE ieee.std_logic_1164.all ; ENTITY xor2 IS PORT( A, B : in std_logic ; Y : out std_logic ) ; END xor2 ;

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

Introduction to VHDL. Main language concepts

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

The University of Alabama in Huntsville ECE Department CPE Midterm Exam February 26, 2003

CCE 3202 Advanced Digital System Design

Writing VHDL for RTL Synthesis

Basic Language Concepts

Verilog. Verilog for Synthesis

Introduction to the VHDL language. VLSI Digital Design

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

The VHDL Hardware Description Language

Lattice VHDL Training

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

CMPT 250: Computer Architecture. Using LogicWorks 5. Tutorial Part 1. Somsubhra Sharangi

! Initially developed under DOD auspices, later standardized as IEEE standards , , & (standard logic data type)

EEL 4712 Digital Design Test 1 Spring Semester 2008

Summary of basic structures

VHDL Synthesis Reference

VLSI DESIGN (ELECTIVE-I) Question Bank Unit I

Transcription:

Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S. military; Ada-like language (Pascal) Verilog Defined in 1980s by a company; C-like language SystemC Defined in 2000s by several companies; consists of libraries in C++ VHDL stands for: Very High Speed Integrated Circuit Hardware Description Language

VHDL can describe a digital system at several levels: Behavioral Example: a binary adder, in terms of function of adding two binary numbers without giving any implementation detail Structural Example: a binary adder, by specifying the interconnections of the gates that comprise the adder (instantiation of several components)

In VHDL, a design consists of three sections: 1. Library and use clause 2. An entity which describes the interface. The entity declaration represents the external interface to the design entity. 3. An architecture which contains the actual implementation. The architecture body represents the internal description of the design entity

library IEEE; use IEEE.STD_LOGIC_1164.ALL; library clause entity and_gate is Port ( in_1 : in STD_LOGIC; in_2 : in STD_LOGIC; gate_out : out STD_LOGIC); end and_gate; Entity architecture Behavioral of and_gate is Begin gate_out <= in_1 and in_2; end Behavioral; Architecture

Data types identify a set of values an object may assume and the operations that may be performed on it. Type declarations are used through constructs called packages. We will use the package called std_logic_1164. It contains the common types, procedures and functions we normally need. In our class, we will use these two data types: STD_LOGIC is a data type for a single bit STD_LOGIC_VECTOR(11 downto 0) is a data type for a12-bit bus The std_logic types are defined in std_logic_1164 package.

The package std_logic_1164 is the package standardized by the IEEE that represents a nine-state logic value system known as MVL9. Three of the values, 0, 1 and Z, which stand for logical 0, logical 1, and high impedance, can be synthesized. Two values, U and X ( uninitialized and unknown, e.g. when signals with 0 and 1 values are tied together), may be encountered in simulation. The other four values are not used in our application. To use the package we say: LIBRARY ieee; USE ieee.std_logic_1164.all;

Multiplying Operators: *, /, MOD (modulo), REM (reminder) Sign operators: +, - Adding Operators: +, -, & (concatenation) Shift Operators: ROL, ROR, SLA, SLL, SRA, SRL Relational Operators: =, /=, <, <=, >, >= Logical Operators: AND, OR, NAND, NOR, XOR, XNOR Miscellaneous: **, ABS, NOT

Shift Operators: ROL, ROR, SLA, SLL, SRA, SRL Example: Let A = 10010101 A SLL 2 = 01010100 --shift left logical, filled with 0 A SRL 3 = 00010010 --shift right logical, filled with 0 A SLA 3 = 10101111 --shift left arithmetic, filled with right bit A SRA 2 = 11100101 --shift right arithmetic, filled with left bit A ROL 3 = 10101100 --rotate left by 3 A ROR 5 = 10101100 --rotate right by 5

The symbol <= is the signal assignment operator Example: C <= A+B; K <= not H ; A signal must be assigned after begin in the architecture body The symbol => is the signal association operator used in instantiation (you will see it later)

An internal signal must be declared before usage. A signal declaration has a form of: Signal signal_name : type_name [ := initial_value]; A signal must be declared before begin in the architecture body Every line must be terminated with a semicolon ; Use -- for your comments. The text after it is ignored. Example: -- this is a comment

entity FullAdder is Port ( a : in STD_LOGIC; b : in STD_LOGIC; cin : in STD_LOGIC; cout : out STD_LOGIC; s : out STD_LOGIC); end FullAdder; architecture Equations of FullAdder is begin s <= (a xor b) xor cin; cout <= (a and b) or (a and cin) or (b and cin); end Equations;

Provide easier and faster verification and simulation Allow several engineers to work on one design at the same time Speed up design compilation Produce designs that are easier to understand Manage the design flow efficiently

library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity Adder4 is Port ( x : in STD_LOGIC_VECTOR(3 downto 0); y : in STD_LOGIC_VECTOR(3 downto 0); ci : in STD_LOGIC; co : out STD_LOGIC; s : out STD_LOGIC_VECTOR(3 downto 0)); end Adder4; architecture Structure of Adder4 is component FullAdder --declare FullAdder component port (a : in STD_LOGIC; b : in STD_LOGIC; cin : in STD_LOGIC; cout : out STD_LOGIC; sum : out STD_LOGIC); end component; signal c_int: STD_LOGIC_VECTOR(3 downto 1); --declare internal signal Digital Spectrometer Design, Oregon State University; Abi Farsoni

begin --instantiate four copies of the FullAdder FA0: FullAdder port map(a => x(0), b => y(0), cin => ci, cout => c_int(1), sum => s(0)); FA1: FullAdder port map(a => x(1), b => y(1), cin => c_int(1), cout => c_int(2), sum => s(1)); FA2: FullAdder port map(a => x(2), b => y(2), cin => c_int(2), cout => c_int(3), sum => s(2)); FA3: FullAdder port map(a => x(3), b => y(3), cin => c_int(3), cout => co, sum => s(3)); end Structure; Digital Spectrometer Design, Oregon State University; Abi Farsoni

The basic statement has the form: if condition then sequential statements_1; else sequential statements_2; end if; The condition is a Boolean expression, which evaluates to TRUE or FALSE. If it is TRUE, sequential statements_1 are executed; otherwise, sequential statements_2 are executed.

In a MUX, the control inputs select which one of the data inputs is transmitted to the output case Sel is when 00 => F <= I0; when 01 => F <= I1; when 10 => F <= I3; when 11 => F <= I4; end case; I0 I1 I2 I3 4-to-1 Multiplexer MUX F Sel (1 downto 0)

A process may have the form: process (sensitivity-list) begin sequential-statements end process; Whenever one of the signals in the sensitivity list changes, the sequential statements in the process body are executed.

process (clock) begin if clock'event and clock = '1' then if reset = '1' then Q <= '0'; else Q <= D; Q <= not D; end if; end if; end process; D Flip-Flop with Synchronous Reset D Q Clock Q Reset

process_name: -- optional process (clock) begin if clock='1' and clock'event then if reset='1' then count <= (others => '0'); elsif clock_enable='1' then count <= count + 1; end if; end if; end process; Counter with Reset and Clock Enable clock_enable clock Counter count reset

1 Define your states 2 Set initial state and Go to the next state

3 Set outputs based on state only 4 Set the next state based on some conditions