EEE2243 Digital System Design Chapter 7: RTL Design by Muhazam Mustapha, March 2011.

Slides:



Advertisements
Similar presentations
HDL Programming Fundamentals
Advertisements

CPE 201 Digital Design Lecture 25: Register Transfer Level Design (2)
Verilog Descriptions of Digital Systems
Register Transfer Level
Verilog Modules for Common Digital Functions
M. Mateen Yaqoob The University of Lahore Spring 2014.
Give qualifications of instructors: DAP
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Originally designed to model and verify a design.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
1 Register-Transfer Level (RTL) Design Recall –Chapter 2: Combinational Logic Design First step: Capture behavior (using equation or truth table) Remaining.
Digital Design Copyright © 2006 Frank Vahid 1 a b F InputsOutput a'b'a' b Converting among Representations Can convert from any representation.
Chapter 7 Design Implementation (II)
1 Introduction Chapters 2 & 3: Introduced increasingly complex digital building blocks –Gates, multiplexors, decoders, basic registers, and controllers.
CPEN Digital System Design Chapter 9 – Computer Design
Register-Transfer Level (RTL) Design The combination of a controller and datapath is known as a processor. The most common method of designing a processor.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 9: RTL Design.
DIGITAL DESIGN WITH VHDL Exercise 1 1Muhammad Amir Yousaf.
Verilog Digital System Design Z. Navabi, 2006
Learning Outcome By the end of this chapter, students are expected to understand a few elementary components in digital system Decoder Multiplexer Demultiplexer.
EEE2243 Digital System Design Chapter 5: Arithmetic Logic Unit by Muhazam Mustapha, March 2012.
Conversion and Coding (12) 10. Conversion and Coding (12) Conversion.
EEE2243 Digital System Design Chapter 4: Datapath Components by Muhazam Mustapha, February 2012.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
EEE2243 Digital System Design Chapter 5: Simple Design Case Studies by Muhazam Mustapha, February 2011.
M. Mateen Yaqoob The University of Lahore Spring 2014.
EEE2243 Digital System Design Chapter 4: Verilog HDL (Sequential) by Muhazam Mustapha, January 2011.
Designing an ALU Taken from various sources Primary source: Digital Design and Computer Architecture by Harris &Harris.
EEE2243 Digital System Design Chapter 3: Verilog HDL (Combinational) by Muhazam Mustapha, January 2011.
Module 1.2 Introduction to Verilog
BR 1/991 Dice Game Implementation Why was dice game implemented in three 22V10 PLDs? What are the resources needed by the Dice Game? –Outputs: 6 for dice.
Arithmetic Circuits. Half Adder ABSumCarry
11/17/2007DSD,USIT,GGSIPU1 RTL Systems References: 1.Introduction to Digital System by Milos Ercegovac,Tomas Lang, Jaime H. Moreno; wiley publisher 2.Digital.
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Digital Design 2e Copyright © 2010 Frank Vahid 1 How To Capture Desired Behavior as FSM List states –Give meaningful names, show initial state –Optionally.
Lecture 21: Registers and Counters (1)
Brief Verilog.
ECE 274 Digital Logic RTL Design using Verilog Verilog for Digital Design Ch. 5.
Introduction to ASIC flow and Verilog HDL
Register Transfer Languages (RTL)
Learning Outcome By the end of this chapter, students are expected to understand the design, operation and block diagram of the following datapath components:
Teaching Digital Logic courses with Altera Technology
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
1 (c) W. J. Dally Digital Design: A Systems Approach Lecture 7: Data Path State Machines.
Verilog for Digital Design Copyright © 2007 Frank Vahid and Roman Lysecky 1 Verilog for Digital Design Chapter 5: RTL Design.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
CSE 140 Lecture 13 System Designs
Supplement on Verilog for Algorithm State Machine Chart
CS 270: Mathematical Foundations of Computer Science
Figure 8.1. The general form of a sequential circuit.
CSE 140 Lecture 14 System Designs
CSE 140 Lecture 14 System Designs
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
KARTHIK.S Lecturer/ECE S.N.G.C.E
Supplement on Verilog Sequential circuit examples: FSM
Learning Outcome By the end of this chapter, students are expected to be able to: Design State Machine Write Verilog State Machine by Boolean Algebra and.
Instructor: Alexander Stoytchev
CSE 140 Lecture 16 System Designs
CSE 140 Lecture 15 System Designs
Manual Example How to manually convert high-level code into circuit
Computer Architecture and Design Lecture 6
CS 140 Lecture 16 Professor CK Cheng 11/21/02.
L25 – Datapath ALU.
Supplement on Verilog Sequential circuit examples: FSM
Register-Transfer Level Components in Verilog
EEE2243 Digital System Design Chapter 1: Verilog HDL (Combinational) by Muhazam Mustapha, February 2012.
Learning Outcome By the end of this chapter, students are expected to understand the principle of RTL design.
ECE 352 Digital System Fundamentals
CSE 140 Lecture 16 System Designs
Presentation transcript:

