If I understand correctly, the state diagram of a sequential circuit simply shows the different states the circuit goes through. However, if I'm trying to build a 2's complementer using a shift register and a flip-flop, how does the state diagram look? Seeing as what goes through the flip-flop depends on the digit put in the register, I'm not sure how to draw it.



You should only consider drawing the state machine for the actual 2-complementer with serial input, and forget about the shift register (drawing a state diagram for a shift register of a given length is perfectly possible, but makes hardly any sense).

Said that, the task boils down to a single-input/single-output state machine with 2 states. Look here: http://k5rec.blogspot.com/2006/12/digital-electronics-serial-twos.html

  • \$\begingroup\$ thanks that's a really helpful link. however, what are the bits displayed on the state paths? (ie. 1/0, 0/0). What do they represent? Thanks! \$\endgroup\$ – n0pe Mar 27 '11 at 18:10
  • \$\begingroup\$ The notation is <input value>/<output value>. Note, that this is a Mealy state machine formally - that is, the output value depends on both current state and input, hence the notation. \$\endgroup\$ – Code Painters Mar 27 '11 at 18:16
  • \$\begingroup\$ You may find this link useful as well: en.wikipedia.org/wiki/Mealy_machine \$\endgroup\$ – Code Painters Mar 27 '11 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.