Skip to content

Logic Quest

VLSI Interview Questions

  • Wave Diagram Analysis
  • Design Questions
  • Gate Level Questions
  • Some Coding
  • Contact us
  • Toggle search form

Divided by 5 FSM – MSB

Design a FSM which takes a stream of bits considering that the MSB is the first to come, and the output is ‘1’ if the number that accumulated this far is divided by 5.

Answer

Next Question>>>

Comments (5) on “Divided by 5 FSM – MSB”

  1. Shani says:
    March 19, 2022 at 8:19 pm

    Hello,
    I have some difficulty understanding the details of the question
    Is it possible to assume that the register is infinite and initialized at zero? Maybe an example will help Thank you

    Reply
  2. Logic-Quest says:
    March 20, 2022 at 12:54 pm

    You don’t need to assume infinite register.
    You can look at this example of how to generate the actual circuit from the FSM:
    http://logic-quest.com/219-2/
    Because the FSM has five states you will need at least three registers.

    Reply
    1. Shani says:
      March 27, 2022 at 3:26 pm

      Hi,
      First of all, Thank you very much for the reply.
      But I think my problem is more in creating the FSM as required
      I can not really understand how the bits get to the register – if I do not know the size of the register.
      Is it possible to give an example for illustration?
      Thank you,
      Shani

      Reply
      1. Logic-Quest says:
        March 27, 2022 at 9:56 pm

        You can think of a black box with X as an input. At each positive clock edge X is sampled with 0 or 1. The internal logic of the black box is generated from the FSM above. The main goal of the internal logic of the black box is to decide at each clock cycle if the stream of bits that accumulated this far is divided by 5 or not.

        Now, for generating the FSM we need to write down some divided by 5 binary numbers. Simple example, the binary stream 000 is obviously equal to 0 in decimal, hence we are at state S0 and the output is 1. Then we can get the stream 101. When we see 1 we can’t stay at state S0 and therefore we have to proceed to state S1 and the output is 0. When we see the second 1 we accumulated 000101 this far (5 in decimal) and we back to state S0 and the output is 1. In order to complete the full FSM we need to write down divided by 5 binary numbers and follow the pattern.

        I hope this helps.

        http://logic-quest.com/wp-content/uploads/2022/03/f5.png

        Reply
  3. Shani says:
    March 28, 2022 at 6:51 pm

    Thank you
    The explanation was very helpful
    I was able to find the right answer

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 Logic Quest.

Powered by PressBook Blog WordPress theme