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

Similar documents
ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

Sequential Logic - Module 5

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

Timing in synchronous systems

VHDL in 1h. Martin Schöberl

In our case Dr. Johnson is setting the best practices

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

VHDL And Synthesis Review

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

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

Lecture 12 VHDL Synthesis

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

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

ECEU530. Project Presentations. ECE U530 Digital Hardware Synthesis. Rest of Semester. Memory Structures

Control and Datapath 8

SEQUENTIAL STATEMENTS

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

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

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

[VARIABLE declaration] BEGIN. sequential statements

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

Summary of FPGA & VHDL

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

Sequential Statement

8 Register, Multiplexer and

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

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

Concurrent & Sequential Stmts. (Review)

VHDL Examples Mohamed Zaky

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016

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

Inferring Storage Elements

Introduction to VHDL #3

Lab 3. Advanced VHDL

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

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

Field Programmable Gate Array

CprE 583 Reconfigurable Computing

Problem Set 10 Solutions

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points)

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

EITF35: Introduction to Structured VLSI Design

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

Homework deadline extended to next friday

Test Benches - Module 8

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution

ECEU530. Last Few Lectures. ECE U530 Digital Hardware Synthesis. What is on Quiz 2. Projects. Today:

Design Problem 5 Solution

ECE U530 Digital Hardware Synthesis. Programming Assignments

EITF35: Introduction to Structured VLSI Design

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

EITF35: Introduction to Structured VLSI Design

Sign here to give permission to return your test in class, where other students might see your score:

Contents. Chapter 9 Datapaths Page 1 of 28

CCE 3202 Advanced Digital System Design

ELCT 501: Digital System Design

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

EEL 4712 Digital Design Test 1 Spring Semester 2007

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

VHDL: RTL Synthesis Basics. 1 of 59

Computer-Aided Digital System Design VHDL

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006

Hardware Description Language VHDL (1) Introduction

EL 310 Hardware Description Languages Midterm

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

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

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

ELE432. ADVANCED DIGITAL DESIGN HACETTEPE UNIVERSITY Designing with VHDL

CCE 3202 Advanced Digital System Design

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

The CPU Bus : Structure 0

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

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

6.111 Lecture # 8. Topics for Today: (as time permits)

ECE 545: Lecture 11. Programmable Logic Memories

ECE 545: Lecture 11. Programmable Logic Memories. Recommended reading. Memory Types. Memory Types. Memory Types specific to Xilinx FPGAs

CS/EE Homework 7 Solutions

VHDL simulation and synthesis

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

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

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

Hardware Description Languages. Modeling Complex Systems

VHDL for Logic Synthesis

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

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

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

Luleå University of Technology Kurskod SMD098 Datum Skrivtid

ECE 699: Lecture 9. Programmable Logic Memories

ECE 545 Lecture 12. FPGA Resources. George Mason University

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

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic

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

CprE 583 Reconfigurable Computing

HDL. Hardware Description Languages extensively used for:

Lab 3: Standard Combinational Components

Designing with VHDL and FPGA

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

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

EEL 4712 Digital Design Test 1 Spring Semester 2008

Transcription:

ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 8, 2006 Midterm Average: 70 Lecture 16: Midterm Solutions Homework 6: Calculator Handshaking HW 6: Due Wednesday, November 15 Project Progress reports due Friday, Nov 10 Schedule Homework 6 due Wednesday, November 15 Complete the Calculator from ECEU323 in VHDL Write a controller Combine controller and datapath Use the posted entities Project progress report due Friday, November 10: and email to me telling me where your project stands some working VHDL code in your home directory November 15 th and 20 th : student presentations on projects: sign up for a date to do your project presentation Sign up to demo your working project code to me November 20 th or 21 st ECE U530 F06 2 Rest of Semester Lecture Monday November 13: Using memories in VHDL Upcoming lectures: Designing a complex multiply accumulator: Chapter 6 of Ashenden Midterm Question 1a Give an example of a case statement where you need an others clause and an example where you do not. You can either explain in words, or show VHDL code. Quiz in class on December 4 Project due dates: Nov 20: Preliminary Project Report Dec 13: Final Project Report Due 3 4

