SlideShare ist ein Scribd-Unternehmen logo
1 von 25
ENGR. RASHID FARID CHISHTI
LECTURER,DEE, FET, IIUI
CHISHTI@IIU.EDU.PK
WEEK 8
BEHAVIORAL MODELING
MEALY MACHINE
FPGA Based System Design
Sunday, May 17, 2015
1
www.iiu.edu.pk
 With the increasing complexity of digital design, it has become vitally important
to make wise design decisions early in a project.
 Designers need to be able to evaluate the trade-offs of various architectures and
algorithms before they decide on the optimum architecture and algorithm to
implement in hardware.
 Thus, architectural evaluation takes place at an algorithmic level where the
designers do not necessarily think in terms of logic gates or data flow but in terms
of the algorithm they wish to implement in hardware.
 They are more concerned about the behavior of the algorithm and its
performance.
 Only after the high-level architecture and algorithm are finalized, do designers
start focusing on building the digital circuit to implement the algorithm.
 Verilog provides designers the ability to describe design functionality in an
algorithmic manner.
 In other words, the designer describes the behavior of the circuit.
 Thus, behavioral modeling represents the circuit at a very high level of
abstraction.
www.iiu.edu.pk Sunday, May 17, 2015
Behavioral Modeling
2
 There are two structured procedure statements in Verilog: always and initial.
These statements are the two most basic statements in behavioral modeling.
 All other behavioral statements can appear only inside these structured procedure
statements.
 Verilog is a concurrent programming language unlike the C programming
language, which is sequential in nature.
 Activity flows in Verilog run in parallel rather than in sequence.
 Each always and initial statement represents a separate activity flow in Verilog.
 Each activity flow starts at simulation time 0.
 The statements always and initial cannot be nested.
 initial Statement:
 All statements inside an initial statement constitute an initial block.
 An initial block starts at time 0, executes exactly once during a simulation, and
then does not execute again.
 If there are multiple initial blocks, each block starts to execute concurrently at
time 0.
www.iiu.edu.pk Sunday, May 17, 2015
Structured Procedures: initial and always blocks
3
 Each block finishes execution independently of other blocks.
 Multiple behavioral statements must be grouped, typically using the keywords
begin and end.
 If there is only one behavioral statement, grouping is not necessary.
 Following example illustrates the use of the initial statement.
module stimulus;
reg x,y, a,b, m;
initial m = 1'b0; //single statement; does not need to be grouped
initial begin #5 a = 1'b1; // multiple statements; need to be grouped
#25 b = 1'b0;
end
initial begin #10 x = 1'b0; #25 y = 1'b1;
end
initial #50 $finish;
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Structured Procedures: initial and always blocks
4
 In the example, the three initial statements start to execute in parallel at time 0.
 If a delay #<delay> is seen before a statement, the statement is executed <delay>
time units after the current simulation time.
 Thus, the execution sequence of the statements inside the initial blocks will be as
follows. time statement executed
0 m = 1'b0;
5 a = 1'b1;
10 x = 1'b0;
30 b = 1'b0;
35 y = 1'b1;
50 $finish;
 The initial blocks are typically used for initialization, monitoring, waveforms and
other processes that must be executed only once during the entire simulation run.
 The following subsections discussion how to initialize values using alternate
shorthand syntax. The use of such shorthand syntax has the same effect as an
initial block combined with a variable declaration.
www.iiu.edu.pk Sunday, May 17, 2015
Structured Procedures: initial and always blocks
5
Variables can be initialized when they are declared.
// Initial Value Assignment The clock variable is defined first
reg clock; initial clock = 0; // The value of clock is set to 0. Instead of the
// above method, clock variable can be initialized at the time of declaration
// This is allowed only for variables declared at module level.
reg clock = 0;
Combined Port/Data Declaration and Initialization
 The combined port/data declaration can also be combined with an initialization.
// Combined Port/Data Declaration and Variable Initialization
module adder (sum, co, a, b, ci);
output reg [7:0] sum = 0; // Initialize 8 bit output sum
output reg co = 0; // Initialize 1 bit output co
input [7:0] a, b;
input ci;
www.iiu.edu.pk Sunday, May 17, 2015
Structured Procedures: initial and always blocks
6
--
--
endmodule
Combined ANSI C Style Port Declaration and Initialization
 ANSI C style port declaration can also be combined with an initialization.
// Combined ANSI C Port Declaration and Variable Initialization
module adder ( output reg [7:0] sum = 0, // Initialize 8 bit output
output reg co = 0, // Initialize 1 bit output co
input [7:0] a, b,
input ci );
--
--
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Structured Procedures: initial and always blocks
7
always Statement
 All behavioral statements inside an always statement constitute an always block.
 The always statement starts at time 0 and executes the statements in the always
block continuously in a looping fashion.
 This statement is used to model a block of activity that is repeated continuously in
a digital circuit.
 An example is a clock generator module that toggles the clock signal every half
cycle. lock generator is active from time 0 to as long as the circuit is powered on.
// model ing a clock generator in Verilog.
module clock_gen (output reg clock);
initial clock = 1'b0; // Initialize clock at time zero
always #10 clock = ~clock; // Toggle clock every 10 unit sec
initial #1000 $finish;
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Structured Procedures: initial and always blocks
8
 In previous example, the always statement starts at time 0 and executes the
statement clock = ~clock every 10 time units.
 Notice that the initialization of clock has to be done inside a separate initial
statement.
 If we put the initialization of clock inside the always block, clock will be
initialized every time the always is entered.
 Also, the simulation must be halted inside an initial statement.
 If there is no $stop or $finish statement to halt the simulation, the clock generator
will run forever.
www.iiu.edu.pk Sunday, May 17, 2015
Structured Procedures: initial and always blocks
9
 Procedural assignments update values of reg, integer, real, or time variables.
 The value placed on a variable will remain unchanged until another procedural
assignment updates the variable with a different value.
 Two types of procedural assignment statements: blocking and nonblocking
