SlideShare une entreprise Scribd logo
1  sur  8
ENGR. RASHID FARID CHISHTI
LECTURER,DEE, FET, IIUI
CHISHTI@IIU.EDU.PK
WEEK 9
BEHAVIORAL MODELING
MOORE MACHINE
FPGA Based System Design
Sunday, May 17, 2015
1
www.iiu.edu.pk
www.iiu.edu.pk Sunday, May 17, 2015
Mealy Machine vs Moore Machine
2
module Moore_mdl (x,AB,CLK,RST); // Moore state diagram
input x,CLK,RST; output [1:0]AB; reg [1:0] PrState, NxtState;
parameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11;
always @ (posedge CLK or negedge RST) // to handle reset and clock
if (~RST) PrState = S0; // Initialize to state S0
else PrState = NxtState; // Clock operations
always @ (PrState or x) // to Determine next state
case (PrState)
S0: if (~x) NxtState = S1; else NxtState = S0;
S1: if (~x) NxtState = S3; else NxtState = S2;
S2: if (~x) NxtState = S3; else NxtState = S2;
S3: if (~x) NxtState = S0; else NxtState = S3;
endcase
assign AB = PrState; // to determine output
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Moore Model
3
module test_Moore_Circuit;
reg x, CLK, RST; // inputs for circuit
wire [1:0] AB; // output from circuit
Moore_mdl mm1 (x, AB, CLK, RST);
initial begin CLK = 0;
repeat (14) #5 CLK = ~CLK;
end
initial begin x = 0;
repeat (7) #10 x = ~ x;
end
initial begin RST = 1; #3
RST = 0; #3
RST = 1;
end
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Test Bench
4
www.iiu.edu.pk Sunday, May 17, 2015
Examples
5
Moore Machine
// Structural description of sequential circuit
module Moore_mdl (x, y, AB, CLK, RST);
input x, CLK, RST; output y; output [1:0] AB; wire Ta, Tb, A, B;
assign Ta = x & AB[0], Tb = x; //Flip-flip input equations
assign y = AB[1] & AB[0]; //Output equation
T_FF BF (AB[0], Tb, CLK, RST); // Instantiate T flip-flops
T_FF AF (AB[1], Ta, CLK, RST);
endmodule
module T_FF (Q,T,CLK,RST); // T flip-flop
output Q; input T,CLK,RST; reg Q;
always @ (posedge CLK or negedge RST)
if (~RST)
Q = 1'b0;
else
Q = Q ^ T;
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Structured Programming
6
// Stimulus for testing sequential circuit
module test_Moore_mdl;
reg x, CLK, RST; // inputs for circuit
wire y; wire [1:0] AB; // output from circuit
Moore_mdl mm1 (x, y, AB, CLK, RST);
initial begin RST = 1;
#7 RST = 0; #3 RST = 1;
end
initial begin CLK = 0;
repeat (20) #5 CLK = ~CLK;
end
initial begin x = 1;
repeat (10) #10 x = ~ x;
end
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Test Bench
7
module Moore_mdl (x,Y, AB, CLK,RST); // Moore state diagram
input x,CLK,RST; output [1:0]AB; output 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) // to handle reset and clock
if (~RST) PrState = S0; // Initialize to state S0
else PrState = NxtState; // Clock operations
always @ (PrState or x) // to Determine next state
case (PrState)
S0: if (x) NxtState = S1; else NxtState = S0;
S1: if (x) NxtState = S2; else NxtState = S1;
S2: if (x) NxtState = S3; else NxtState = S2;
S3: if (x) NxtState = S0; else NxtState = S3;
endcase
assign AB = PrState; // to show state
assign Y = AB[0] & AB[1]; // to show state
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Moore Machine: Behavioral Programming
8

Contenu connexe

Tendances

Two one Problem artificial intelligence
Two one Problem artificial intelligence  Two one Problem artificial intelligence
Two one Problem artificial intelligence Wasim Raza
 
Skip lists (Advance Data structure)
Skip lists (Advance Data structure)Skip lists (Advance Data structure)
Skip lists (Advance Data structure)Shubham Shukla
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuitchauhankapil
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency controlBinte fatima
 
Cat database
Cat databaseCat database
Cat databasetubbeles
 
Transaction
TransactionTransaction
TransactionAmin Omi
 
Verilog operators
Verilog operatorsVerilog operators
Verilog operatorsDr.YNM
 
Asset Monitoring with Beacons, Lora, NodeJS and IoT Cloud
Asset Monitoring with Beacons, Lora,  NodeJS and IoT CloudAsset Monitoring with Beacons, Lora,  NodeJS and IoT Cloud
Asset Monitoring with Beacons, Lora, NodeJS and IoT CloudRobert van Mölken
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Stavros Vassos
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing ConceptNishant Munjal
 
