联发科序列检测题 110序列选择器

在这里插入图片描述
Mealy型

module sqe_de_MTK_2018(
        input clk,
        input rst_n,
        input in,
        output out
    
    );
    
    parameter st0 = 2'b00;
    parameter st1 = 2'b01;
    parameter st2 = 2'b10;
    reg [1:0] state = st0,next_state;
    reg out_b;
     
    always@(posedge clk or negedge rst_n)begin
        if(rst_n)begin
            state <= st0;
        end
        else begin
            state <= next_state;
        end
    end
    
    always@(*)begin
        case(state)
            st0:
                if(in == 1'b1)begin
                    next_state <= st1;
                end
                else begin
                    next_state <= st0;
                end
            st1:
                if(in == 1'b1)begin
                    next_state <= st2;
                end
                else begin
                    next_state <= st0;
                end
            st2:
                if(in == 1'b1)begin
                    next_state <= st2;
                end
                else begin
                    next_state <= st0;
                end
        endcase
    end
    
    always@(posedge clk or negedge rst_n)begin
        if(rst_n)begin
            out_b <= 1'b0;
        end
        else begin
            out_b <= 1'b0;
            case(state)
                st0:out_b <= 1'b0;
                st1:out_b <= 1'b0;
                st2:
                    if(in == 1'b1)
                        out_b <= 1'b0;
                    else
                        out_b <= 1'b1;
            endcase
        end
    end
    reg out_a;
    always@(posedge clk or negedge rst_n) begin
        if(rst_n)
            out_a = 0;
        else
            out_a = ~in & state[1];
    end
    assign out = out_b;
    wire out_1;
    assign out_1 = ~in & state[1];

endmodule

在这里插入图片描述
从图中可以看出,out_1比out_b,out_a提前一个时钟周期

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一、实验目的: 1、深入了解与掌握同步时序逻辑电路的设计过程; 2、了解74LS74、74LS08、74LS32及74LS04芯片的功能; 3、能够根据电路图连接好实物图,并实现其功能。学会设计过程中的检验与完善。 二、实验内容描述: 目:“1 1 1”序列检测器。 原始条件:使用D触发器( 74 LS 74 )、“与”门 ( 74 LS 08 )、“或”门( 74 LS 32 )、非门 ( 74 LS 04 ),设计“1 1 1”序列检测器。 集成电路引脚图: D触发器( 74 LS 74 ) “与”门 ( 74 LS 08 ) “或........ 三、实验设计过程: 第1步,画出原始状态图和状态表。 根据任务书要求,设计的序列检测器有一个外部输入x和一个外部输出Z。输入和输出的逻辑关系为:当外部输入x第一个为“1”,外部输出Z为“0”;当外部输入x第二个为“1”,外部输出Z为“0”;当外部输入x第三个为“1”,外部输出Z才为“1”。假定有一个外部输入x序列以及外部输出Z为: 输入x: 0 1 0 1 1 1 0 1 1 1 1 0 1 输出Z: 0 0 0 0 0 1 0 0 0 1 1 0 0 要判别序列检测器是否连续接收了“111”,电路必须用不同的状态记载外部输入x的值。假设电路的初始状态为A,x输入第一个“1”,检测器状态由A装换到B,用状态B记载检测器接受了111序列的第一个“1”,这时外部输出Z=0;x输入第二个“1”,检测器状态由B装换到C,用状态C记载检测器接受了111序列的第二个“1”,外部输出Z=0;x输入第三个“1”,检测器状态由C装换到D,外部输出Z=1。然后再根据外部输入及其他情况时的状态转移,写出相应的输出。以上分析了序列检测器工作,由此可画出图7-1所示的原始状态图。根据原始状态图可列出原始状态表,如表7-2所示。 现态 次态/输出 x = 0 x = 1 A A / 0 B / 0 B A / 0 C / 0 C A / 0 D / 1 D A / 0 D / 1 (表 7-2 原始状态表) (图
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值