GATE / CS ARCHIVE

GATE CSE 1994 / QUESTION 3.3

Finite-state addition of arbitrarily long integers

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

GATE 1994, Q3.3 Other
Report issue

Finite-State Machine Design

Question 3.3, GATE 1994: True or false: a finite-state machine can add two integers of arbitrary digit length. State the input/output convention.
Tap to enlarge
Answer & solution

Answer: True for an LSB-first synchronous serial adder (no official key was published)

Feed the two numbers one bit pair at a time from least significant to most significant, padding the shorter with zeros. The machine needs only the carry bit c, hence two states. For input bits a,b it emits (a+b+c) mod 2 and changes state to floor((a+b+c)/2). After the final pair, emit the remaining carry. This works for any finite length with constant internal state. The convention matters: it is a transducer with paired LSB-first input, not a DFA expected to store both complete unbounded integers or emit an MSB-first sum before future carries are known.

Original paper, page 4