Blocking Assignments: statements are executed in the order they are specified in a
sequential block. The = operator is used to specify blocking assignments.
reg x, y, z; reg [15:0] reg_a, reg_b; integer count; // Blocking Example
// All behavioral statements must be inside an initial or always block
initial begin x = 0; y = 1; z = 1; // Scalar assignments
count = 0; // Assignment to integer variables
reg_a = 16'b0; reg_b = reg_a; // Initialize vectors
reg_a[2] <= #15 1'b1; // Bit select assignment with delay
reg_b[15:13] <= #10 {x, y, z}; // Assign result of concatenation
// to part select of a vector
count <= count + 1; //Assignment to an integer (increment)
end
www.iiu.edu.pk Sunday, May 17, 2015
Procedural Assignments: blocking and nonbloking
10
 In this example, the statements x = 0 through reg_b = reg_a are executed
sequentially at time 0. Then the three nonblocking assignments are processed at
the same simulation time.
 reg_a[2] = 0 is scheduled to execute after 15 units (i.e., time = 15)
 reg_b[15:13] = {x, y, z} is scheduled to execute after 10 time units (time = 10)
 count = count + 1 is scheduled to be executed without any delay (i.e., time = 0)
 Thus, the simulator schedules a nonblocking assignment statement to execute and
continues to the next statement in the block without waiting for the nonblocking
statement to complete execution.
 Typically, nonblocking assignment statements are executed last in the time step in
which they are scheduled, that is, after all the blocking assignments in that time
step are executed.
 In the example above, we mixed blocking and nonblocking assignments to
illustrate their behavior.
 However, it is recommended that blocking and nonblocking assignments not be
mixed in the same always block.
www.iiu.edu.pk Sunday, May 17, 2015
Procedural Assignments: blocking and nonbloking
11
 nonblocking assignments are used as a method to model several concurrent data
transfers that take place after a common event. Consider the following example
where three concurrent data transfers take place at the positive edge of clock.
always @(posedge clock)
begin reg1 <= #1 in1;
reg2 <= @(negedge clock) in2 ^ in3;
reg3 <= #1 reg1; // The old value of reg1
end
 At each positive edge of clock, the following sequence takes place for the
nonblocking assignments.
 A read operation is performed on each right-hand-side variable, in1, in2, in3, and
reg1, at the positive edge of clock. The right-hand-side expressions are evaluated,
and the results are stored internally in the simulator.
 The write operations to the left-hand-side variables are scheduled to be executed
at the time specified by the intra-assignment delay in each assignment, that is,
schedule "write" to reg1 after 1 time unit, to reg2 at the next negative edge of
clock, and to reg3 after 1 time unit.
www.iiu.edu.pk Sunday, May 17, 2015
Application of nonblocking assignments
12
 The write operations are executed at the scheduled time steps. The order in which
the write operations are executed is not important because the internally stored
right-hand-side expression values are used to assign to the left-hand-side values.
 For example, note that reg3 is assigned the old value of reg1 that was stored after
the read operation, even if the write operation wrote a new value to reg1 before
the write operation to reg3 was executed.
 Thus, the final values of reg1, reg2, and reg3 are not dependent on the order in
which the assignments are processed.
 Nonblocking Statements to Eliminate Race Conditions
// Illustration 1: Two concurrent always blocks with blocking statements
always @(posedge clock) a = b;
always @(posedge clock) b = a;
// Illustration 2: Two concurrent always blocks with nonblocking statements
always @(posedge clock) a <= b;
always @(posedge clock) b <= a;
www.iiu.edu.pk Sunday, May 17, 2015
Application of nonblocking assignments
13
 In previous example; there is a race condition when blocking statements are used.
 Either a = b would be executed before b = a, or vice versa, depending on the
simulator implementation. Thus, values of registers a and b will not be swapped.
 Instead, both registers will get the same value (previous value of a or b), based on
the Verilog simulator implementation.
 However, nonblocking statements used in Illustration 2 eliminate the race
condition. At the positive edge of clock, the values of all right-hand-side variables
are "read," and the right-hand-side expressions are evaluated and stored in
temporary variables.
 During the write operation, the values stored in the temporary variables are
assigned to the left-hand-side variables.
 Separating the read and write operations ensures that the values of registers a and
b are swapped correctly, regardless of the order in which the write operations are
performed.
 Next example shows how nonblocking assignments could be emulated using
blocking assignments.
www.iiu.edu.pk Sunday, May 17, 2015
Application of nonblocking assignments
14
// Emulate the behavior of nonblocking assignments by using temporary variables
// and blocking assignments
always @(posedge clock)
begin // Read operation. store values of right-hand-side
temp_a = a; // expressions in temporary variables
temp_b = b;
a = temp_b; // Write operation Assign values of temporary variables
b = temp_a; // to left-hand-side variables
end
 For digital design, use of nonblocking assignments is highly recommended in
places where concurrent data transfers take place after a common event.
 In such cases, blocking assignments can potentially cause race conditions because
the final result depends on the order in which the assignments are evaluated.
 Sequential logic and latches – use non blocking assignments
 Combinational Logic in an always block – use blocking assignments
