Verilog hdl – II.

Slides:



Advertisements
Similar presentations
The Verilog Hardware Description Language
Advertisements

Supplement on Verilog adder examples
State-machine structure (Mealy)
Synchronous Sequential Logic
Cs 1110 Ch 4-1 Combinational Logic. ° Introduction Logic circuits for digital systems may be: °2°2 combinational sequential OR A combinational circuit.
Verilog Intro: Part 1.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
Analysis of Clocked Sequential Circuits
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Give qualifications of instructors: DAP
Lab 10 : Arithmetic Systems : Adder System Layout: Slide #2 Slide #3 Slide #4 Slide #5 Arithmetic Overflow: 2’s Complement Conversions: 8 Bit Adder/Subtractor.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
ECE 331 – Digital System Design
Discussed in class and on Fridays n FSMs (only synchronous, with asynchronous reset) –Moore –Mealy –Rabin-Scott n Generalized register: –With D FFs, –With.
Give qualifications of instructors: DAP
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
ECE 301 – Digital Electronics
Lecture # 12 University of Tehran
Combinational Logic in Verilog
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
ECE 2372 Modern Digital System Design
ECE/CS 352 Digital Systems Fundamentals
Digital Arithmetic and Arithmetic Circuits
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Chapter 6-1 ALU, Adder and Subtractor
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 5 Step 2 in behavioral modeling. Use of procedures.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
DLD Lecture 26 Finite State Machine Design Procedure.
Discussed in class and on Fridays n FSMs (only synchronous, with asynchronous reset) –Moore –Mealy –Rabin-Scott n Generalized register: –With D FFs, –With.
ARITHMETIC MICRO OPERATIONS
A four function ALU A 00 ADD B MUX SUB 11 Result AND OR
The Verilog Hardware Description Language. GUIDELINES How to write HDL code: How to write HDL code:
Introduction to Combinational Verilog EECS270 rev 9/25/12.
Introduction to ASIC flow and Verilog HDL
Digital System Design using VHDL
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Figure 8.1. The general form of a sequential circuit.
Supplement on Verilog adder examples
Supplement on Verilog Sequential circuit examples: FSM
Lecture 2 Supplement Verilog-01
Homework Reading Machine Projects Labs
Sequential Circuit: Counter
Behavioral Modeling in Verilog
ECE 331 – Digital System Design
HDL Programming Fundamentals
CSE 370 – Winter Sequential Logic-2 - 1
332:437 Lecture 8 Verilog and Finite State Machines
Homework Reading Machine Projects Labs
Supplement on Verilog Sequential circuit examples: FSM
Step 2 in behavioral modeling. Use of procedures.
The Verilog Hardware Description Language
Supplement on Verilog adder examples
The Verilog Hardware Description Language
The Verilog Hardware Description Language
Step 2 in behavioral modeling. Use of procedures.
332:437 Lecture 8 Verilog and Finite State Machines
Introduction to Verilog – Part-2 Procedural Statements
COE 202 Introduction to Verilog
Presentation transcript:

Verilog hdl – II

MoORE MACHINE – revisited A good way to specify Moore is to use separate procedural blocks for Next State Combinational Logic For the state update Sequential Logic Output Combinational Logic

The three states of moore:

Moore DUAL SEQUENCE Overlapping: A Moore type sequence FSM that reads a binary sequence w and sets z = 1if either a 110 or a 101 pattern with overlaps is detected. The state diagram for such a machine is as follows.

VERILOG FOR Moore 1mODEL:

Verilog Code for MOORE 2:

Verilog code for moore 3:

Cannot put z in the always block else it would have been edge sensitive Z is combinational and by putting it in always an extra flop would be required leading to extra clock cycle

Mealy design of the sequence

I/O Declaration is the same as moore

1-bit Full Adder/SUBTRACTOR:

Equations for the above circuit: (W = sub XOR y); 1’s compliment of w (S = X XOR W XOR Cin); Computing the sum using Binary Arithmetic (Cout = X * W + X * Cin + W * Cin); Choosing W chooses if it’s addition or subtraction

1 bit Adder/Subtractor : Structural Description:

4-bit adder subtractor from 1-BIT MODULE, 4 instantiations

vectored signals: Specifying all bits individually is cumbersome. Use vectored signals for a cleaner code. input [3:0] x; (Makes x a 4 bit quantity) x[3] MSB, x[2], x[1], x[0] LSB Input [15:0] x; (Represents vector x with16 bit quantity x [15:8]; [Represents an 8 bit vector with the 8 most MSBs], LSB[7:0] x [7:6]; Represents a 2 bit vector consisting of x[7], x[6]

4-bit vectored Adder/subtractor Behavioral

1 bit module to be instantiated:

Generalizing the size of a large module The ripple carry adders we created have a fixed length. If a 32-bit or a 64- bit adder was needed, we would need as many instantiations of FullAddSub. Desirable from designers perspective to define an AddSub module that n number of bits can be set to any value. In Verilog such a construct exists, can specify n as : parameter n = 15 and then write input [n-1:0] x. This case is for 16 bit vector.

General description of parameterized I bit adder Wk = sub XOR Yk, sub is 1 for subtraction and zero for addition Sk = Xk XOR Wk XOR Ck Ck = Xk * Wk + Xk * Ck + Wk * Ck For k = 0, 1, 2---k-1

The for loop: In Verilog the repetitive structure for the of the ripple carry adder/subtractor can be specified using for procedural statement, (for k=1; k<n; k=k+1) The syntax is same as C/C++ except that increments and decrements have to specified explicitly as k = k+1 and k = k-1, since ++, -- operators doesn’t exist in Verilog. For is a procedural statement and needs to be put inside a procedural block such as always block. Outputs of procedural blocks goes to registers.