84.3k views
4 votes
There is a machine language called Latchy. The bit strings 11, 10, and 01 form the entire set of valid Latchy instructions. The bit positions in a Latchy instruction representation have, from left to right, the names S’ and R’. Yes, Latchy is the machine language of the S’R’ latch circuit! When presented to the inputs of that circuit, the bit string of a machine instruction for a logic circuit causes the circuit to execute the action (computation) represented by instruction bit string. Latchy programs consist of a sequence of Latchy instructions. Each Latchy instruction may be followed by a semicolon and a comment. Assume Latchy program instructions are presented to the S’ and R’ inputs of an S’R’ latch one at a time until reaching the final program instruction. The final instruction bit values are then sustained on the S’R’ latch inputs forever or until someone decides to turn off this little computer. Write a Latchy program that commands an S’R’ latch to emit exactly one falling edge on its output, the Q(t) wire. Provide an explanatory comment with each line of code. Your program must command desired latch behavior regardless of initial latch state (initial Q(t) value). Write your program using as few instructions as you can.

User Killah
by
7.9k points

1 Answer

4 votes

Final answer:

A Latchy program can be written to command an S’R’ latch to emit exactly one falling edge on its output wire, Q(t).

Step-by-step explanation:

Latchy Program to Emit a Falling Edge on the Q(t) Wire

A Latchy program can be written to command an S’R’ latch to emit exactly one falling edge on its output wire, Q(t). The program can be implemented using the following Latchy instructions:

  1. Instruct the latch to set the S’ input to 1 and the R’ input to 0: 11; (This puts the latch in set mode.)
  2. Instruct the latch to set the S’ input to 1 and the R’ input to 1: 10; (This momentarily puts the latch in reset mode and causes the falling edge on the output wire.)

The program consists of just two instructions, and it works regardless of the initial state of the latch. When executed, it sets the latch, then resets it, resulting in a single falling edge on the Q(t) wire.

User Emin Bugra Saral
by
7.3k points