www.iiu.edu.pk Sunday, May 17, 2015
Application of nonblocking assignments
15
// Behavioral description of 2-to-1-line multiplexer// Behavioral description of 2-to-1-line multiplexer
modulemodule mux2x1 (i0, i1, s, y);mux2x1 (i0, i1, s, y);
inputinput i0, i1, S;i0, i1, S; outputoutput y;y; regreg y;y;
alwaysalways @ (S@ (S oror i0i0 oror i1)i1)
ifif (S == 1)(S == 1) y = i1;y = i1;
elseelse y = i0;y = i0;
endmoduleendmodule
modulemodule mux4x1 (i0 , i1 , i2 , i3 , S , F );mux4x1 (i0 , i1 , i2 , i3 , S , F ); // 4-to-1- line multiplexer// 4-to-1- line multiplexer
inputinput i0,i1,i2,i3;i0,i1,i2,i3; inputinput [1:0] S;[1:0] S; outputoutput F;F; regreg F;F;
alwaysalways @ (i0@ (i0 oror i1i1 oror i2i2 oror i3i3 oror S)S)
casecase (S)(S)
2'b00: F = i0;2'b00: F = i0; 2'b01: F = i1;2'b01: F = i1;
2'b10: F = i2;2'b10: F = i2; 2'b11: F = i3;2'b11: F = i3;
endcaseendcase
endmoduleendmodule
www.iiu.edu.pk Sunday, May 17, 2015
Examples
16
www.iiu.edu.pk Sunday, May 17, 2015
State Tables
17
Inputs Next
Output
S R Q(t+1)
0 0 Q(t)
0 1 0
1 0 1
1 1 Invalid
Inputs Next
Output
J K Q(t+1)
0 0 Q(t)
0 1 0
1 0 1
1 1 Q(t)
Inputs Next
Output
D Q(t+1)
0 0
1 1
Inputs Next
Output
T Q(t+1)
0 Q(t)
1 Q(t)
SR Flip Flop JK Flip Flop
D Flip Flop T Flip Flop
www.iiu.edu.pk Sunday, May 17, 2015
Excitation Tables
18
Output Input
Q(t) Q(t+1) S R
0 0 0 X
0 1 1 0
1 0 0 1
1 1 X 0
Output Input
Q(t) Q(t+1) J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
Output Input
Q(t) Q(t+1) D
0 0 0
0 1 1
1 0 0
1 1 1
SR Flip Flop JK Flip Flop
D Flip Flop T Flip Flop
Output Input
Q(t) Q(t+1) T
0 0 0
0 1 1
1 0 1
1 1 0
www.iiu.edu.pk Sunday, May 17, 2015
Examples
19
modulemodule D_latch (Q, D , En);D_latch (Q, D , En); // Description of D latch// Description of D latch
outputoutput Q;Q; inputinput D, En;D, En; regreg Q;Q;
alwaysalways @ (En@ (En oror D)D)
ifif ( En ) Q <= D;( En ) Q <= D; // Same as: if ( En == 1 )// Same as: if ( En == 1 )
endmoduleendmodule
modulemodule D_FF (Q, D, CLK);D_FF (Q, D, CLK); // Description of D Flip Flop// Description of D Flip Flop
outputoutput Q;Q; inputinput D,CLK;D,CLK; regreg Q;Q;
alwaysalways @ (@ (posedgeposedge CLK)CLK)
Q = D;Q = D;
endmoduleendmodule
modulemodule DFF (Q, D, CLK, RST);DFF (Q, D, CLK, RST); // D flip-flop with asynchronous reset.// D flip-flop with asynchronous reset.
outputoutput Q;Q; inputinput D, CLK, RST;D, CLK, RST; regreg Q;Q;
alwaysalways @(@(posedgeposedge CLKCLK oror negedgenegedge RST)RST)
ifif (~RST)(~RST)
Q = 1'b0;Q = 1'b0; // Same as: if (RST == 0)// Same as: if (RST == 0)
elseelse
Q = D;Q = D;
endmoduleendmodule
www.iiu.edu.pk Sunday, May 17, 2015
Examples
20
modulemodule TFF (Q, T, CLK, RST);TFF (Q, T, CLK, RST); // T flip-flop from D flip-flop// T flip-flop from D flip-flop
outputoutput Q;Q; inputinput T,CLK,RST;T,CLK,RST; wirewire DT;DT;
assignassign DT = Q ^ T ;DT = Q ^ T ;
DFF TF1 (Q, DT, CLK, RST);DFF TF1 (Q, DT, CLK, RST); // Instantiate the D flip-flop// Instantiate the D flip-flop
endmoduleendmodule
modulemodule JKFF (Q, J, K, CLK, RST);JKFF (Q, J, K, CLK, RST); // JK flip-flop from D flip-flop// JK flip-flop from D flip-flop
outputoutput Q;Q; inputinput J, K, CLK, RST;J, K, CLK, RST; wirewire JK;JK;
assignassign JK = (J & ~Q) | (~K & Q);JK = (J & ~Q) | (~K & Q);
DFF JK1 (Q, JK, CLK, RST);DFF JK1 (Q, JK, CLK, RST);
endmoduleendmodule
modulemodule JK_FF (J, K, CLK, Q, Qnot);JK_FF (J, K, CLK, Q, Qnot);
outputoutput Q, Qnot;Q, Qnot; inputinput J, K, CLK;J, K, CLK; regreg Q;Q;
assignassign Qnot = ~ Q ;Qnot = ~ Q ;
alwaysalways @ (@ (posedgeposedge CLK)CLK)
casecase ({J,K})({J,K})
2'b00: Q = Q;2'b00: Q = Q; 2'b01: Q = 1'b0;2'b01: Q = 1'b0;
2'b10: Q = 1'b1;2'b10: Q = 1'b1; 2'b11: Q = ~ Q;2'b11: Q = ~ Q;
endcaseendcase
endmoduleendmodule
www.iiu.edu.pk Sunday, May 17, 2015
Mealy
Machine
21
AMealymachineisafinite-statemachinewhose
outputvaluesaredeterminedbothbyitscurrent
stateandthecurrentinputs.(Thisisincontrastto
aMooremachine,whoseoutputvaluesare
determinedsolelybyitscurrentstate.)
// Structural description of sequential circuit
module DFF (Q, D, CLK, RST); // D flip-flop with asynchronous reset.
output Q; input D, CLK, RST; reg Q;
always @(posedge CLK or negedge RST)
if (~RST)
Q = 1'b0; // Same as: if (RST == 0)
else
Q = D;
endmodule
module Mealy_Circuit (x , y, AB, CLK, RST);
input x, CLK, RST; output y; output [1:0] AB;
wire Da, Db,A,B;
//Flip-flip input equations
assign Da = (A&x) | (B&x) ; //
assign Db = ~A & x ; //
assign y = ~x & (A|B) ; //
assign AB = {A , B} ;
DFF Dffa (A, Da, CLK, RST);
DFF Dffb (B, Db, CLK, RST);
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Structured Programming
22
modulemodule test_Mealy_Circuit;test_Mealy_Circuit;
regreg x, CLK, RST;x, CLK, RST; wirewire Y;Y; wirewire [1:0] ABC ;[1:0] ABC ;
Mealy_Circuit MC1 (x ,Y , ABC, CLK, RST);Mealy_Circuit MC1 (x ,Y , ABC, CLK, RST);
initialinitial
beginbegin CLK = 0;CLK = 0;
repeatrepeat (30) #5 CLK = ~CLK;(30) #5 CLK = ~CLK;
endend
initialinitial
beginbegin RST = 1; x = 0;RST = 1; x = 0;
#10 RST = 0;#10 RST = 0;
#10 RST = 1;#10 RST = 1;
repeatrepeat (6) #30 x = ~x;(6) #30 x = ~x;
endend
endmoduleendmodule
www.iiu.edu.pk Sunday, May 17, 2015
Examples
23
Input Present State
x A B
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
www.iiu.edu.pk Sunday, May 17, 201524
Flip Flop Inputs
DA DB
0 0
0 0
0 0
0 0
0 1
1 1
1 0
1 0
Next State
A+
B+
0 0
0 0
0 0
0 0
0 1
1 1
1 0
1 0
Output
y
0
1
1
1
0
0
0
0
0000 1010
0101 1111
0/0
0/1
0/1
0/1
1/0
1/0
1/0
1/0
input
output
State Table
State Diagram
Input Next
Output
D Q(t+1)
0 0
1 1
module Mealy_Model ( x, y, CLK, RST );
input x,CLK,RST; output y; reg y; reg [1:0] Prstate, Nxtstate;
parameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11;
always @ (posedge CLK or negedge RST)
if (~RST) Prstate = S0; // Initialize to state S0
else Prstate = Nxtstate; // Clock operations
always @ (Prstate or x) // Determine next state
case (Prstate)
S0: if (x) Nxtstate = S1; else Nxtstate = S0;
S1: if (x) Nxtstate = S3; else Nxtstate = S0;
S2: if (~x)Nxtstate = S0; else Nxtstate = S2;
S3: if (x) Nxtstate = S2; else Nxtstate = S0;
endcase
always @ (Prstate or x) // Evaluate output
case (Prstate) S0: y = 0;
S1: if (x) y = 1'b0; else y = 1'b1;
S2: if (x) y = 1'b0; else y = 1'b1;
S3: if (x) y = 1'b0; else y = 1'b1;
endcase
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Mealy Machine: Behavioral Modeling
25