Quantum_Safe_Crypto_Overview_v3.pdf
Quantum_Safe_Crypto_Overview_v3.pdfQuantum_Safe_Crypto_Overview_v3.pdf
Quantum_Safe_Crypto_Overview_v3.pdfRonSteinfeld1
 

Tendances (20)

Stack Operation In Data Structure
Stack Operation In Data Structure Stack Operation In Data Structure
Stack Operation In Data Structure
 
B trees
B treesB trees
B trees
 
Unit 6
Unit 6Unit 6
Unit 6
 
Two one Problem artificial intelligence
Two one Problem artificial intelligence  Two one Problem artificial intelligence
Two one Problem artificial intelligence
 
Skip lists (Advance Data structure)
Skip lists (Advance Data structure)Skip lists (Advance Data structure)
Skip lists (Advance Data structure)
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
Cat database
Cat databaseCat database
Cat database
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Rehashing
RehashingRehashing
Rehashing
 
Cryptographic protocols
Cryptographic protocolsCryptographic protocols
Cryptographic protocols
 
Transaction
TransactionTransaction
Transaction
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Verilog operators
Verilog operatorsVerilog operators
Verilog operators
 
Asset Monitoring with Beacons, Lora, NodeJS and IoT Cloud
Asset Monitoring with Beacons, Lora,  NodeJS and IoT CloudAsset Monitoring with Beacons, Lora,  NodeJS and IoT Cloud
Asset Monitoring with Beacons, Lora, NodeJS and IoT Cloud
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
 
Hashing .pptx
Hashing .pptxHashing .pptx
Hashing .pptx
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing Concept
 
Quantum_Safe_Crypto_Overview_v3.pdf
Quantum_Safe_Crypto_Overview_v3.pdfQuantum_Safe_Crypto_Overview_v3.pdf
Quantum_Safe_Crypto_Overview_v3.pdf
 

Similaire à Fpga 09-behavioral-modeling-moore-machine

Digital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsDigital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsIndira Priyadarshini
 
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docxajoy21
 
07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2SHIVA PRASAD
 
Embedded JavaScript
Embedded JavaScriptEmbedded JavaScript
Embedded JavaScriptJens Siebert
 
VLSI Sequential Circuits II
VLSI Sequential Circuits IIVLSI Sequential Circuits II
VLSI Sequential Circuits IIGouthaman V
 
ECE448_lecture7_ASM_VHDL.pptx
ECE448_lecture7_ASM_VHDL.pptxECE448_lecture7_ASM_VHDL.pptx
ECE448_lecture7_ASM_VHDL.pptxAmenahAbbood
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)Maho Nakata
 
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
 
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Shinya Takamaeda-Y
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller Swapnil2515
 

Similaire à Fpga 09-behavioral-modeling-moore-machine (20)

Digital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsDigital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential Circuits
 
Verilog_Examples (1).pdf
Verilog_Examples (1).pdfVerilog_Examples (1).pdf
Verilog_Examples (1).pdf
 
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
07 seq logicii-ix2
07 seq logicii-ix207 seq logicii-ix2
07 seq logicii-ix2
 
Embedded JavaScript
Embedded JavaScriptEmbedded JavaScript
Embedded JavaScript
 
07 sequential verilog
07 sequential verilog07 sequential verilog
07 sequential verilog
 
VLSI Sequential Circuits II
VLSI Sequential Circuits IIVLSI Sequential Circuits II
VLSI Sequential Circuits II
 
ECE448_lecture7_ASM_VHDL.pptx
ECE448_lecture7_ASM_VHDL.pptxECE448_lecture7_ASM_VHDL.pptx
ECE448_lecture7_ASM_VHDL.pptx
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
 
FPGA Tutorial - LCD Interface
FPGA Tutorial - LCD InterfaceFPGA Tutorial - LCD Interface
FPGA Tutorial - LCD Interface
 
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
 
Uart
UartUart
Uart
 
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
 
Pwm wave
Pwm wave Pwm wave
Pwm wave
 
13486500-FFT.ppt
13486500-FFT.ppt13486500-FFT.ppt
13486500-FFT.ppt
 
Direct analog
Direct analogDirect analog
Direct analog
 
lecture23.pdf
lecture23.pdflecture23.pdf
lecture23.pdf
 
4 io port-programming
4 io port-programming4 io port-programming
4 io port-programming
 

Plus de 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 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineFpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineMalik Tauqir Hasan
 
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
 
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
 

Plus de Malik Tauqir Hasan (12)

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 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineFpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machine
 
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
 
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
 
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
 

