Mealy machine for two’s complement

December 4, 2026 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

← RGPV CD-501 Theory of Computation November 2023 Solved Paper

Question

Design a Mealy machine that produces the two’s complement of a binary number.

Asked in: CD-501 | November 2023 | 1(b)

Answer

Read the fixed-width binary word from right to left. In initial state C copy zeros (0/0 loop); on the first 1 output 1 and enter state F. In F complement every bit: 0/1 and 1/0 loops. Reverse the emitted sequence to display the result in ordinary order. Example 0100 becomes 1100. The all-zero word remains zero. This implements negation modulo 2 to the word length.

← RGPV CD-501 Theory of Computation November 2023 Solved Paper

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion