From The Verilog Hardware Description Language, Fifth Edition

2.7 Finite State Machine and Datapath

We've used the language to specify combinational logic and finite state machines. Now we'll move up to specifying register transfer level systems. We'll use a method of specification known as finite state machine and datapath, or FSM-D. Our system will be made up of two parts: a datapath that can do computations and store results in registers, and a finite state machine that will control the datapath.

2.7.1 A Simple Computation

We begin with a simple computation and show how to specify the logic hardware using Verilog. The computation is shown below in a C-like syntax:

     ...     for (x = 0, i = 0; i < = 10; i = i + 1)            x = x + y;     if (x < 0)            y = 0;     else x = 0;     ...

The computation starts off by clearing x and i to 0. Then, while i is less than or equal to 10, x is assigned the sum of x and y, and i is incremented. When the loop is exited, if x is less than zero, y is assigned the value 0. Otherwise, x is assigned the value 0. Although simple, this example will...

Copyright Springer Science+Business Media. Inc. 2002 under license agreement with Books24x7

Products & Services
Spherical Lenses
Spherical lenses, also known as singlets, are transparent optical components consisting of one or more pieces of optical glass with surfaces so curved that they serve to converge or diverge the transmitted rays from an object, thus forming a real or virtual image of that object.  This area includes micro spherical lenses as well.
Web Controllers
Web controllers maintain control functionality over processes with web or sheet rollers.  Control functionality includes maintaining tension of the web, centering on the track, and material feed rates.
Color Meters and Appearance Instruments
Color meters and appearance instruments are used to measure the properties of paints and coatings including color, gloss, haze and transparency.
Finite Element Analysis Software
Finite element analysis software (FEA) uses a numerical technique to model and analyze complex structures by solving boundary-value problems. The structure to be analyzed is divided into points (elements) that make a grid called a mesh.
Computational Fluid Dynamics Software (CFD)
Computational fluid dynamics software (CFD) is used for the calculation of flow parameters in fluids, and for the design and simulation of the behavior of fluidic systems. CFD is also used to simulate fluid mechanics.

Topics of Interest

2.8 Summary on Logic Synthesis We have seen that descriptions used for logic synthesis are very stylized and that some of the constructs are overloaded with semantic meaning for synthesis. In...

Overview Objective: This chapter concludes the study of sequential circuits (initiated in Chapter 13). A formal design procedure, called finite state machine (FSM), is here introduced and extensively...

2.7 EXISTENCE AND UNIQUENESS THEOREM FOR A SYSTEM OF NONLINEAR ODEs In previous sections we considered a single nonlinear ODE. However, the same conclusions also hold for a system of first-order ODEs...

2.9 Exercises 2.1 In section 2.2 on page 37, we state that a synthesis tool is capable, and possibly constrained, to implement the functionality using different gate primitives. Explain why it might...

This chapter begins with an overview of the Mealy and Moore machines, then describes the procedure for creating Mealy and Moore charts in Stateflow, and concludes with illustrative examples for each.