Dernier

Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Pooja Nehwal
 
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...ur8mqw8e
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhisoniya singh
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gapedkojalkojal131
 
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...nagunakhan
 
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Pooja Nehwal
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...Suhani Kapoor
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service ThanePooja Nehwal
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...Pooja Nehwal
 
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaDubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaUnited Arab Emirates
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power pointchhavia330
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...Pooja Nehwal
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...anilsa9823
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...ranjana rawat
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 

Dernier (20)

Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
 
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
《伯明翰城市大学毕业证成绩单购买》学历证书学位证书区别《复刻原版1:1伯明翰城市大学毕业证书|修改BCU成绩单PDF版》Q微信741003700《BCU学...
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
 
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
Russian Escorts in lucknow 💗 9719455033 💥 Lovely Lasses: Radiant Beauties Shi...
 
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
 
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaDubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power point
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
 
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
 

Fpga 09-behavioral-modeling-moore-machine

  • 1. ENGR. RASHID FARID CHISHTI LECTURER,DEE, FET, IIUI CHISHTI@IIU.EDU.PK WEEK 9 BEHAVIORAL MODELING MOORE MACHINE FPGA Based System Design Sunday, May 17, 2015 1 www.iiu.edu.pk
  • 2. www.iiu.edu.pk Sunday, May 17, 2015 Mealy Machine vs Moore Machine 2
  • 3. module Moore_mdl (x,AB,CLK,RST); // Moore state diagram input x,CLK,RST; output [1:0]AB; reg [1:0] PrState, NxtState; parameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11; always @ (posedge CLK or negedge RST) // to handle reset and clock if (~RST) PrState = S0; // Initialize to state S0 else PrState = NxtState; // Clock operations always @ (PrState or x) // to Determine next state case (PrState) S0: if (~x) NxtState = S1; else NxtState = S0; S1: if (~x) NxtState = S3; else NxtState = S2; S2: if (~x) NxtState = S3; else NxtState = S2; S3: if (~x) NxtState = S0; else NxtState = S3; endcase assign AB = PrState; // to determine output endmodule www.iiu.edu.pk Sunday, May 17, 2015 Moore Model 3
  • 4. module test_Moore_Circuit; reg x, CLK, RST; // inputs for circuit wire [1:0] AB; // output from circuit Moore_mdl mm1 (x, AB, CLK, RST); initial begin CLK = 0; repeat (14) #5 CLK = ~CLK; end initial begin x = 0; repeat (7) #10 x = ~ x; end initial begin RST = 1; #3 RST = 0; #3 RST = 1; end endmodule www.iiu.edu.pk Sunday, May 17, 2015 Test Bench 4
  • 5. www.iiu.edu.pk Sunday, May 17, 2015 Examples 5 Moore Machine
  • 6. // Structural description of sequential circuit module Moore_mdl (x, y, AB, CLK, RST); input x, CLK, RST; output y; output [1:0] AB; wire Ta, Tb, A, B; assign Ta = x & AB[0], Tb = x; //Flip-flip input equations assign y = AB[1] & AB[0]; //Output equation T_FF BF (AB[0], Tb, CLK, RST); // Instantiate T flip-flops T_FF AF (AB[1], Ta, CLK, RST); endmodule module T_FF (Q,T,CLK,RST); // T flip-flop output Q; input T,CLK,RST; reg Q; always @ (posedge CLK or negedge RST) if (~RST) Q = 1'b0; else Q = Q ^ T; endmodule www.iiu.edu.pk Sunday, May 17, 2015 Structured Programming 6
  • 7. // Stimulus for testing sequential circuit module test_Moore_mdl; reg x, CLK, RST; // inputs for circuit wire y; wire [1:0] AB; // output from circuit Moore_mdl mm1 (x, y, AB, CLK, RST); initial begin RST = 1; #7 RST = 0; #3 RST = 1; end initial begin CLK = 0; repeat (20) #5 CLK = ~CLK; end initial begin x = 1; repeat (10) #10 x = ~ x; end endmodule www.iiu.edu.pk Sunday, May 17, 2015 Test Bench 7
  • 8. module Moore_mdl (x,Y, AB, CLK,RST); // Moore state diagram input x,CLK,RST; output [1:0]AB; output 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) // to handle reset and clock if (~RST) PrState = S0; // Initialize to state S0 else PrState = NxtState; // Clock operations always @ (PrState or x) // to Determine next state case (PrState) S0: if (x) NxtState = S1; else NxtState = S0; S1: if (x) NxtState = S2; else NxtState = S1; S2: if (x) NxtState = S3; else NxtState = S2; S3: if (x) NxtState = S0; else NxtState = S3; endcase assign AB = PrState; // to show state assign Y = AB[0] & AB[1]; // to show state endmodule www.iiu.edu.pk Sunday, May 17, 2015 Moore Machine: Behavioral Programming 8