Posts

Packaging CustomAsm for Ubuntu

Image
I'm using CustomAsm to compile code for my  8-bit-CPU . It works quite nice locally, but I thought it would be nice, if I could also run the compilation as part of GitHub Actions workflow. I will not go into deep details about how to set up those workflows, there's documentation for that. Basically you create a .yml file in your Git repository for GitHub to act on. There's a choice of OSes for the workflows to run on, my selection is Ubuntu. There's a slight issue, though. CustomAsm is a Rust program and normally it is installed using cargo install command. To do that, each time I'd have to install Rust, compile CustomAsm and only then I'd be able to use it. It might work, but there's too much of preparation. Wouldn't it be nice, if I could just apt-get install customasm and be ready to use it. That's what I'm about to enable. Ubuntu Personal Package Archives In order for package to be installable in the runner , it must be available at pub

8-bit CPU: Playing with FETs and new Display module

Image
My previous improvements on Display module left me a bit disappointed. The brightness of display just was not good enough. I could not push enough current into the LEDs. I purchased a batch of more efficient 7-segment displays, but I still want to make the old ones work.

8-bit CPU: It's alive!

Image
With updated version of Clock module complete, the only thing missing is the Control Logic. Let's build it to complete the CPU. Control logic The main idea of the Control logic is the same as in Ben Eater's CPU, with the difference that I'm using 28C64 EEPROMs. The address line usage is a bit different, through: 3 lines from microstep counter, allowing 8 microsteps in total 4 flags from Flags register 6 lines from Instruction Register, allowing 64 instruction opcodes This uses all 13 address lines, whole 8 KiB of the EEPROM, no room for byte-select bit, the contents of each ROM will have to be different. Notice, that I moved Flags bits to the middle of the input address. I like this layout better, because now all bytes for an instruction are grouped together. It also allows for easy expansion to 256 opcodes, the data layout will stay the same, I'll only need to replace EEPROMs with larger ones (28C256) and connect remaini

8-bit CPU: Quarter-Clock

Image
My Clock module worked fine (to be honest, I did not use it that much), but I have some new ideas to try out. Also, as I'm approaching the end of first stage of my build, the requirements for the Clock has changed. I could try to "patch" the existing module, but it's actually easier to re-build it on a new breadboard.   At first, however, I had to play around with Digital simulator, it might have been quite hard to iron out the details building hardware directly. Here's what I came up with: There's a lot is going on, I'll try to explain step by step.

8-bit CPU: Generating machine code

I developed some demo programs using an assembly-like constructs in Python. All is nice and it utilizes real hardware for calculations. Still that is just Python code running on PC and sending control signals to my registers, ALU and memory. Eventually, I'll have to run the code on the 8-bit computer autonomously. For that I need to convert it to sequence of binary instruction opcodes and arguments - machine code. I've also tried to hand-assemble some simple programs, but it feels quite tedious and error-prone.

8-bit CPU: Putting it together

Image
Looking at modules I have built so far, I realized that I have almost all I need for a complete computer. Long time ago I built Clock module and Program Counter . I've just updated Output module , There's ALU, 2 general-purpose registers, Flags register . Also I have RAM module and MAR register . I even have an Instruction Register. What's missing? Control Logic, of course!

8-bit CPU: Display updates

Image
The display module turned out quite nice, but there were some flaws I wanted to fix. In order to connect the module to the Computer, some additional hardware has to be added as well. Flicker I noticed that with a corner of an eye I can catch some flickering, but when I at it directly, it appears to be fine. Ben used 10 nF capacitor and 100 K resistor with 555 timer. I had no 100 K resistor, so I used 330 K instead. If we put the values in NE555 calculator , it gives around 218 Hz. Each display switches 4 times slower, resulting in 54 Hz. My eyes have always been sensitive to flicker, I remember when old CRT monitors gave me headaches with their 60 Hz. After short consideration I replaced it with 10 K resistor. It pushes up the frequency to almost 7 kHz. While this may feel as an overkill, all chips are rated for much higher frequencies than that. And now there definitely is no visible flickering. Mode indication I found out that it is a bit confusing not to know in which mode