Midterm 1b The following snippet of VHDL code is incorrect. Explain what is wrong and correct the problem: signal A,B: std_logic_vector(5 downto 0); signal F: std_logic_vector(6 downto 0); F <= A + B; Midterm 1c A designer, who wanted to implement some combinational logic for an and-or-invert gate whose output is stored in a flipflop, wrote the following code: process(clk) if rising_edge(clk) then E <= A and B; F <= C and D; G <= E or F; Q<= not(g); end if; end process; Is this code correct? If yes, explain why. If not, fix it. 5 6 Midterm 1d Midterm 1e What are 2 VHDL constructs that will synthesize latches when you do not want them? Why are the latches synthesized? For combinational circuitry, when should you use the VHDL if then else construct and when should you avoid it? 7 8

Midterm Question 2 Write VHDL code for a 6-bit 3-to-1 multiplexer. entity threemux is Port ( S : in std_logic_vector(1 downto 0); A, B, C: in std_logic_vector(5 downto 0); Y : out std_logic_vector(5 downto 0)); end threemux; architecture Behavioral of threemux is process(s, A, B, C) case S is when "00" => Y <= A; when "01" => Y <= B; when "10" => Y <= C; when others => Y <= "------"; end case;end process; end Behavioral; Midterm Q3 Below is correct VHDL code for a shift register: library ieee; use ieee.std_logic_1164.all; entity shift is port(clk, SI : in std_logic; SO : out std_logic); end shift; architecture archi of shift is signal tmp: std_logic_vector(3 downto 0); process wait until (Clk'event and Clk = '1'); tmp <= tmp(2 downto 0) & SI; end process; SO <= tmp(3); end archi; (a) Identify the line or lines of code that will cause flipflops to be inferred. 9 10 Midterm Q3b Midterm Q3c Draw the schematic that will be synthesized from this code. Your schematic should consist of flipflops and any additional logic gates needed. (c) Rewrite the code to include an asynchronous, active high reset. entity shift is port(clk, SI, Reset : in std_logic; SO : out std_logic); end shift; architecture archi of shift is signal tmp: std_logic_vector(3 downto 0); process (reset, clk) if reset = '1' then tmp <= "0000"; elsif (Clk'event and Clk = '1') then tmp <= tmp(2 downto 0) & SI; end if; end process; SO <= tmp(3); end archi; 11 12

