# GATE | GATE-CS-2005 | Question 63

Last Updated : 28 Jun, 2021

The following diagram represents a finite state machine which takes as input a binary number from the least significant bit.

Which one of the following is TRUE?
(A) It computes 1’s complement of the input number
(B) It computes 2’s complement of the input number
(C) It increments the input number
(D) It decrements the input number

Explanation: The given finite state machine takes a binary number from LSB as input.

The given FSM remains unchanged till first â€˜1â€™ . After that it takes 1â€™s complement of rest of the input string.

We assume the input string to be â€˜110010â€™ .
Thus, according to the FSM, output is â€˜001110â€™ .

2â€™s complement of â€˜110010â€™ = 1â€™s complement of â€˜110010â€™ + 1 = 001101 + 1 = 001110
Thus, the FSM computes 2â€™s complement of the input string.

Hence, option (B) is correct.

Please comment below if you find anything wrong in the above post.

Quiz of this Question

Previous
Next