Connect with us

Create Memory/RAM

Discussion in 'Microcontrollers, Programming and IoT' started by RaulJ, May 6, 2014.

Scroll to continue with content
  1. RaulJ


    May 6, 2014
    Hello, I am a beginner in electronics and i would like to create an 8-bit computer, or something similar. I already made the ALU and now i have some problems with the memory/ram. Is it possible to create memory out of transistors and how?(i don't want to buy the ram for it, i want to make everything from scratch, because i want to understand how it works) I already made latches, but i don't know what's next. I connected 8 latches and i know that i need at least 16x, but i don't know how exactly to connect them and coordinate them(I know in theory, but I don't know exactly in practical, i need a circuit diagram or something).

    And sorry if i posted in a wrong section.

    Thank you for your time :D.
  2. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    Nov 28, 2011
    Hello Raul and welcome to Electronics Point :)

    You're a beginner? Why not start with something simpler. Perhaps a spacecraft, or an MRI machine! :)
    Yes, you can make RAM from transistors... a LOT of them! I guess you're using the traditional "single bit static RAM" - a bistable multivibrator made with two transistors. So you've made eight of them, using 16 transistors. But to address this byte, and read and write it, you'll need to add a truckload more transistors.

    Memories are accessed and controlled through address lines, data lines, and control lines (typically, chip select, read enable, and write enable (not present on ROMs, obviously)). You need to decode the address lines to determine which set of latches to access, then interpret the other three signals to decide whether to take the data from the data bus and write it to the latches, or vice versa. Then repeat for the next byte, and so on. Now, I'm an assembly language programmer, so I'm used to doing things the hard way. But even I think that THAT level of masochism is just CRAZY!

    If you really want to understand the nitty gritty of how CPUs work, can I suggest learning about FPGAs. These are general-purpose logic devices that can be configured to perform all kinds of complex functions. You can create your definitions using interconnected logic gates, state machines, and even sequential programs. The development software is pretty advanced, and in some cases you can get it for free. Companies like Altera, Lattice and Xilinx come to mind.

    Altera have an interesting product called the Nios - a CPU that can be instantiated in an FPGA. It comes in several different versions, to suit different processing demands, and multiple copies can be combined in a single device, along with RAM, ROM, customisable glue logic, and other peripherals. It's really quite amazing. There's at least one C compiler that generates code for the Nios. Other FPGA companies probably have similar products, and you can obtain FPGA IP (intellectual property) for standard cores such as the 8051; some of these IP cores are free and some aren't.

    Whether you want to teach yourself, or whether you do a course, for hands-on learning and deep understanding of how CPUs operate, an FPGA is by far the quickest, cheapest and easiest way to go.
    foTONICS likes this.
  3. kpatz


    Feb 24, 2014
    You can bake a cake by growing wheat, making flour, growing sugar cane, raising chickens for the eggs, etc. Or build a house by growing a bunch of trees. You could make a RAM from transistors too, but it would be complex and unwieldy. Read up on the history of computers, and read about machines built from transistors (or even tubes) that filled a large building and had maybe a kilobyte of RAM.

    Then read up on FPGAs if you want to "construct" your own RAM or CPU in a more efficient manner.
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    Or you can look up computers like the "Educ-8" which had a total board area about the size of an A3 sheet of paper (maybe more) and implemented an 8 bit computer with 128 bytes of RAM. This was made using CMOS ICs, so doing it with discrete components could easily increase the complexity by 1 or 2 orders of magnitude (10 to 100 times).

    There are designs for digital clocks made with discrete transistors. They are pretty simple compared to a computer yet they are roughly the same size as an A4 sheet of paper.

    This would be a *huge* job.
  5. RaulJ


    May 6, 2014
    Okay, thank you very much for your replies, it helped me and i will see what I can do :D
    All the best.
  6. foTONICS


    Sep 30, 2011
    +1 for the FPGA tips, I purchased this book (follow link)

    This book is, obviously, heavy on the programming but it also teaches about RAM/ROM, addressing, half/full adders, ALU's, and everything else that could be used to build what you have in mind. You can also implement all of it on the same FPGA. I want to do more FPGA work so lately I've been reading the book from front to back and it does a good job of explaining circuit behaviour and how the logic is physically implemented.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day