Creating Memory

Written politely 2021-08-15.

The third project in our quest to learn how to build a modern computer was specifically about memory and time. We had to build a bit, register, Ram8, Ram64, Ram 512, Ram4k, Ram16k, and a Program Counter. If you are new to the course, begin here. Otherwise, to get up to speed with the ideas before building these chips, start with the last post about memory.

Bit

The build was described in the course as being comprised of a Mux chip and a DigitalFlipFlop (DFF). We didn’t have to build the DFF as it was a built-in chip, we can just use it.

bit

The were two tricky things to figure out how to do for this chip. One, we were figuring out how to route the out from the DFF as an out for the entire Bit chip and also as one of the inputs back into the Mux chip. And two, we need to be careful about which input of the Mux, a or b, to route the output of the DFF back into for it to pass the tests.

Register

The register is basically a 16-bit version of the Bit chip. If you remember how we went from 1-bit to multiple bits from previous chips, this chip is constructed similarly.

Ram8, Ram64, Ram512, Ram4k, Ram16k

These chips were very similar in their construction. Each used previously constructed chips to build these chips. The Ram8 is a combination of 8 registers each 16-bits wide with a 3-bit address. The Ram 64 is a combination of 64 registers each 16-bits wide with a 6-bit address. The Ram512 is a combination of 512 registers each 16-bits wide with a 9-bit address. The Ram4k is a combination of 4,096 registers each with a 12-bit address. The Ram16k is a combination of 16,384 registers with a 14-bit address. You should notice a pattern with these specs that should help in understanding how to construct them.

Program Counter

The hints given in the video were that the Program Counter would involve using a Register, and Incrementer, and some other previously constructed chips (not specified). This was the chip that was the most difficult to complete in this project.

Here are a few hints without giving anything away. The order of the three bits that increment a 16-bit number, load a 16-bit number, and reset a 16-bit number (or set it to 0) is important. Use some of the hdl skills learned during previous chip construction to be able to route the bits through the program counter and pass the tests.

Conclusion

With the completion of this project, we are ready to take a departure from chips for a chapter to look at how machine language and binary code allow the parts we have built run ordered operations of a structured program. See you next time for a continuation of building a modern computer from first principles using Maching Language.


Lucas McDaniel

Husband, father, teacher, musician, avid gamer, nature enthusiast, and passionate about the human condition.