I built my own computer. by hand.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] imagine a powerful computer only about five or six inches thin and like 18 inches long it would be a technological breakthrough of incredible proportions imagine it could run at least a couple programs to help your kids get ahead in school and to help you get ahead in business the new jdh8 it's now a figment of reality [Music] oh all right yeah it probably won't help your kids or your business or whatever and it sure isn't a technological breakthrough of incredible proportions but it's here it works and this is a little bit about how i did it [Music] so in case you aren't caught up from either of my previous videos let me just really quickly answer the question what the hell are you doing for you well what i'm doing here and what i've been up to for the past few months is building an 8-bit ttl mini computer with a 16-bit address bus 256 i o ports a 208 by 240 pixel black and white composite signal generated graphics card and writing some programs for it oh and the whole thing is going to be made out of these tiny little integrated circuits wired together by hand on breadboards [Music] now that might sound kind of complicated the computer is actually pretty simple and only has 16 instructions but needs to be able to do them exactly right every time here you can see the instructions the computer can execute including these two which store and load data from memory this instruction which moves data into registers the standard push and pop instructions for the stack these seven instructions that perform arithmetic operations two instructions for i o and the all-important jump instruction pretty simple right not that much to do well we'll we'll see about that so well now with the targets defined how did i even get started on this thing well let's go over to the initial design for my first video on this project which you should check out if you haven't seen and see how this actually gets implemented so the original circuit existed in logisim and was made up of these fancy logic symbols and nice looking circuits this unfortunately isn't enough to get started on a build before any wiring can happen the entire circuit needs to be converted into this format where the logic is segmented among different integrated circuits so they can actually be wired together on breadboards these are all the 74 series integrated circuits designed by texas instruments this conversion is absolutely not one-to-one and a lot of the modules had signals changed inverted and or simplified in the process and once the whole thing was converted i made this nice looking and relatively easy to follow master schematic for the whole thing unfortunately you can't really get any of the fine details over video so if you really want to go see this check out the github link in the description below all this stuff took a while but after all that was done though i could procure the chips to make the computer [Music] slap them down on some breadboards and get started wiring them together and since it would be kind of insane to build the whole thing at once the computer was fired first as nine independent and individually testable modules which were the video generator up here which operates nearly independently of the rest of the computer it only communicates via the video memory placed here the address module which computes the current memory address the arithmetic logic unit or alu which does all the math for the computer the auxiliary registers or aux regs module which contains the memory mapped registers those being the stack pointer the program counter and the memory bank register then we have the device interface module for device i o the operation counter or op c module which keeps track of and loads the current instruction the register file which sets up here and contains our eight general purpose registers then all this miscellaneous stuff including the clock and system rom and ram and finally the control signals this consists of some ebrams containing the computer's microcode which can change the control lines depending on the current instruction this is kind of the glue where the whole computer comes together with all those hopefully simple easy to understand modules in order though the video card was actually already built so when i started work on the rest of the computer there were just eight modules to wire easy peasy and using this module building strategy i got started on a stream in early september on the alu what's up what are you doing to the circuit today um i'm gonna be building the first part of the arithmetic logic unit or alu okay okay it's circuit time uh boys girls and envies um we're gonna we're gonna build this bacon rainbow yeah i wish you guys sorry you guys get to pick from the bad colors okay i'm gonna hook this up again and see okay no never mind it's back okay i guess that's what happens when you short um why is this being shorted oh that's why okay yeah i was just shorting all of my usb devices sorry about that no the short had nothing to do with resistors it had nothing to do with resistors it had to do with the fact that i took a power and ground wire and went like this with them one plus four does equal zero if you're operating in a mod five arithmetic but uh unfortunately uh that is not what we're doing okay now that it's clocked in there now we take the enable low for x then we clock four into y take the enable high for y [Music] and there we go it's five one plus four is indeed five right and well from that you can kind of guess how the rest of this build went if it took me three hours to build that little bit on a stream and there are nearly 30 boards with four to six chips each on them then well it took about two and a half whole work weeks to finish the thing that's not even mentioning debugging and well that's kind of just what the whole process looked like first i would measure some wires i clipped them then i'd wire things together until each module was constructed corresponding to the schematic and you can enjoy some nice wiring time lapses but obviously this isn't everything that happened [Music] all the modules were individually tested of course before being wired together but i don't really have any footage of that because you can only use so much time in a video on just wiring time lapses but eventually after everything was wired it was time to test i'm gonna hook it up to power for the first time and see if anything short circuits or explodes or catches on fire and test uh kind of works kind of works um but eventually in spite of the jankiness of my testing setup i was able to be reasonably sure that most of the instructions were working and so it's time to attempt to bring the computer up and have it run its first real program this took a lot of attempts the test program is going to display high and then a smiley face up in the top left corner if it works this is a test number two of my fully custom hand wired mini computer this chip right here it's a 74 244 and it should be a 74573 have completely different fin outs it's really uh really things up for lack of a better term okay um it's like two am this is test number 10. but eventually it worked which you'll know if you saw my last video it is uh 2 30 monday morning i am uh this is attempt like number 20 something of trying to get this thing to run and it's going to take a program that's loaded onto this eeprom which copies the bytes that spell out hi smiley face onto the leftish middle of the screen if it works the whole the whole computer is functioning i'm going to hook it up to uh to an arduino for power and through the clock signal and uh let's give it a go i'll just give the fast clock i think it's working there we go hi smiley face up in the top right oh my god holy it works it finally finally works [Music] after that i was able to run a full test suite on the computer that shows failure visually using the graphics card and i could get all the functionality of the computer tested it's actually pretty easy since the machine can only do 16 different instructions but 16 different instructions with two different operating modes across eight different registers and three separate memory regions leads to a lot of stuff to test but with all that in order though it was about time to get some more interesting software working on it i thought first i got this graphics test program running but i wanted to try something more interesting and unfortunately i didn't have time to connect any input devices before this video but i thought it would be fun to give a nice little winter themed proof of computation with this program that copies a black and white picture of santa flying over a landscape pulled in his sleigh by some reindeer and then computes the 10th fibonacci number and throws it up on the screen in binary so now that we have a computer like any good project post mortem let's ask ourselves what went wrong well maybe we should be asking what did not go wrong this thing is full of four design decisions so in order of increasing severity number one the gpu is designed around comparators that trigger sr latches in order to generate pulses of a specific length these should have been mono stables but i didn't know monostables existed at the time that i designed it number two io should have been memory mapped dedicating two instructions to it was silly number three a stack is fine in a non-multitasking computer it sure is useful but it was not worth the added complexity at all of the extra auxiliary registers the extra address calculations the stack should have been in software number four the alu was over engineered and could have been replaced by a single chip this one it took me two and a half days to wire and test and it would have had more functionality if i had just used this chip and i didn't make it myself and finally number five the worst sin of all and this one will take some explaining okay so in most computers access out to memory will be slower than processing data in a register this is why we have caches machines with lots of registers things like that to kind of like mitigate that slowness that is however absolutely not the case for this computer computers lots of registers that take only register arguments for most operations are called load store architectures and that's how i designed my computer however in this computer memory access is like a 20th of a cycle it makes absolutely no sense that the computer s8 registers like zero it should have had four registers an accumulator a program counter and flags maybe not even the flags register but everything else should come from memory this is by far the worst design decision of this whole project but in spite of these issues regardless of their severity it all works and that is what counts so if you want to know more about the precise details of the build i've made an hour-ish long lecture style video that's me explaining sort of off the cuff how the whole thing works if that's something you're interested in the link is down in the description but please enjoy this program to see you off running in beautiful black and white composite pixel graphics from a fully functional handmade and wired 8-bit mini computer oh also i'm going to be laying off the hardware for a while now this project took a little while but i think it's going to be back to software on my channel for now we might even see a return to gamedev but no promises as always thank you very much for watching and following me throughout the duration of this project see you in my next video you
Info
Channel: jdh
Views: 1,190,390
Rating: undefined out of 5
Keywords: electronics, graphics, 3d, circuit, programming, assembly, ben eater, breadboard, wiring, jdh
Id: vaGZapAGvwM
Channel Id: undefined
Length: 13min 2sec (782 seconds)
Published: Tue Dec 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.