Hello Raul and welcome to Electronics Point
Hello, I am a beginner in electronics and i would like to create an 8-bit computer, or something similar.
You're a beginner? Why not start with something simpler. Perhaps a spacecraft, or an MRI machine!
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).
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.