Weitere ähnliche Inhalte

Was ist angesagt?

Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6Andrey Karpov
 
Checking the code of Valgrind dynamic analyzer by a static analyzer
Checking the code of Valgrind dynamic analyzer by a static analyzerChecking the code of Valgrind dynamic analyzer by a static analyzer
Checking the code of Valgrind dynamic analyzer by a static analyzerPVS-Studio
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++Reddhi Basu
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014Béo Tú
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control StructureSokngim Sa
 
A fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBoxA fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBoxPVS-Studio
 
Tesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition SoftwareTesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition SoftwareAndrey Karpov
 
Checking Clang 11 with PVS-Studio
Checking Clang 11 with PVS-StudioChecking Clang 11 with PVS-Studio
Checking Clang 11 with PVS-StudioAndrey Karpov
 
Accord.Net: Looking for a Bug that Could Help Machines Conquer Humankind
Accord.Net: Looking for a Bug that Could Help Machines Conquer HumankindAccord.Net: Looking for a Bug that Could Help Machines Conquer Humankind
Accord.Net: Looking for a Bug that Could Help Machines Conquer HumankindPVS-Studio
 
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...Jay Baxi
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesMalik Tauqir Hasan
 
9. statements (conditional statements)
9. statements (conditional statements)9. statements (conditional statements)
9. statements (conditional statements)Way2itech
 
Python and Ruby implementations compared by the error density
Python and Ruby implementations compared by the error densityPython and Ruby implementations compared by the error density
Python and Ruby implementations compared by the error densityPVS-Studio
 

Was ist angesagt? (19)

Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6
 
Checking the code of Valgrind dynamic analyzer by a static analyzer
Checking the code of Valgrind dynamic analyzer by a static analyzerChecking the code of Valgrind dynamic analyzer by a static analyzer
Checking the code of Valgrind dynamic analyzer by a static analyzer
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
 
Checking VirtualDub
Checking VirtualDubChecking VirtualDub
Checking VirtualDub
 
STORAGE CLASSES
STORAGE CLASSESSTORAGE CLASSES
STORAGE CLASSES
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
A fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBoxA fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBox
 
Tesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition SoftwareTesseract. Recognizing Errors in Recognition Software
Tesseract. Recognizing Errors in Recognition Software
 
Checking Clang 11 with PVS-Studio
Checking Clang 11 with PVS-StudioChecking Clang 11 with PVS-Studio
Checking Clang 11 with PVS-Studio
 
Accord.Net: Looking for a Bug that Could Help Machines Conquer Humankind
Accord.Net: Looking for a Bug that Could Help Machines Conquer HumankindAccord.Net: Looking for a Bug that Could Help Machines Conquer Humankind
Accord.Net: Looking for a Bug that Could Help Machines Conquer Humankind
 
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
 
9. statements (conditional statements)
9. statements (conditional statements)9. statements (conditional statements)
9. statements (conditional statements)
 
Exceptions in c++
Exceptions in c++Exceptions in c++
Exceptions in c++
 
Aptitute question papers in c
Aptitute question papers in cAptitute question papers in c
Aptitute question papers in c
 
2nd presantation
2nd presantation2nd presantation
2nd presantation
 
Python and Ruby implementations compared by the error density
Python and Ruby implementations compared by the error densityPython and Ruby implementations compared by the error density
Python and Ruby implementations compared by the error density
 
Java script best practices v4
Java script best practices v4Java script best practices v4
Java script best practices v4
 

Andere mochten auch

Andere mochten auch (11)

The BCD to excess-3 converter
The BCD to excess-3 converterThe BCD to excess-3 converter
The BCD to excess-3 converter
 
Ethertnet data transfer.ppt
Ethertnet data transfer.pptEthertnet data transfer.ppt
Ethertnet data transfer.ppt
 
STLD-Combinational logic design
STLD-Combinational  logic design STLD-Combinational  logic design
STLD-Combinational logic design
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
 
Verilog
VerilogVerilog
Verilog
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
Meley & moore
Meley & mooreMeley & moore
Meley & moore
 
Mealy state machine
Mealy state machineMealy state machine
Mealy state machine
 
Mealy moore machine model
Mealy moore machine modelMealy moore machine model
Mealy moore machine model
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machines
 

Ähnlich wie Fpga 08-behavioral-modeling-mealy-machine

VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments Dr.YNM
 
Operators, control statements represented in java
Operators, control statements  represented in javaOperators, control statements  represented in java
Operators, control statements represented in javaTharuniDiddekunta
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderMalik Tauqir Hasan
 
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...WebStackAcademy
 
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docxCMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docxmonicafrancis71118
 