EEE2243 Digital System Design Chapter 7: RTL Design by Muhazam Mustapha, March 2011

Learning Outcome By the end of this chapter, students are expected to understand the principle of RTL design

Chapter Content Principle of RTL Design Example (Soda / Soft Drink Dispenser) Verilog Modular Coding

RTL Design

RTL stands for “Register Transfer Level” RTL design is the level of digital system design that involves the datapath components and the routing of the data (information) between the components with an addition of a CENTRALIZED controller In this chapter we will see the general steps that involves in RTL design

Steps

Soda Dispenser Example

Examples from text book The Vahid’s text book provides many examples for you to study It is up to you read them as we won’t have enough time to cover all examples We will only discuss the soda dispenser example from the text book

Soda Dispenser Problem Specification: c: bit input, 1 when coin deposited a: 8-bit input having value of deposited coin s: 8-bit input having cost of a soda d: bit output, processor sets to 1 when total value of deposited coins equals or exceeds cost of a soda as c d Soda dispenser processor tot: 25 tot: 50 as c d Soda dispenser processor

Soda Dispenser: Step 1 Capture High Level State Machine: Declare local register tot Init state: Set d=0, tot=0 Wait state: wait for coin –If see coin, go to Add state Add state: Update total value: tot = tot + a –Remember, a is present coin’s value –Go back to Wait state In Wait state, if tot >= s, go to Disp(ense) state Disp state: Set d=1 (dispense soda) –Return to Init state Wait Add Disp Init d=0 tot=0 c’*(tot<s) d=1 c tot=tot+a

Soda Dispenser: Step 2 Create Datapath: Need tot register Need 8-bit comparator to compare s and tot Need 8-bit adder to perform tot = tot + a Wire the components as needed for above Create control input/outputs, give them names ld clr tot 8-bit < adder sa Datapath tot_ld tot_clr tot_lt_s

Soda Dispenser: Step 3 Connect Datapath to a Controller: Controller’s inputs –External input c (coin detected) –Input from datapath comparator’s output, which we named tot_lt_s Controller’s outputs –External output d (dispense soda) –Outputs to datapath to load and clear the tot register tot_lt_s tot_clr tot_ld ControllerDatapath s c d a 88

Soda Dispenser: Step 4 Derive the Controller’s FSM: Same states and architectures as high- level state machine But set/read datapath control signals for all datapath operations and conditions using the state and input values Inputs::c,tot_lt_s (bit) Outputs:d,tot_ld,tot_clr (bit) Wait Disp Init d=0 tot_clr=1 c’* tot_lt_s’ c’ * tot_lt_s d=1 c tot_ld=1 c d tot_ld tot_clr tot_lt_s Controller Add ld clr tpt 8-bit < adder sa Datapath tot_ld tot_clr tot_lt_s tot_clr tot_ld Controller Datapath s c d a 88

Soda Dispenser: Completing the design: Implement the FSM as a state register and logic

Verilog Modular Coding

Modular Coding So far we have done Boolean algebra and behavioral style of Verilog coding There is a third style in the coding i.e. the modular style Modular means we split the code into more than one files In Quartus II, at certain stage in the project creation, we need to specify the modules involve in the project These modules will then be callable from a main module

Modular Adder module addbit(a, b, ci, sum, co); input a; input b; input ci; output sum; output co; wire a; wire b; wire ci; wire sum; wire co; assign {co,sum} = a + b + ci; endmodule module adder4(result, carry, r1, r2, ci); input [3:0] r1, [3:0] r2, ci; output [3:0] result, carry; wire [3:0] r1, [3:0] r2, ci, [3:0] result, carry; wire c1, c2, c3; addbit u0 (r1[0], r2[0], ci, result[0], c1); addbit u1 (r1[1], r2[1], c1, result[1], c2); addbit u2 (r1[2], r2[2], c2, result[2], c3); addbit u3 (r1[3], r2[3], c3, result[3], carry); endmodule

Modular Adder module addbit(a, b, ci, sum, co); input a; input b; input ci; output sum; output co; wire a; wire b; wire ci; wire sum; wire co; assign {co,sum} = a + b + ci; endmodule module adder4(result, carry, r1, r2, ci); input [3:0] r1, [3:0] r2, ci; output [3:0] result, carry; wire [3:0] r1, [3:0] r2, ci, [3:0] result, carry; wire c1, c2, c3; addbit u0 (.a (r1[0]),.b (r2[0]),.ci (ci),.sum (result[0]),.co (c1)); addbit u1 (.a (r1[1]),.b (r2[1]),.ci (c1),.sum (result[1]),.co (c2)); addbit u2 (.a (r1[2]),.b (r2[2]),.ci (c2),.sum (result[2]),.co (c3)); addbit u3 (.a (r1[3]),.b (r2[3]),.ci (c3),.sum (result[3]),.co (carry)); endmodule