Home-brew Computer Step 3: D Flip Flop to Memory

Now that we have 1 bit of memory, it’s pretty simple to build that into something more useable.  By putting 8 D Flip Flops together we get 1 byte of memory.  If we double that and add an address bus, we get 2 individual bytes of addressable memory.  I could go on but I think two bytes is enough to demonstrate usage of both the data and the address buses.

The address bus is simply 1 bit in this example. 0 means we’re addressing the top 8 bits of data, 1 means we’re addressing the lower 8 bits of data.  Doubling this and having 4 lines means 00,01,10,11 or 2 bits of addressable memory, each of which is 1 byte (8 bits).

Typically you would control the read/write* with only 1 bit: 1 means read, 0 means write, but for clarity I have two data buses here: one for input (the 8 bit bus on the bottom of the diagram), and one for output (the 8 bit bus on the top of the diagram).

On the bottom left I have some non-relevant components that I used for testing the 2 bytes of memory.  The clock is obviously necessary, but the rest are: a Logisim random number generator (8 bits)  to fill the addressed 1 byte of memory for testing, and a 8 bit LED output for testing the output data bus.   There are 3 1-bit controls: an on/off for the clock signal, the read/write* control bit, and the 0th / 1st byte switch for testing the address bus.

 

2 Bytes of RAM from D Flip Flops

2 Bytes of RAM from D Flip Flops