moore机状态图和mealy机有区别吗?


提交成功是否继续回答问题?
手机回答更方便,互动更有趣,下载APP
展开全部moore状态机的输出只和当前状态有关,不与当前输入有关,也就是说当前状态的次态唯一,实现了输入与输出的分离,在一个时钟周期内,无论输入变化几次,输出之变化一次;mealy状态机的输出不仅和当前状态有关,还和当前的输入状态有关,当前状态会根据不同输入而有不同输出,次态不唯一。希望可以帮到你~~
本回答由提问者推荐已赞过已踩过你对这个回答的评价是?评论
收起IPX8压力浸水试验机是一种做防水等级试验常用设备,用于检验产品的防水性能。广州德晟仪器设备有限公司是一家专注于IPXX防水试验设备的公司(第一个X是指防尘等级,第二个X是指防水等级),专注于生产经营防水试验设备,防水试验设备也叫防水测试设...
点击进入详情页本回答由广州德晟仪器设备公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
下载百度知道APP,抢鲜体验使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。扫描二维码下载
×个人、企业类侵权投诉
违法有害信息,请在下方选择后提交
类别色情低俗
涉嫌违法犯罪
时政信息不实
垃圾广告
低质灌水
我们会通过消息、邮箱等方式尽快将举报结果通知您。说明
做任务开宝箱累计完成0
个任务
10任务
50任务
100任务
200任务
任务列表加载中...
一、Moore状态机 输出只与此时的状态有关,因此假如需要检测宽度为4的序列,则需要五个状态。设计一个序列检测器,检测序列1101,检测到输出1,否则输出0。`timescale 1ns / 1ps
module seq_det_moore(
input clk,
input reset,
input din,
output reg dout
);
//状态声明
localparam [2:0]
s0 = 3'b000,
s1 = 3'b001,
s2 = 3'b010,
s3 = 3'b011,
s4 = 3'b100;
reg [2:0] current_state,next_state;
always @(posedge clk, posedge reset)
begin
if(reset)
current_state <= s0;
else
current_state <= next_state;
end
always @ *
begin
case(current_state)
s0:
if(din == 1'b1) next_state = s1;
else next_state = s0;
s1:
if(din == 1'b1) next_state = s2;
else next_state = s0;
s2:
if(din == 1'b0) next_state = s3;
else next_state = s2;
s3:
if(din == 1'b1) next_state = s4;
else next_state = s0;
s4:
if(din == 1'b1) next_state = s1;
else next_state = s0;
default: next_state = s0;
endcase
end
always @*
begin
if(current_state == s4) dout = 1;
else dout = 0;
end
endmodule
二、Mealy状态机输出与此时的状态以及输入有关,因此假如需要检测宽度为4的序列,只需要四个状态即可。设计一个序列检测器,检测序列1101,检测到输出1,否则输出0。`timescale 1ns / 1ps
module seq_det_mealy(
input clk,
input reset,
input din,
output reg dout
);
localparam [1:0]
s0 = 2'b00,
s1 = 2'b01,
s2 = 2'b10,
s3 = 2'b11;
reg [1:0] current_state,next_state;
always @(posedge clk, posedge reset)
begin
if(reset)
current_state <= s0;
else
current_state <= next_state;
end
always @ *
begin
case(current_state)
s0:
if(din == 1'b1) next_state = s1;
else next_state = s0;
s1:
if(din == 1'b1) next_state = s2;
else next_state = s1;
s2:
if(din == 1'b0) next_state = s3;
else next_state = s2;
s3: next_state = s0;
default: next_state = s0;
endcase
end
always @ *
begin
if(reset) dout = 1'b0;
else if( (current_state == s3)&&(din == 1'b1) ) dout = 1'b1;
else dout = 1'b0;
end
endmodule
发布于 2022-01-17 10:29

我要回帖

更多关于 mobileme是什么意思 的文章

 

随机推荐