Luleå University of Technology Kurskod SMD152 Datum Skrivtid

Similar documents
Luleå University of Technology Kurskod SMD098 Datum Skrivtid

Lecture 12 VHDL Synthesis

VHDL in 1h. Martin Schöberl

Sequential Logic - Module 5

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

VHDL for Synthesis. Course Description. Course Duration. Goals

VHDL simulation and synthesis

3 Designing Digital Systems with Algorithmic State Machine Charts

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Written exam for IE1204/5 Digital Design Thursday 29/

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University

In our case Dr. Johnson is setting the best practices

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

ECE 341 Midterm Exam

ELCT 501: Digital System Design

CDA 4253 FPGA System Design Op7miza7on Techniques. Hao Zheng Comp S ci & Eng Univ of South Florida

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

Timing in synchronous systems

VHDL: RTL Synthesis Basics. 1 of 59

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

VHDL And Synthesis Review

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

CprE 583 Reconfigurable Computing

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

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

EITF35: Introduction to Structured VLSI Design

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

Digital Design with FPGAs. By Neeraj Kulkarni

Summary of FPGA & VHDL

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

Control and Datapath 8

Verilog for High Performance

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

problem maximum score 1 10pts 2 8pts 3 10pts 4 12pts 5 7pts 6 7pts 7 7pts 8 17pts 9 22pts total 100pts

Sequential Statement

Register Transfer Level

Computer-Aided Digital System Design VHDL

Finite State Machines (FSM) Description in VHDL. Review and Synthesis

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

Lab 3. Advanced VHDL

FPGA for Software Engineers

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

Sign here to give permission for your test to be returned in class, where others might see your score:

Register Transfer Level in Verilog: Part I

EL 310 Hardware Description Languages Midterm

קורס VHDL for High Performance. VHDL

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004

Overview. Ram vs Register. Register File. Introduction to Structured VLSI Design. Recap Operator Sharing FSMD Counters.

Today. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1 Solutions

[VARIABLE declaration] BEGIN. sequential statements

CprE 583 Reconfigurable Computing

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

Introduction to Design Vision. Instructor: Prof. Shantanu Dutt. TA: Soumya Banerjee

Written Re-exam with solutions for IE1204/5 Digital Design Friday 10/

EE 109L Review. Name: Solutions

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

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

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

VHDL Examples Mohamed Zaky

The Virtex FPGA and Introduction to design techniques

Concurrent & Sequential Stmts. (Review)

CSE 260 Digital Computers: Organization and Logical Design. Exam 2. Jon Turner 3/28/2012

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

Programmable Logic. Simple Programmable Logic Devices

Note: Closed book no notes or other material allowed, no calculators or other electronic devices.

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

Hardware Description Language VHDL (1) Introduction

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences. Spring 2010 May 10, 2010

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

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

VHDL for Logic Synthesis

Lecture 08 Finite State Machine Design Using VHDL

Programable Logic Devices

CS303 LOGIC DESIGN FINAL EXAM

EITF35: Introduction to Structured VLSI Design

ECE 545 Lecture 12. FPGA Resources. George Mason University

VHDL for FPGA Design. by : Mohamed Samy

HDL. Hardware Description Languages extensively used for:

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

EITF35: Introduction to Structured VLSI Design

SEQUENTIAL STATEMENTS

8 Register, Multiplexer and

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS

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

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

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

HDL Design Cube. Synthesis and VHDL

ECE 341 Midterm Exam

Recitation Session 6

-- Fill in values for each generic. -- Fill in values for each signal. SIGNAL load_start : std_ulogic := '1'; SIGNAL clock : std_ulogic := '0';

Counters. Counter Types. Variations. Modulo Gray Code BCD (Decimal) Decade Ring Johnson (twisted ring) LFSR

QUARTUS II Altera Corporation

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

Transcription:

