1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Solved] Binary Sequence detector

Discussion in 'FPGA Boards' started by Krishnamurthy, Mar 4, 2015.

Thread Status:
Not open for further replies.
  1. Krishnamurthy

    Krishnamurthy New Member

    Joined:
    Mar 4, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    Coimbatore
    I am doing a simple application of Binary Sequence detector using FSM.Binary.I have already done the synthesis and I have also created the programming file.I just need to design a ucf file and upload the program into the fpga board so as to work.Initially I thought of buying Spartan 3E board but because its very expensive I ought to buy Elbert V2 - Spartan 3A FPGA Development Board.Can I go ahead and buy it.Please tell your suggestions.
    Code:
    module melfsmolp(din, reset, clk, y);
    output reg y;
    input din;
    input clk;
    input reset;
    reg [1:0] cst, nst;
    parameter S0 = 2'b00,
              S1 = 2'b01,
              S2 = 2'b10,
              S3 = 2'b11;
    always @(cst or din)
    begin
    case (cst)
       S0: if (din == 1'b1)
              begin
             nst = S1;
              y=1'b0;
              end
          else
              begin
               nst = cst;
              y=1'b0;
              end
       S1: if (din == 1'b0)
              begin
            nst = S2;
              y=1'b0;
              end
           else
              begin
               nst = cst;
              y=1'b0;
              end
       S2: if (din == 1'b1)
              begin
             nst = S3;
              y=1'b0;
              end   
                else
              begin
               nst = S0;
              y=1'b0;
              end
       S3: if (din == 1'b0)
              begin
             nst = S2;
              y=1'b1;
              end
           else
              begin
              nst = S1;
              y=1'b0;
              end
       default: nst = S0;
      endcase
    end
    always@(posedge clk)
    begin
               if (reset)
                 cst <= S0;
               else
                 cst <= nst;
    end
    endmodule
    
    
    
     
  2. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
    As far as I can see, the code above is simple enough that it cold fit in almost any FPGA board available in the world. But should you buy one product or the other is always your choice.

    Hope this helps.
     
Thread Status:
Not open for further replies.

Share This Page