# Determining the ROM contents of a circuit

I have a state transition table and a truth table stored in a ROM. The truth table was obtained from the state transition table but I'm not sure how. Could anyone explain how the truth table is obtained from the state diagram shown in the image below?  ## 1 Answer

A, B, and C are used as a 3-bit representation of the "present state". For instance, a present state of 1 (first row of the transition table) corresponds to ABC=001.

For each present state, there's one row for x=0 and one row for x=1.

For each of those rows, the contents of the ROM include the new values for A, B, and C to represent the next state, and one bit for the output.

The unused rows in the ROM (like the first two rows, for ABC=000) are left as all zeroes. Note that this will make the state machine "hang" if it reaches an undefined state.

• How are the new values obtained? For example, according to the table, when ABC = 001 and x = 0, the new values of ABC = 010, when according to the state transition table I would expect the new values of ABC to also be 001 for x = 0. – Ca01an May 31 '17 at 23:05
• Oh, weird. On second thought… I'm not sure how they ended up with that transition table. Maybe they renumbered the states? – duskwuff -inactive- Jun 1 '17 at 1:11
• Correct, the original states are (1, 2, 5, 6, 7) but they have been renumbered in binary as (0, 1, 2, 3, 4) – Zachary Vance Jul 3 '20 at 22:40