Luleå University of Technology Kurskod SMD152 Datum 2003-10-24 Skrivtid 9.00 13.00 1 Manual synthesis (10 p, 2 p each) Here you are given five different VHDL models. Your task is to draw the schematics of the VHDL models. Your schematics may only contain: Antal uppgifter: 6 Max poäng: 44 Lärare: Jonas Thor Telefon: 070-5197463 Tillåtna hjälpmedel: Enbart skrivmaterial. En VHDL syntax guide är bifogad med tentamen Allowed material Only writing material. A VHDL syntax guide is included in the exam. AND gates with n inputs ( n 2) OR gates with n inputs XOR gates with n inputs Inverters Multiplexers Tri-state buffers Positive edge triggered D-type flip-flops, with or without synchronous or asynchronous clear or set. The flip-flops may also have a clock enable input (CE). Transparent data latches You may write in English or in Swedish. Clearly mark the names of the inputs/outputs as indicated in the VHDL source. a) library ieee; entity One_a is Clk : in std_logic; A, B : in std_logic; Y1, Y2 : out std_logic); end One_a; architecture RTL of One_a is signal I : std_logic; process(clk) variable V : std_logic; if rising_edge(clk) then V := A or B; I <= not (A and B); Y1 <= V; Y2 <= I xor V; 2

b) library ieee; entity One_b is Clk : in std_logic; A, B : in std_logic; Y : out std_logic); end One_b; architecture RTL of One_b is signal I1, I2 : std_logic; Y <= A and not(i2); process(clk) if rising_edge(clk) then I2 <= I1 and B; I1 <= A; c) library ieee; entity One_c is Clk, Reset : in std_logic; A, B : in std_logic; Output : out std_logic); end One_c; architecture RTL of One_c is type State is (S0, S1); signal PState, NState : State; process(clk, Reset) if Reset = '1' then PState <= S0; elsif rising_edge(clk) then PState <= NState; process(pstate, A, B) case PState is when S0 => Output <= '0'; if A = '1' then NState <= S1; NState <= S0; when S1 => Output <= '1'; if B = '1' then NState <= S0; NState <= S1; end case; 3 4

d) library ieee; use ieee.numeric_std.all; entity One_d Clk, Reset : in std_logic; E : in std_logic; P : out std_logic); end One_d; architecture RTL of One_d is signal C : unsigned(1 downto 0); process(clk) if rising_edge(clk) then if Reset = '1' then -- Note! specify if this reset is C <= "00"; -- synchronous or asynchronous elsif E = '1' then C <= ('0' & C(0)) + 1; P <= C(1) and E; e) library ieee; entity One_e is port ( A, B : in std_logic; X, Y : out std_logic); end One_e; architecture Proc of One_e is signal I : std_logic; P1 : process (A, B) if A = B then I <= A; I <= B; end process P1; P2 : process (I) if I = '1' then Y <= A; Y <= B; end process P2; X <= I; end Proc; 5 6

2 Timing diagram (4 p) 3 Finite State Machine (8p) A finite state machine is specified by the ASM chart and VHDL entity shown below. When the FSM is asynchronously reset it enters the S0 state. library ieee; entity FSM is Clk, Reset : in std_logic; A : in std_logic; F, Y : out std_logic); end FSM; Given the data path above fill in the values of the R output in the timing diagram below. The data path consists of positive edge triggered flip-flops, an adder, a multiplier and a multiplexer. a) Write synthesizable VHDL code that implements the state machine described in the ASM chart. b) Derive a gate level implementation of the FSM. Clearly show your work in each step solving this problem. 7 8

