GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 63

Serial two’s-complement transducer

Digital Logic · Finite-State Machine Design · Full GATE CSE 2005 paper

GATE 2005, Q63 2 marks · MCQ
Report issue

Finite-State Machine Design

Question 63, GATE 2005: A binary transducer reads least-significant bit first. Initial Q0 loops on 0/output 0 and changes to Q1 on 1/output 1; Q1 loops on 0/output 1 and 1/output 0. Does it compute A ones complement; B twos complement; C increment; D decrement?
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Read from the least significant end: Q0 copies all initial zeros and copies the first 1, then Q1 complements every remaining bit. Keeping the least-significant 1 and all lower zeros while complementing higher bits is exactly fixed-width two’s-complement negation. The all-zero input remains zero. Thus B.

Subtracting a fixed-width binary word from zero leaves its trailing zeros unchanged, leaves the first 1 unchanged, and complements all higher bits. The state change happens at precisely that first 1. For example input word 010100 read from the right yields output 101100, its negation modulo 64. Zero never leaves Q0 and stays zero. A ones-complement machine would flip the trailing zeros too, so A is not the same operation.

Original paper, page 8