FPGA Coding Guidelines
FPGA Coding GuidelinesFPGA Coding Guidelines
FPGA Coding GuidelinesChethan Kumar
 
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingDigital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingIndira Priyadarshini
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.gerrell
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping newaprilyyy
 
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLSeminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLNaseer LoneRider
 
behavioralmodeling and Timing Control - P04.pptx
behavioralmodeling and Timing Control - P04.pptxbehavioralmodeling and Timing Control - P04.pptx
behavioralmodeling and Timing Control - P04.pptxMPrasannakumarM
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and loopingaprilyyy
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)Nagarajan
 
ASIC SoC Verification Challenges and Methodologies
ASIC SoC Verification Challenges and MethodologiesASIC SoC Verification Challenges and Methodologies
ASIC SoC Verification Challenges and MethodologiesDr. Shivananda Koteshwar
 

Ähnlich wie Fpga 08-behavioral-modeling-mealy-machine (20)

VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments
 
Operators, control statements represented in java
Operators, control statements  represented in javaOperators, control statements  represented in java
Operators, control statements represented in java
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
 
Switch case and looping jam
Switch case and looping jamSwitch case and looping jam
Switch case and looping jam
 
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
 
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docxCMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
 
FPGA Coding Guidelines
FPGA Coding GuidelinesFPGA Coding Guidelines
FPGA Coding Guidelines
 
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingDigital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural Modeling
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
 
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLSeminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
 
My final requirement
My final requirementMy final requirement
My final requirement
 
neiljaysonching
neiljaysonchingneiljaysonching
neiljaysonching
 
behavioralmodeling and Timing Control - P04.pptx
behavioralmodeling and Timing Control - P04.pptxbehavioralmodeling and Timing Control - P04.pptx
behavioralmodeling and Timing Control - P04.pptx
 
Operating System
Operating SystemOperating System
Operating System
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)
 
Coding style for good synthesis
Coding style for good synthesisCoding style for good synthesis
Coding style for good synthesis
 
ASIC SoC Verification Challenges and Methodologies
ASIC SoC Verification Challenges and MethodologiesASIC SoC Verification Challenges and Methodologies
ASIC SoC Verification Challenges and Methodologies
 

Mehr von Malik Tauqir Hasan

Fpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filterFpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filterMalik Tauqir Hasan
 
Fpga 10-bcd-to-excess-3-converter-manchester-encoding
Fpga 10-bcd-to-excess-3-converter-manchester-encodingFpga 10-bcd-to-excess-3-converter-manchester-encoding
Fpga 10-bcd-to-excess-3-converter-manchester-encodingMalik Tauqir Hasan
 
Fpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machineFpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machineMalik Tauqir Hasan
 

Mehr von Malik Tauqir Hasan (10)

Fpga 13-task-and-functions
Fpga 13-task-and-functionsFpga 13-task-and-functions
Fpga 13-task-and-functions
 
Fpga 12-event-control
Fpga 12-event-controlFpga 12-event-control
Fpga 12-event-control
 
Fpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filterFpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filter
 
Fpga 10-bcd-to-excess-3-converter-manchester-encoding
Fpga 10-bcd-to-excess-3-converter-manchester-encodingFpga 10-bcd-to-excess-3-converter-manchester-encoding
Fpga 10-bcd-to-excess-3-converter-manchester-encoding
 
Fpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machineFpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machine
 
Fpga 05-verilog-programming
Fpga 05-verilog-programmingFpga 05-verilog-programming
Fpga 05-verilog-programming
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
 
Fpga 03-cpld-and-fpga
Fpga 03-cpld-and-fpgaFpga 03-cpld-and-fpga
Fpga 03-cpld-and-fpga
 
Fpga 02-memory-and-pl ds
Fpga 02-memory-and-pl dsFpga 02-memory-and-pl ds
Fpga 02-memory-and-pl ds
 
Fpga 01-digital-logic-design
Fpga 01-digital-logic-designFpga 01-digital-logic-design
Fpga 01-digital-logic-design
 

Kürzlich hochgeladen

NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...Amil Baba Dawood bangali
 
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...amilabibi1
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland CultureChloeMeadows1
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一C SSS
 
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作ss846v0c
 
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesVip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Servicesnajka9823
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degreeyuu sss
 
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRdollysharma2066
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)861c7ca49a02
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...Amil Baba Dawood bangali
 
the cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxthe cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxLeaMaePahinagGarciaV
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...Amil baba
 
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作f3774p8b
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程1k98h0e1
 
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一diploma 1
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作f3774p8b
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...ttt fff
 

Kürzlich hochgeladen (20)

NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
 
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland Culture
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
 
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
 
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
young call girls in  Khanpur,🔝 9953056974 🔝 escort Serviceyoung call girls in  Khanpur,🔝 9953056974 🔝 escort Service
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
 
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesVip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
 
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
 
the cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxthe cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptx
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
 
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程
 
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国旧金山艺术学院毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
 
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Serviceyoung call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
 