5 FPGA design flow (6p) 4 Behavioural synthesis (10 points, 2 point each) You have an algorithmic description of a computational structure given by the source code listed below. library ieee; entity Exam is A, B, C, D : in integer; X, Y : out integer); end Exam; architecture Algorithm of Exam is X <= (A**2)*B + A*C; -- A*A*B + A*C Y <= B*C + B*D + D; end Algorithm; Notice the description is purely combinational. Your task is to perform behavioural synthesis and transfer the algorithm to a synchronous sequential computational structure. a) Derive a scheduled data flow graph with the constraint that only one adder and one multiplier is available. Minimize the latency. Explain the design flow for a programmable logic device from design entry to device configuration. Draw a flow chart of the design flow and give written explanation of each design step. You may assume that you use VHDL for design entry and that your target device is an FPGA just like in the labs. You should explain at least the following tasks/processes; placement, routing, synthesis, functional simulation, timing simulation, static timing analysis and bit stream generation. Note! One of the mentioned processes was not performed in the lab, which one was that? 6 D Flip-flop (6p) Explain the following timing parameters for a positive edge triggered D flip-flop: Setup time Hold time Clock to output delay Use a timing diagram to illustrate the timing parameters. Also explain the term metastability. When can metastability occur and why? What can be done to reduce the chance of a system failure when a metastability event occurs? b) Allocate functional units and registers for the scheduled data flow graph derived in a). Each input should be assigned a register. Name the registers RA, RB, RC and RD. This means that the in the first clock cycle input A should be assigned to RA (RAA) and so on. Minimize the number of registers. You should assume that the registers have a clock enable input signal. The outputs X and Y should be registered as well but these registers may be shared with other registers. c) Draw the data path of design based on your solution of b). Make sure to label registers and show all necessary control signals, such as multiplexer select signals and clock enable signals. d) Draw the ASM chart using register transfer notation. The first state is given by this state box RA A RB B RC C RD B e) Draw the detailed ASM chart showing when the control signals are activated. 9 10

1 a) A B i_1 D Q i D Q Y1 Y1 1 e) Optimized implementation. Not necessary for full score, solution only needs to be functional correct. Most have solved this problem with two muxes + one xor (or xnor) gate which is ok. Clk D Q Y2 v_1 y2_1 Y2 1 b) 2) B Clk A D i1 Q i2_1 D i2 Q Y Y 1 c) The thick wire is just one bit. Clk A B Reset 0 1 nstate[0] D Q R pstate[0] Output 1 d) A 1-bit counter with registered carry output + an AND gate 11 12

Problem 3. a) VHDL source library ieee; entity FSM is Clk, Reset : in std_logic; A : in std_logic; F, Y : out std_logic); end FSM; architecture RTL of FSM is type State_type is (S0, S1, S2); signal PState, NState : State_type; process(clk, Reset) if Reset = '1' then PState <= S0; elsif rising_edge(clk) then PState <= NState; process(a, PState) F <= '0'; Y <= '0'; case PState is when S0 => if A = '1' then NState <= S1; F <= '1'; NState <= S0; when S1 => NState <= S2; Y <= '1'; when S2 => if A = '1' then NState <= S1; NState <= S2; end case; 3 b) We will solve this problem using one-hot encoding. Other encodings are valid as well. One-hot encoding Lets name the state vector Q. The encoding is chosen so that S0 Q= 001, S1 Q= 010 and S2 Q = 100. The main advantage of one-hot encoding is that only one bit needs to be examined in order to check if we are in a particular state. The state transition and output table is shown below Q A Q+ Y F 001 0 001 0 0 001 1 010 0 1 010 0 100 1 0 010 1 100 1 0 100 0 100 0 0 100 1 010 0 0 By inspection we can determine the next state and output equations Q 0 + = Q 0 A Q 1 + = Q 2 A + Q 0 A = A(Q 2 + Q 0 ) Q2+ = Q 1 + Q 2 A Y = Q 1 F = Q 0 A This is also simple to derive directly from the ASM chart. The above equations can in words be translated to Next state is S0 if current state is S0 and A=0 Next state is S1 if current state is S2 and A=1 or if current state is S0 and A=1 Next state is S2 if current state is S1 or if current state is S1 or if current state is S2 and A = 0 Output Y is set in state S1 Output F is set if current state is S0 and A=1 The schematics is not shown, should be trivial. Note! This is not a safe implementation. What happens if there is a bit error in the state vector? A safe FSM would detect non-valid states and perform appropriate actions. 13 14

4 a) 4 c) 4 b) 4 d-e) 15 16