Simple Memory Assignment

Please read all of these instructions carefully before starting!

For this assignment you will create a simple memory circuit using Logisim. This memory will consist of two registers, each of which can store a 2-bit value. There will be 4 inputs to your memory:

Your memory will have 2 outputs:

I have provided a Logism file named examples.circ which contains a decoder and a 2-bit register. Play around with both of these before you start working on your circuit and be sure you understand how they work. See below for desriptions.

Create your solution in a separate Logism project and save it as a file named solution.circ (all lowercase). You can copy my examples and paste them into a separate Logism project when you are building up your circuit.

Decoder

The decoder has two inputs and four outputs. Exactly one of the outputs will be 1 at any given time, based on the values of the inputs. Logism provides a single-unit decoder, but you must use a decoder consisting of gates like the one in my example for your solution. Feel free to copy and paste my example decoder.

In your solution, the inputs to the decoder will be ADDRESS and WRITE. Thus the outputs of the decoder will be used to activate the following functionality:

Register

The register uses two of Logisim’s built-in D flip-flops. The outputs of the register are the current states of the flip-flops. There are 2 data inputs and one input named WRITE. The moment WRITE becomes 1, the stored values in the flip-flops are updated to be the values of the data inputs.

Putting it Together

Your final solution will have one decoder and two registers. The A and B input pins in my example decoder will become the ADDRESS and WRITE inputs. You will need to remove the output pins from the decoder and instead route the outputs of the decoder to the appropriate gates in order to select the appropriate functionality. For example, the output from the decoder that is 1 when ADDRESS is 0 and WRITE is 1 must be wired to both of the WRITE inputs of register 0.

The outputs of the decoder when WRITE is 0 are a little more complicated to route. You’ll need to logically combine these outputs with the Q outputs of the registers to select the appropriate values for and . Again, you’ll want to remove the output pins from the example registers and instead wire the outputs of the registers appropriately.

Testing your Circuit

Here is an example sequence of inputs you can use to test your circuit. You should try other permutations of inputs as well. Use Simulate -> Reset Simulation to reset all the input pins and flip-flop values to 0. Here we go:

Now try writing values to register 0 and ensure that the output is correct when you toggle the WRITE input off again. Make sure you try writing all combinations of bits for both registers.

Staying Sane

Creating this circuit may feel a little overwhelming. Some suggestions:

Submission

Make sure your inputs and outputs are labeled correctly. Add the file solution.circ to your local assignment repository and push your submission back to git-keeper.