Fpga 08-behavioral-modeling-mealy-machine

  • 1. ENGR. RASHID FARID CHISHTI LECTURER,DEE, FET, IIUI CHISHTI@IIU.EDU.PK WEEK 8 BEHAVIORAL MODELING MEALY MACHINE FPGA Based System Design Sunday, May 17, 2015 1 www.iiu.edu.pk
  • 2.  With the increasing complexity of digital design, it has become vitally important to make wise design decisions early in a project.  Designers need to be able to evaluate the trade-offs of various architectures and algorithms before they decide on the optimum architecture and algorithm to implement in hardware.  Thus, architectural evaluation takes place at an algorithmic level where the designers do not necessarily think in terms of logic gates or data flow but in terms of the algorithm they wish to implement in hardware.  They are more concerned about the behavior of the algorithm and its performance.  Only after the high-level architecture and algorithm are finalized, do designers start focusing on building the digital circuit to implement the algorithm.  Verilog provides designers the ability to describe design functionality in an algorithmic manner.  In other words, the designer describes the behavior of the circuit.  Thus, behavioral modeling represents the circuit at a very high level of abstraction. www.iiu.edu.pk Sunday, May 17, 2015 Behavioral Modeling 2
  • 3.  There are two structured procedure statements in Verilog: always and initial. These statements are the two most basic statements in behavioral modeling.  All other behavioral statements can appear only inside these structured procedure statements.  Verilog is a concurrent programming language unlike the C programming language, which is sequential in nature.  Activity flows in Verilog run in parallel rather than in sequence.  Each always and initial statement represents a separate activity flow in Verilog.  Each activity flow starts at simulation time 0.  The statements always and initial cannot be nested.  initial Statement:  All statements inside an initial statement constitute an initial block.  An initial block starts at time 0, executes exactly once during a simulation, and then does not execute again.  If there are multiple initial blocks, each block starts to execute concurrently at time 0. www.iiu.edu.pk Sunday, May 17, 2015 Structured Procedures: initial and always blocks 3
  • 4.  Each block finishes execution independently of other blocks.  Multiple behavioral statements must be grouped, typically using the keywords begin and end.  If there is only one behavioral statement, grouping is not necessary.  Following example illustrates the use of the initial statement. module stimulus; reg x,y, a,b, m; initial m = 1'b0; //single statement; does not need to be grouped initial begin #5 a = 1'b1; // multiple statements; need to be grouped #25 b = 1'b0; end initial begin #10 x = 1'b0; #25 y = 1'b1; end initial #50 $finish; endmodule www.iiu.edu.pk Sunday, May 17, 2015 Structured Procedures: initial and always blocks 4
  • 5.  In the example, the three initial statements start to execute in parallel at time 0.  If a delay #<delay> is seen before a statement, the statement is executed <delay> time units after the current simulation time.  Thus, the execution sequence of the statements inside the initial blocks will be as follows. time statement executed 0 m = 1'b0; 5 a = 1'b1; 10 x = 1'b0; 30 b = 1'b0; 35 y = 1'b1; 50 $finish;  The initial blocks are typically used for initialization, monitoring, waveforms and other processes that must be executed only once during the entire simulation run.  The following subsections discussion how to initialize values using alternate shorthand syntax. The use of such shorthand syntax has the same effect as an initial block combined with a variable declaration. www.iiu.edu.pk Sunday, May 17, 2015 Structured Procedures: initial and always blocks 5
  • 6. Variables can be initialized when they are declared. // Initial Value Assignment The clock variable is defined first reg clock; initial clock = 0; // The value of clock is set to 0. Instead of the // above method, clock variable can be initialized at the time of declaration // This is allowed only for variables declared at module level. reg clock = 0; Combined Port/Data Declaration and Initialization  The combined port/data declaration can also be combined with an initialization. // Combined Port/Data Declaration and Variable Initialization module adder (sum, co, a, b, ci); output reg [7:0] sum = 0; // Initialize 8 bit output sum output reg co = 0; // Initialize 1 bit output co input [7:0] a, b; input ci; www.iiu.edu.pk Sunday, May 17, 2015 Structured Procedures: initial and always blocks 6
  • 7. -- -- endmodule Combined ANSI C Style Port Declaration and Initialization  ANSI C style port declaration can also be combined with an initialization. // Combined ANSI C Port Declaration and Variable Initialization module adder ( output reg [7:0] sum = 0, // Initialize 8 bit output output reg co = 0, // Initialize 1 bit output co input [7:0] a, b, input ci ); -- -- endmodule www.iiu.edu.pk Sunday, May 17, 2015 Structured Procedures: initial and always blocks 7
  • 8. always Statement  All behavioral statements inside an always statement constitute an always block.  The always statement starts at time 0 and executes the statements in the always block continuously in a looping fashion.  This statement is used to model a block of activity that is repeated continuously in a digital circuit.  An example is a clock generator module that toggles the clock signal every half cycle. lock generator is active from time 0 to as long as the circuit is powered on. // model ing a clock generator in Verilog. module clock_gen (output reg clock); initial clock = 1'b0; // Initialize clock at time zero always #10 clock = ~clock; // Toggle clock every 10 unit sec initial #1000 $finish; endmodule www.iiu.edu.pk Sunday, May 17, 2015 Structured Procedures: initial and always blocks 8
  • 9.  In previous example, the always statement starts at time 0 and executes the statement clock = ~clock every 10 time units.  Notice that the initialization of clock has to be done inside a separate initial statement.  If we put the initialization of clock inside the always block, clock will be initialized every time the always is entered.  Also, the simulation must be halted inside an initial statement.  If there is no $stop or $finish statement to halt the simulation, the clock generator will run forever. www.iiu.edu.pk Sunday, May 17, 2015 Structured Procedures: initial and always blocks 9
  • 10.  Procedural assignments update values of reg, integer, real, or time variables.  The value placed on a variable will remain unchanged until another procedural assignment updates the variable with a different value.  Two types of procedural assignment statements: blocking and nonblocking Blocking Assignments: statements are executed in the order they are specified in a sequential block. The = operator is used to specify blocking assignments. reg x, y, z; reg [15:0] reg_a, reg_b; integer count; // Blocking Example // All behavioral statements must be inside an initial or always block initial begin x = 0; y = 1; z = 1; // Scalar assignments count = 0; // Assignment to integer variables reg_a = 16'b0; reg_b = reg_a; // Initialize vectors reg_a[2] <= #15 1'b1; // Bit select assignment with delay reg_b[15:13] <= #10 {x, y, z}; // Assign result of concatenation // to part select of a vector count <= count + 1; //Assignment to an integer (increment) end www.iiu.edu.pk Sunday, May 17, 2015 Procedural Assignments: blocking and nonbloking 10
  • 11.  In this example, the statements x = 0 through reg_b = reg_a are executed sequentially at time 0. Then the three nonblocking assignments are processed at the same simulation time.  reg_a[2] = 0 is scheduled to execute after 15 units (i.e., time = 15)  reg_b[15:13] = {x, y, z} is scheduled to execute after 10 time units (time = 10)  count = count + 1 is scheduled to be executed without any delay (i.e., time = 0)  Thus, the simulator schedules a nonblocking assignment statement to execute and continues to the next statement in the block without waiting for the nonblocking statement to complete execution.  Typically, nonblocking assignment statements are executed last in the time step in which they are scheduled, that is, after all the blocking assignments in that time step are executed.  In the example above, we mixed blocking and nonblocking assignments to illustrate their behavior.  However, it is recommended that blocking and nonblocking assignments not be mixed in the same always block. www.iiu.edu.pk Sunday, May 17, 2015 Procedural Assignments: blocking and nonbloking 11
  • 12.  nonblocking assignments are used as a method to model several concurrent data transfers that take place after a common event. Consider the following example where three concurrent data transfers take place at the positive edge of clock. always @(posedge clock) begin reg1 <= #1 in1; reg2 <= @(negedge clock) in2 ^ in3; reg3 <= #1 reg1; // The old value of reg1 end  At each positive edge of clock, the following sequence takes place for the nonblocking assignments.  A read operation is performed on each right-hand-side variable, in1, in2, in3, and reg1, at the positive edge of clock. The right-hand-side expressions are evaluated, and the results are stored internally in the simulator.  The write operations to the left-hand-side variables are scheduled to be executed at the time specified by the intra-assignment delay in each assignment, that is, schedule "write" to reg1 after 1 time unit, to reg2 at the next negative edge of clock, and to reg3 after 1 time unit. www.iiu.edu.pk Sunday, May 17, 2015 Application of nonblocking assignments 12
  • 13.  The write operations are executed at the scheduled time steps. The order in which the write operations are executed is not important because the internally stored right-hand-side expression values are used to assign to the left-hand-side values.  For example, note that reg3 is assigned the old value of reg1 that was stored after the read operation, even if the write operation wrote a new value to reg1 before the write operation to reg3 was executed.  Thus, the final values of reg1, reg2, and reg3 are not dependent on the order in which the assignments are processed.  Nonblocking Statements to Eliminate Race Conditions // Illustration 1: Two concurrent always blocks with blocking statements always @(posedge clock) a = b; always @(posedge clock) b = a; // Illustration 2: Two concurrent always blocks with nonblocking statements always @(posedge clock) a <= b; always @(posedge clock) b <= a; www.iiu.edu.pk Sunday, May 17, 2015 Application of nonblocking assignments 13
  • 14.  In previous example; there is a race condition when blocking statements are used.  Either a = b would be executed before b = a, or vice versa, depending on the simulator implementation. Thus, values of registers a and b will not be swapped.  Instead, both registers will get the same value (previous value of a or b), based on the Verilog simulator implementation.  However, nonblocking statements used in Illustration 2 eliminate the race condition. At the positive edge of clock, the values of all right-hand-side variables are "read," and the right-hand-side expressions are evaluated and stored in temporary variables.  During the write operation, the values stored in the temporary variables are assigned to the left-hand-side variables.  Separating the read and write operations ensures that the values of registers a and b are swapped correctly, regardless of the order in which the write operations are performed.  Next example shows how nonblocking assignments could be emulated using blocking assignments. www.iiu.edu.pk Sunday, May 17, 2015 Application of nonblocking assignments 14
  • 15. // Emulate the behavior of nonblocking assignments by using temporary variables // and blocking assignments always @(posedge clock) begin // Read operation. store values of right-hand-side temp_a = a; // expressions in temporary variables temp_b = b; a = temp_b; // Write operation Assign values of temporary variables b = temp_a; // to left-hand-side variables end  For digital design, use of nonblocking assignments is highly recommended in places where concurrent data transfers take place after a common event.  In such cases, blocking assignments can potentially cause race conditions because the final result depends on the order in which the assignments are evaluated.  Sequential logic and latches – use non blocking assignments  Combinational Logic in an always block – use blocking assignments www.iiu.edu.pk Sunday, May 17, 2015 Application of nonblocking assignments 15
  • 16. // Behavioral description of 2-to-1-line multiplexer// Behavioral description of 2-to-1-line multiplexer modulemodule mux2x1 (i0, i1, s, y);mux2x1 (i0, i1, s, y); inputinput i0, i1, S;i0, i1, S; outputoutput y;y; regreg y;y; alwaysalways @ (S@ (S oror i0i0 oror i1)i1) ifif (S == 1)(S == 1) y = i1;y = i1; elseelse y = i0;y = i0; endmoduleendmodule modulemodule mux4x1 (i0 , i1 , i2 , i3 , S , F );mux4x1 (i0 , i1 , i2 , i3 , S , F ); // 4-to-1- line multiplexer// 4-to-1- line multiplexer inputinput i0,i1,i2,i3;i0,i1,i2,i3; inputinput [1:0] S;[1:0] S; outputoutput F;F; regreg F;F; alwaysalways @ (i0@ (i0 oror i1i1 oror i2i2 oror i3i3 oror S)S) casecase (S)(S) 2'b00: F = i0;2'b00: F = i0; 2'b01: F = i1;2'b01: F = i1; 2'b10: F = i2;2'b10: F = i2; 2'b11: F = i3;2'b11: F = i3; endcaseendcase endmoduleendmodule www.iiu.edu.pk Sunday, May 17, 2015 Examples 16
  • 17. www.iiu.edu.pk Sunday, May 17, 2015 State Tables 17 Inputs Next Output S R Q(t+1) 0 0 Q(t) 0 1 0 1 0 1 1 1 Invalid Inputs Next Output J K Q(t+1) 0 0 Q(t) 0 1 0 1 0 1 1 1 Q(t) Inputs Next Output D Q(t+1) 0 0 1 1 Inputs Next Output T Q(t+1) 0 Q(t) 1 Q(t) SR Flip Flop JK Flip Flop D Flip Flop T Flip Flop
  • 18. www.iiu.edu.pk Sunday, May 17, 2015 Excitation Tables 18 Output Input Q(t) Q(t+1) S R 0 0 0 X 0 1 1 0 1 0 0 1 1 1 X 0 Output Input Q(t) Q(t+1) J K 0 0 0 X 0 1 1 X 1 0 X 1 1 1 X 0 Output Input Q(t) Q(t+1) D 0 0 0 0 1 1 1 0 0 1 1 1 SR Flip Flop JK Flip Flop D Flip Flop T Flip Flop Output Input Q(t) Q(t+1) T 0 0 0 0 1 1 1 0 1 1 1 0
  • 19. www.iiu.edu.pk Sunday, May 17, 2015 Examples 19 modulemodule D_latch (Q, D , En);D_latch (Q, D , En); // Description of D latch// Description of D latch outputoutput Q;Q; inputinput D, En;D, En; regreg Q;Q; alwaysalways @ (En@ (En oror D)D) ifif ( En ) Q <= D;( En ) Q <= D; // Same as: if ( En == 1 )// Same as: if ( En == 1 ) endmoduleendmodule modulemodule D_FF (Q, D, CLK);D_FF (Q, D, CLK); // Description of D Flip Flop// Description of D Flip Flop outputoutput Q;Q; inputinput D,CLK;D,CLK; regreg Q;Q; alwaysalways @ (@ (posedgeposedge CLK)CLK) Q = D;Q = D; endmoduleendmodule modulemodule DFF (Q, D, CLK, RST);DFF (Q, D, CLK, RST); // D flip-flop with asynchronous reset.// D flip-flop with asynchronous reset. outputoutput Q;Q; inputinput D, CLK, RST;D, CLK, RST; regreg Q;Q; alwaysalways @(@(posedgeposedge CLKCLK oror negedgenegedge RST)RST) ifif (~RST)(~RST) Q = 1'b0;Q = 1'b0; // Same as: if (RST == 0)// Same as: if (RST == 0) elseelse Q = D;Q = D; endmoduleendmodule
  • 20. www.iiu.edu.pk Sunday, May 17, 2015 Examples 20 modulemodule TFF (Q, T, CLK, RST);TFF (Q, T, CLK, RST); // T flip-flop from D flip-flop// T flip-flop from D flip-flop outputoutput Q;Q; inputinput T,CLK,RST;T,CLK,RST; wirewire DT;DT; assignassign DT = Q ^ T ;DT = Q ^ T ; DFF TF1 (Q, DT, CLK, RST);DFF TF1 (Q, DT, CLK, RST); // Instantiate the D flip-flop// Instantiate the D flip-flop endmoduleendmodule modulemodule JKFF (Q, J, K, CLK, RST);JKFF (Q, J, K, CLK, RST); // JK flip-flop from D flip-flop// JK flip-flop from D flip-flop outputoutput Q;Q; inputinput J, K, CLK, RST;J, K, CLK, RST; wirewire JK;JK; assignassign JK = (J & ~Q) | (~K & Q);JK = (J & ~Q) | (~K & Q); DFF JK1 (Q, JK, CLK, RST);DFF JK1 (Q, JK, CLK, RST); endmoduleendmodule modulemodule JK_FF (J, K, CLK, Q, Qnot);JK_FF (J, K, CLK, Q, Qnot); outputoutput Q, Qnot;Q, Qnot; inputinput J, K, CLK;J, K, CLK; regreg Q;Q; assignassign Qnot = ~ Q ;Qnot = ~ Q ; alwaysalways @ (@ (posedgeposedge CLK)CLK) casecase ({J,K})({J,K}) 2'b00: Q = Q;2'b00: Q = Q; 2'b01: Q = 1'b0;2'b01: Q = 1'b0; 2'b10: Q = 1'b1;2'b10: Q = 1'b1; 2'b11: Q = ~ Q;2'b11: Q = ~ Q; endcaseendcase endmoduleendmodule
  • 21. www.iiu.edu.pk Sunday, May 17, 2015 Mealy Machine 21 AMealymachineisafinite-statemachinewhose outputvaluesaredeterminedbothbyitscurrent stateandthecurrentinputs.(Thisisincontrastto aMooremachine,whoseoutputvaluesare determinedsolelybyitscurrentstate.)
  • 22. // Structural description of sequential circuit module DFF (Q, D, CLK, RST); // D flip-flop with asynchronous reset. output Q; input D, CLK, RST; reg Q; always @(posedge CLK or negedge RST) if (~RST) Q = 1'b0; // Same as: if (RST == 0) else Q = D; endmodule module Mealy_Circuit (x , y, AB, CLK, RST); input x, CLK, RST; output y; output [1:0] AB; wire Da, Db,A,B; //Flip-flip input equations assign Da = (A&x) | (B&x) ; // assign Db = ~A & x ; // assign y = ~x & (A|B) ; // assign AB = {A , B} ; DFF Dffa (A, Da, CLK, RST); DFF Dffb (B, Db, CLK, RST); endmodule www.iiu.edu.pk Sunday, May 17, 2015 Structured Programming 22
  • 23. modulemodule test_Mealy_Circuit;test_Mealy_Circuit; regreg x, CLK, RST;x, CLK, RST; wirewire Y;Y; wirewire [1:0] ABC ;[1:0] ABC ; Mealy_Circuit MC1 (x ,Y , ABC, CLK, RST);Mealy_Circuit MC1 (x ,Y , ABC, CLK, RST); initialinitial beginbegin CLK = 0;CLK = 0; repeatrepeat (30) #5 CLK = ~CLK;(30) #5 CLK = ~CLK; endend initialinitial beginbegin RST = 1; x = 0;RST = 1; x = 0; #10 RST = 0;#10 RST = 0; #10 RST = 1;#10 RST = 1; repeatrepeat (6) #30 x = ~x;(6) #30 x = ~x; endend endmoduleendmodule www.iiu.edu.pk Sunday, May 17, 2015 Examples 23
  • 24. Input Present State x A B 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 www.iiu.edu.pk Sunday, May 17, 201524 Flip Flop Inputs DA DB 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 Next State A+ B+ 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 Output y 0 1 1 1 0 0 0 0 0000 1010 0101 1111 0/0 0/1 0/1 0/1 1/0 1/0 1/0 1/0 input output State Table State Diagram Input Next Output D Q(t+1) 0 0 1 1
  • 25. module Mealy_Model ( x, y, CLK, RST ); input x,CLK,RST; output y; reg y; reg [1:0] Prstate, Nxtstate; parameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11; always @ (posedge CLK or negedge RST) if (~RST) Prstate = S0; // Initialize to state S0 else Prstate = Nxtstate; // Clock operations always @ (Prstate or x) // Determine next state case (Prstate) S0: if (x) Nxtstate = S1; else Nxtstate = S0; S1: if (x) Nxtstate = S3; else Nxtstate = S0; S2: if (~x)Nxtstate = S0; else Nxtstate = S2; S3: if (x) Nxtstate = S2; else Nxtstate = S0; endcase always @ (Prstate or x) // Evaluate output case (Prstate) S0: y = 0; S1: if (x) y = 1'b0; else y = 1'b1; S2: if (x) y = 1'b0; else y = 1'b1; S3: if (x) y = 1'b0; else y = 1'b1; endcase endmodule www.iiu.edu.pk Sunday, May 17, 2015 Mealy Machine: Behavioral Modeling 25