Hello and welcome back to my Minecraft computer so I know it’s been a really long time since the last time I posted anything about it and that’s because it’s been a really long time since I’ve done anything with it uh I just haven’t really had time and hadn’t completely Forgotten about it but um there were a lot of other things that just were ended up being more important so uh where I left off I had built the ALU so this has the ability to do addition sub traction as well with that um bitwise and or not Shift left and shift right and I explained more deeply about that in a previous video it has two inputs for these it has uh I labeled them as rs1 and rs2 that’s register Source One and register Source 2 we’ll get more to that in a bit and there is a control unit Here or part of a control unit it’s not completely finished yet that takes four inputs in binary four bits and that code then selects which of these uh which output from which of these operations Will Go On To The Next Step so that’s what all this Is and then there’s this part this is where there’s been some progress so I’ve done a little bit here and there and uh this is the new part that I have not covered yet so that’s what we’re going to focus on right now so first of all We’ll start over here and then we’ll work our way back towards the other stuff these are the registers so the way many computers work actually probably most CPUs work is that they have a set of registers inside the the CPU and basically this is the memory That the CPU has and there’s usually not a lot of it so for mine I only have 16 um so each one of these is a memory slot that’s numbered here 0 through 15 and each one holds 16 bits because this is a 16bit computer and that is represented by Whether or not there is a redstone brick um in that spot so right here so if we go to like this one actually let’s go to this one as an example this is a zero this is a zero this is a zero because there are no redstone blocks sitting on those copper Blocks uh if we go to like one here this is a one this is a one this is a one and so on the rest of that we’ll get to you in a second so all of this serves as the memory of the CPU if you need something that takes More memory than that which most computers do then what it does is it pulls from a slightly farther set of memory slightly farther away set of memory that has more storage um and those are called caches and there’s different levels of those but basically the idea is the smaller the amount of Storage the faster it can run because it doesn’t have to send signals as far and it doesn’t have to search through as many things so the idea is to prioritize having the most used things in the smallest possible and closest memory storage so the registers are the is the Smallest possible in the closest memory storage I don’t know at this point if I will add any caching or anything to this because I’m more doing this for fun I don’t really care if it runs like real programs or not and that’s just a lot of Work so we’ll see but this is enough to run some like simple mathematical ma uh I don’t know some algorithms for fun so the way that this works a note about a change that I made to the design philosophy of this is that I realized I Was not going to get it finished in any reasonable amount of time because of the amount of time that I have to work on it if I was actually running basically physical wires everywhere like this so I decided to switch approaches so for the rest of it what I will do is have Command blocks that just set a redstone block in a different place so the command blocks are not contributing to the logic of the computer at all all of the actual logic and all of the actual data storage and everything will be done using like normal Redstone all that these do is just like Sets a block I don’t know why I did fill and not set block oh actually I know why I did that because this fills a uh fills them in a column um but by doing it this way oops by doing it this way it will save a Lot of time and I don’t really consider it cheating in my opinion because it’s not contributing to the logic at all um and at some point maybe I’ll go back and fill in all of the Redstone wires between everything um but this is more just for the fun of it anyway so it’s Not really meant to be the most efficient or the most like ideal necessarily so that’s the decision that I made so when information comes from the ALU it comes through here and over here this the control unit like I mentioned controls which of these operations which output gets sent to the storage So this part here all of these blocks these will get if this uh if this has a redstone block um it’s actually not implemented fully yet some of this is still not fully implemented but what will happen is there will be another control signal that controls whether or not information is saved Because not all not every operation will save something in memory sometimes we’re just loading a different instruction or we do an instruction that doesn’t necessarily have an output so if we have an output there will be a special signal that will allow the output through and this mess of things here This controls where in which register it saves the output to so each of these columns here sends the output to a different register and all of this logic before this decides which register that output gets saved to and that gets controlled by this so if we take some Redstone here Let’s say we want to save this in the sixth place the sixth register so that would be this cuz that’s six in binary 0 1 1 Z so as you can see here it filled in all of these redstone blocks these columns in different places what that’s doing is it’s basically blocking the Different signals to different places in this tree so that it only is going to allow the signal to get through and go to the um the sixth one so this should be 0 1 2 3 4 5 6 so it should be allowing the signal through to here I Believe well maybe not um I have not touched this in a while so I’m going to have to double check where I left off and make sure that everything is fully implemented because stuff may not be fully implemented correctly yet once it get saved however we can Come over here to one of the registers and we can see that there’s a lot of stuff going on around this so we have this this set of command blocks here we’ve got another one over here and we’ve got another one up top and all of these signals are blocked by these bone Blocks why bone blocks I don’t know but what’s going on here with this is that these are the three outputs basically these are as if these are these wires are connected to the register Source One and register Source 2 that we had over there going into the ALU those as well well as we’ll have another we’ll have another uh register um Source basically that will be for reading the instruction and that’s controlled by these so if we place something here that will replace uh that will allow this signal through and then if we power this Here that will put that back and allowing that signal through will set the value that was in memory here to the register that was over here so as you can see since that was all ones we get all ones over here and so that is how my wiring system Works just cuz it’s a lot faster but effectively it’s still it’s the same as as if another uh instead of command blocks we had actual just Redstone lines running all the way over there effectively that’s what it’s doing so by allowing that through by setting that we can load a specific register Into either the one of the two memory slots or one of the two um inputs for our ALU or we can load it in as an instruction but the instruction part isn’t built yet not completely some of it is part of it is there um but I also had to figure out what Were we going to do with output for like showing the user so I decided that the first the the zero register the first register so to speak um will be our display so anytime you want to display an output you just save it to this register so this register you notice it Doesn’t have the copper blocks underneath instead it has more Pistons so if we go under here you can see that there are pistons and then there’s more Redstone down here and that moves these into place to transfer that memory into this display so whatever is in register zero Is what we see in the display there’s also an error bit and there uh there is a command where you can set the error bit to true or set it to false and that’s how we’ll catch errors and display errors so for example if you’re dividing by zero then you might you Would have to check in the code whether you’re dividing by zero and if you are then you can throw an error basically we can set that error and then just stop so that’s what our output will look like for programming it and this is not fully implemented yet but for Programming it we’ll have something like this where we’ll have another um another view and these should be um levers not buttons but basically you’ll enter in the number that you want to save you’ll enter in the address that you want to save it at and then you’ll click either save or Clear or one of the different options and then you can add that number very easily into the register and that’s how you’ll program it because this stores both commands and numbers because commands are actually just numbers that’s all that they are um we’ll get to that in another Video actually that I’ll I’ll be putting out at some point fairly soon um because I’ve written some software on the side to help make the translation easier uh into the the binary code for this but that’s what I have so far so it’s the progress is slow but a lot is Already here so there um if we we can now actually look at kind of the overall flow of how the computer should work so the main thing that’s missing is the control unit needs to be expanded a little bit so it can re fully read an input and know what to do With it um then it will send that the based off of the instruction it will choose two different registers potentially send them through the ALU send that result to another register and then there will be a clock which I think I’m going to put the Logic for that over Here cuz the clock is going to have to have some memory to know what register we’re on and the way that that will work is there will be it’ll keep track starting at 1 I’m going to have it start at 1 because zero is our display so that’s always Going to be a number not a command so we’ll start at one our first command should start at one and every command it runs after that command gets done it’ll move on to command number two and so on unless you spe specifically use an instruction that tells it to go to a Different instruction in which case it’ll pick up from that point and continue on uh adding one each time when it gets to the end uh it’ll just restart from the beginning because mathematically and architecturally that is much easier to implement so um and that’s pretty normal for how computers Actually work that’s how things get stuck in infinite Loops so that is what I have so far there has been some progress made but maybe not a lot Video Information
This video, titled ‘Building a Computer in Minecraft Part 2: Registers’, was uploaded by ConCATenatedStrings on 2023-12-14 22:35:36. It has garnered 32 views and 4 likes. The duration of the video is 00:14:04 or 844 seconds.
I know it has been around a year since I last uploaded a video about my computer, and that’s because I haven’t had much time to work on it since then. However, I have been able to add the next major piece to the CPU, which I describe in this video.
0:00 Intro and Recap 1:29 Registers 3:49 Change with wires 5:19 Saving to registers 7:50 Reading from registers 9:55 Display 11:13 Programming Console 12:14 What’s left?