Midterm Q4 A circular shift register or ring counter connects the output of a shift register to its input. The counter is triggered on the rising edge of the clock. Your counter should count (shift left) on every clock edge. It should be reset to 0001 on an active high reset signal. (a) (4 pts) Fill in the table to indicate the expected behavior of your ring counter. Reset Clk Count 1 0001 0 0010 0 0 0 0 Midterm Q4b Write VHDL code for a 4-bit ring counter with active high reset. entity ring is port(clk, Reset : in std_logic; Count : out std_logic_vector(3 downto 0)); end ring; architecture Behavioral of ring is signal temp: std_logic_vector(3 downto 0); process (Clk, Reset) if reset = '1' then temp <= "0001"; elsif rising_edge(clk) then temp <= temp(2 downto 0) & temp(3); end if; end process; count <= temp; end Behavioral; 13 14 Midterm Q5: code Midterm Q5 architecture with_fn of fsm is type state_type is (A, B, C); signal present, nxt:state_type; process (CLK, RESET) if RESET='1' then present <= A; elsif (CLK'event and CLK='1') then present <=nxt; end if; end process; PROCESS (present, x) BEGIN CASE present IS WHEN a => IF x = '1' THEN nxt <= a; ELSE nxt <= b; END IF; Z <= '0'; WHEN b => IF x = '0' THEN nxt <= b; ELSE nxt <= c; END IF; Z <= '0'; WHEN c => IF x = '0' THEN nxt <= b; Z <= '1'; ELSE nxt <=a; Z <= '0'; END IF; END CASE; END PROCESS; end architecture; (a) (8 pts) Draw the state machine described by this code. (b) (4pts) What function does this state machine implement? Be specific. 15 16

Midterm Q5c Calculator: Lab 5 When this VHDL code is synthesized, the Xilinx tools recognize a state machine and synthesize the logic needed. Part of this task is state assignment. What is assigned when the tools do state assignment? How is the state assignment determined? 17 18 Calculator Entity library IEEE; use IEEE.std_logic_1164.all; entity Calc is port (sw: in STD_LOGIC_VECTOR(7 downto 0); -- instruction and data input bus reset: in STD_LOGIC; -- active high reset signal exc: in STD_LOGIC; -- execution signal, active high clk: in STD_LOGIC; -- clock signal dout: out STD_LOGIC_VECTOR (3 downto 0); -- data output cout: out STD_LOGIC -- 4th bit from tos, -- indicates error flag ); end Calc; 19 Calculator Architecture architecture Calc_arch of Calc is component ctrl port (reset: in STD_LOGIC; -- active high reset signal clk : in STD_LOGIC; -- clock signal exc : in STD_LOGIC; -- execution signal active high sw : in STD_LOGIC_VECTOR(7 downto 4); -- instruction sm : out STD_LOGIC; -- mux select signal sa : out std_logic_vector (2 downto 0); -- alu select ss : out std_logic_vector (1 downto 0)); -- stack select end component; component datapath port (reset : in STD_LOGIC; -- asynchronous reset din : in std_logic_vector (3 downto 0); -- input data dout: out std_logic_vector (3 downto 0); -- output data cout : out std_logic; -- carry, borrow or overlow flag sm : in std_logic; -- mux selector sa ss : in std_logic_vector (2 downto 0); -- alu select : in std_logic_vector (1 downto 0); -- stack select clk : in std_logic ); -- clock end component; -- <<enter your statements here>> end Calc_arch; 20

Controller Entity library IEEE; use IEEE.std_logic_1164.all; entity ctrl is port ( reset: in STD_LOGIC; -- active high reset signal clk : in STD_LOGIC; -- clock signal exc : in STD_LOGIC; -- execution signal, active high sw : in STD_LOGIC_VECTOR (7 downto 4); -- instruction input sm: out STD_LOGIC; -- mux select signal sa: out std_logic_vector (2 downto 0); -- alu select ss: out std_logic_vector (1 downto 0) ); -- stack select ); end ctrl; architecture ctrl_arch of ctrl is -- <<enter your statements here>> end ctrl_arch; Controller for Calculator Always go through all the states EXE = 0 Reset Wait EXE = 1 TOS1 TOS2 PUSH 21 22 Controller for Calculator Push instruction TOS1: hold stack TOS2: hold stack, put input in temp register PUSH: push input Pop instruction TOS1: pop TOS2: hold stack TOS3: hold stack Add TOS1 + TOS2 TOS1: Put TOS in temp register, pop stack TOS2: Add TOS to temp register, pop stack PUSH: Push result Handshaking Handshaking is important for interfacing to designs How do you know when your inputs have data? How do you signal that your results are ready? Handshaking is useful for testbenches: Allows you to use the same testbench even if internal timing of your hardware changes. 23 24

Handshaking En -- an input signal telling the hardware to start Valid -- an output signal saying the result is ready What is wrong with this model? Sender En Valid inputs Hardware Handshaking One signal for input: Enable One signal for output: Valid How do you know if HW is ready? How do you know that HW has read the input data? How does HW know that Sender has read the output? result 25 26 Signaling Protocol Signaling Protocol: communication protocol req: initiate an action ack: signal completion of that action Two handshake signals for send data Control Signaling Protocol Four-phase Handshaking protocol Sender req data ack Receiver Level signaling or return to zero Sender Receiver req ack data 27 28

Control Signaling Protocol Two-phase Handshaking protocol Importance of Handshaking Hardware needs to know when inputs are ready Software needs to know when results are valid Different designs can have different timing Behavioral Register Transfer Level (RTL) Pipelined version vs. non-pipelined version Transition signaling or Non-return to zero req Sender data 29 ack Receiver Can use the same testbench with different hardware timing if you use handshaking in your hardware design 30