//----------------way1----------------------
module top_module(
input clk,
input reset, // Synchronous reset
input in,
output disc,
output flag,
output err);
parameter NONE = 4'd0,ONE = 4'd1,TWO = 4'd2;
parameter THREE = 4'd3,FOUR = 4'd4,FIVE = 4'd5;
parameter SIX = 4'd6,ERROR = 4'd7;
parameter DISC = 4'd8,FLAG = 4'd9;
reg [3:0] current_state,next_state;
always @(*) begin
case(current_state)
NONE:begin
next_state = in ? ONE : NONE;
end
ONE:begin
next_state = in ? TWO : NONE;
end
TWO:begin
next_state = in ? THREE : NONE;
end
THREE:begin
next_state = in ? FOUR : NONE;
end
FOUR:begin
next_state = in ? FIVE : NONE;
end
FIVE:begin
next_state = in ? SIX : DISC;
end
SIX:begin
next_state = in ? ERROR : FLAG;
end
DISC:begin
next_state = in ? ONE : NONE;
end
FLAG:begin
next_state = in ? ONE : NONE;
end
ERROR:begin
next_state = in ? ERROR : NONE;
end
endcase
end
always @(posedge clk) begin
if(reset)begin
current_state <= NONE;
end
else begin
current_state <= next_state;
end
end
always @(posedge clk) begin
if(reset)begin
disc <= 1'd0;
flag <= 1'd0;
err <= 1'd0;
end
else begin
case(next_state)
DISC:begin
disc <= 1'd1;
flag <= 1'd0;
err <= 1'd0;
end
FLAG:begin
disc <= 1'd0;
flag <= 1'd1;
err <= 1'd0;
end
ERROR:begin
disc <= 1'd0;
flag <= 1'd0;
err <= 1'd1;
end
default:begin
disc <= 1'd0;
flag <= 1'd0;
err <= 1'd0;
end
endcase
end
end
endmodule
Sequence recognition
相關文章
- sequence to sequence模型模型
- face-recognition
- Selective Search for Object RecognitionObject
- Rainbow Bracket SequenceAIRacket
- Increasing Sequence with Fixed OR
- PostgreSQL 序列(Sequence)SQL
- ORACLE SEQUENCE用法Oracle
- PostgreSQL sequence (一)SQL
- python sequence序列Python
- uvm的sequence
- 論文閱讀:Sequence to sequence learning for joint extraction of entities and relations
- FSM:Sequence 1101 recognizer
- E. Block SequenceBloC
- 裁剪序列Cut the Sequence
- F - Two Sequence Queries
- mysql實現sequenceMySql
- LeetCode 444 sequence reconstructionLeetCodeStruct
- DeepLearning – Overview of Sequence modelView
- A Proof of Golden Section of Fibonacci SequenceGo
- oracle的scn及sequenceOracle
- HDU 1711 Number Sequence(KMP)KMP
- [LeetCode]60. Permutation SequenceLeetCode
- [ABC234G] Divide a SequenceIDE
- abc134E - Sequence Decomposing
- 演算法題 - Pop Sequence演算法
- HDU 6047 Maximum Sequence (貪心)
- [20220321]探究oracle sequence.txtOracle
- Least Cost Bracket Sequence(貪心)ASTRacket
- 從SEQUENCE跳號說起
- [AGC031D]A Sequence of PermutationsGC
- 【論文筆記】A Survey on Deep Learning for Named Entity Recognition筆記
- [論文閱讀] Residual Attention(Multi-Label Recognition)
- face_recognition的5個應用例項
- Keras版Sequence2Sequence對對聯實戰——自然語言處理技術Keras自然語言處理
- CCPC Final 2023 B. Periodic Sequence
- [題解]CF13C Sequence
- [題解]P4597 序列 sequence
- 不同於Oracle:SEQUENCE的區別Oracle