To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/mattbatwings/ You’ll also get 20% off an annual premium subscription.
Matt I got a question, could it be possible to play minecraft on a pc that is worse then the pc you made in minecraft, could u then do things on your pc in minecraft that you couldn't normally do on your pc?
3:10 Here is were your NOP is really useful. You can make your clock run faster by using NOPs to extend the time a instruction can run. Using as a example some instructions, A, B and C, that takes 2, 3 and 4 cycles respectively. You could have your clock running at 4 ticks, this would give time to the instructions to execute normally. But if another instruction D takes 17 ticks, you could add 4 NOPs after instruction D, so you will have 20 ticks of time. This way, you can have a faster clock, and when needed, you can extend the time for a single instruction using NOP. There is a small problem, but it is easily fixable. The zeros of the NOP could messy the execution of the instruction it is extending. To solve this, you could make your assembly language repeat at the operands of the NOP, the operands used at the instruction before it. There might be some other caveat I'm not thinking about, but this could help you improve the clock speed without needing it to follow the slowest instruction time, and neither needing to break every instruction into multiple cycles.
The main disadvantage of this is that a computer may want to have instructions that take orders of magnitude more cycles than others, for example a write directly to ram may take 1000 times longer than an add between registers. This is a problem because this drastically increases the needed number of instructions, which may be larger than the memory in cache, or in this computers case the main system RAM. It would probably work on this computer though, because there is a lot smaller difference between the fastest and slowest instruction. Another alternative would be a VLIW that stores the number of clock cycles in each instruction which would increase speed while not requiring a pipeline to decode this info.
@@williamsorenson1525Or use the empty operands for the nop for specifying waiting cycles 0 would mean just decoding, 1 will mean 1 cycle and 1024, 1024 cycles.
@@xoxogamewolf7585 No. It would be: 4 + (4 * 4) = 4 + 16 = 20. Because every instruction would have 4 clock cycles to work, but this specific instructions needs 17 of them to work properly. So you add four NOPs, each would take 4 cycles, adding 16 cycles to the 4 of the instructions, giving it 20 cycles to work. And with 20 clock cycles, a instruction needing 17 will work just fine.
Hibernation is a save state. You write contents of ram to disk to not loose it upon powering off. But it does speed up load time by contiguity for hdd and by applications not having to set up whatever they need from scratch
Your series is helping a lot, I was curious on how computers work, mainly on how assembly code would be converted to binary, and now that I know a little bit more, the knowledge is helping me understand more about building software, and on how libraries and frameworks works, thank you so much!
I'm not building these tutorials in Minecraft, but they sure are helpful for learning how it works and how to use it! I am using software to build a computer, and it has prebuilt the circuits I need. But I didn't know how to use them. This helped a lot!
Another analogy for memory hierarchy which I find quite useful is cooking. You could go to the shop every time you need an ingredient, but that would be very slow and inefficient. Instead you could store a small collection of ingredients in your fridge or pantry, and restock it from the shop every once in a while. Then, to make it even more convenient, you can put the ingredients you're currently using on the worktop so you can easily add more whenever you want, and put them away once you're finished
Couldn't you also just use a zero register with an offset to directly load memory from a specific address? Then you wouldn't need to load 0 into a register at the start... right?
@@mattbatwingsAcshually Acshually🤓🤓 since your subtraction uses two's complement and the data memory doesn't understand it, it will load bytes from 0 to 7 skip 8 then from 9 to 16
Imagine adding a USB port and WIFI using sculk sensors! You could make different input devices that work with the USB port and use them in the code! Like a keyboard or so. Somehow this idea really fascinates me...
I almost spent 5 years at University and still couldn't understand what a pointer is in programming or what it does. But thanks to you I understood it in 5 minutes. Thank you so much!
i swear someone WILL make a computer in minecraft... IN MINECRAFT. It will happen eventually and maybe, minecraft in minecraft in minecraft. MARK MY WORDSS
Your series inspired me to make a working computer IRL Even though your series is about redstone computer,still it help me understand different components of a computer
i decided to start on a computer based on the BrainFrick language, which just uses 8 simple instructions, but also has a decent capability. I like it more than trying to use an assembly language because the instructions are very easy to put into minecraft. It works really well in minecraft because it doesn't use addressing or anything fancy, just use a piston tape of copper bulbs with an adding circuit. The language only has 8 instructions: move pointer left/right increment value at pointer (took a while, but it works really fast) decrement value at pointer (flip bits, add 1, flip bits) begin "group" (skip if pointer is 0) end "group" get input append output
Something I wonder.... how difficult would it be making a computer where data is stored as hexadecimal values using comparitors and redstone strength instead of binary? I can imagine it could be quite the journey to take here....
I dream of a moment when I can express my gratitude beyond a mere like. I've subscribed and kept up to date on every video since I subscribed, but I regret I can't join your community further. These videos have done more for me than my entire digital design course. Thank you for continuing this content. I'm close to earning enough to join soon.
Hey MattBatWings! Your CPU videos are really well made and I've really been enjoying them so far. I have now set myself the challenge of making a C compiler that will turn some form of simplified C into your assembly language then into your machine code for your CPU. I've made an emulator and an assembler in cpp so far. It's a very rough start but the assembler works for those programs you have on your GitHub. The C compiler project will be tracked on my GitHub if you want to check it out. I'm looking forward to your next video :)
What happens if you try to use a negative offset from too early? For example: LOD r0 r1 -8? I assume the addition wraps around and you get the byte eight from the end, right? Could be a cool trick to optimize loading
To improve speed, but would drastically increase size, look up 256k memory redstone video, he uses instant wires able to do memory instantly acrossed any distance and can store, well 256k
The speed hierachy still holds in the abstract even when cpu and ram run at the same rate due to the need to load more bits to address the larger store. It'll always get you.
My memory is built completely different No matter how much more storage is built its the same speed But it's slower with more registers And I'm on bedrock
What i dont quiet get until bow is the timing of all of this. Are the data lines already filled with data upon writing or do the signals come at the same time. Is there a set delay for each command? Same goes also fore writing back into a register. The storing of the calculated data needs to happen after a set time right? Prior data on the data lines could be wrong
Hey Matt, are there reasons you don't utilize redstone instant lines to speed up some of your computer components? I know of a couple using pistons and rails, I wonder if you don't use them for compactness reasons or for something else
Is this really necessary ? I mean I can't think of a programme that would need that much storage. What I want to say in the and is what features or helps I am lacking if I make a computer as I planned - where the first 256 slots of the instruction memory are used for registers ? (Instructions can be written in the all of the memory, register though, are limited to being in the first 256 slots because of the way I made my instruction set) Love the videos - Makes my brain go even though I am not actually building anything (yet) !
There's no way to distinguish between numbers and instructions. That's why he made them separate, so there's a instruction's register, where all instructions are stored, and there's the data memory and register's bank, to store information. On real life computers, they often make them together, but some part of it, usually the start, stores the instructions. And another one, usually the end, stores the data. And if you are asking about the data stored in the registers, and how you know if it's a number or an address, the answer is the same... you don't know. It's up to the programmer to know if some register is storing a number or an address.
but don't 8 bit computers regularly have a memory map of some sort? where the instructions and the data are in one ROM and addresses are divided between them.
A memory map takes a large bank of memory and maps it into a smaller address spaces. Ex: 65536 byte memory bank takes 16-bits to address. Memory map would basically take the high 8-bits and store hang on to them. When the program wants to read from memory it would use an 8-bit address that then gets combined with the high 8-bits to make the full 16-bit address. Modern memory mapping has more features and functionality, but this is the idea they are expanding on.
One more bit in address space doubles the amount of addresses, as you can set that bit to 0 for each address and to one for each to get a different location.
There are 3(+?) ways you could go about this: 1. More bytes in the registers, which would mean you have to redesign your op codes (because more bits for LDI) 2. Use 2 registers instead of 1 to address on 16 bits instead of 8 bits. Again, needs you to redesign your opcodes. 3. Dedicate one of the RAM addresses to switching to a different Data storage (which is then called a Bank). Actually easy to set up (just use a multiplexer)
Would we also need to make the destination for STO become 0000 (zero register), so that it doesnt store A+offset or anything else into a register, since we cant just disable it because its needed for reading RegA
Yeah! In the real build, the mux for the destination is 2 bits, 01 10 and 11 for the 3 selections. If you do 00, it won’t select anything. So 00 is used on a store.
@@falihrahmandha364in the case of the data memory they’re used to give signal strength 1, allowing even the weakest part of the dust tower cancel all the comparators in general, you can use a barrel to create any signal strength from 0-15 , depending on how many items are in the barrel
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/mattbatwings/
You’ll also get 20% off an annual premium subscription.
Men
CONGRATS! This is your 100th video!
Could you make it so you have a download line where f.e. the terris code gets installed on the pc by putting binairy trough one line
Matt I got a question, could it be possible to play minecraft on a pc that is worse then the pc you made in minecraft, could u then do things on your pc in minecraft that you couldn't normally do on your pc?
hi mattbat can you help me whit redstone plz?(i know binary alredy)
3:10 Here is were your NOP is really useful. You can make your clock run faster by using NOPs to extend the time a instruction can run. Using as a example some instructions, A, B and C, that takes 2, 3 and 4 cycles respectively. You could have your clock running at 4 ticks, this would give time to the instructions to execute normally. But if another instruction D takes 17 ticks, you could add 4 NOPs after instruction D, so you will have 20 ticks of time. This way, you can have a faster clock, and when needed, you can extend the time for a single instruction using NOP.
There is a small problem, but it is easily fixable. The zeros of the NOP could messy the execution of the instruction it is extending. To solve this, you could make your assembly language repeat at the operands of the NOP, the operands used at the instruction before it.
There might be some other caveat I'm not thinking about, but this could help you improve the clock speed without needing it to follow the slowest instruction time, and neither needing to break every instruction into multiple cycles.
The main disadvantage of this is that a computer may want to have instructions that take orders of magnitude more cycles than others, for example a write directly to ram may take 1000 times longer than an add between registers. This is a problem because this drastically increases the needed number of instructions, which may be larger than the memory in cache, or in this computers case the main system RAM. It would probably work on this computer though, because there is a lot smaller difference between the fastest and slowest instruction. Another alternative would be a VLIW that stores the number of clock cycles in each instruction which would increase speed while not requiring a pipeline to decode this info.
17 + 4 = 20?
@@williamsorenson1525Or use the empty operands for the nop for specifying waiting cycles 0 would mean just decoding, 1 will mean 1 cycle and 1024, 1024 cycles.
@@xoxogamewolf7585 No. It would be:
4 + (4 * 4) = 4 + 16 = 20.
Because every instruction would have 4 clock cycles to work, but this specific instructions needs 17 of them to work properly. So you add four NOPs, each would take 4 cycles, adding 16 cycles to the 4 of the instructions, giving it 20 cycles to work. And with 20 clock cycles, a instruction needing 17 will work just fine.
@@gabrielbraz9669 yeah i have literally no idea what you're saying
I'm over here just watching shorts all day and this mf is building a computer in minecraft
then don't watch shorts all day, and spend 10 minutes of it to learn redstone computers, you will learn and achieve something.
@AerisRG @MarkCoding-C
That is indeed a good idea, though motivation is hard.
Also why did you insult him ?
@Youte12Youte mf is not insult in some cases. In this case mf is like "insane dude"
@Youte12Youtereplying to two people at the same time
wait... my name is not mark
As you said, there is more layers of memory: registers, CPU cache (3 layers), RAM, disk, network
and databases in that network have their own levels of caching
@@deltamico yup u can use ssd as cache if u got petabytes in harddrives
Hypernation caches in disk though doesnt it, or its just a save state
Hibernation is a save state. You write contents of ram to disk to not loose it upon powering off. But it does speed up load time by contiguity for hdd and by applications not having to set up whatever they need from scratch
Your series is helping a lot, I was curious on how computers work, mainly on how assembly code would be converted to binary, and now that I know a little bit more, the knowledge is helping me understand more about building software, and on how libraries and frameworks works, thank you so much!
did this ever touch on libraries?
@@deltamico No, but it gave me some ideas on how libraries or frameworks can work
I'm not building these tutorials in Minecraft, but they sure are helpful for learning how it works and how to use it! I am using software to build a computer, and it has prebuilt the circuits I need. But I didn't know how to use them. This helped a lot!
babe wake up matt uploaded a new video
Another analogy for memory hierarchy which I find quite useful is cooking. You could go to the shop every time you need an ingredient, but that would be very slow and inefficient. Instead you could store a small collection of ingredients in your fridge or pantry, and restock it from the shop every once in a while. Then, to make it even more convenient, you can put the ingredients you're currently using on the worktop so you can easily add more whenever you want, and put them away once you're finished
Couldn't you also just use a zero register with an offset to directly load memory from a specific address? Then you wouldn't need to load 0 into a register at the start... right?
That would save one more instruction. And IIRC this computer has a zero register, r0.
@SubatomicPlanets oh whoops yeah! I should have just used r0 and removed the first instruction. Thanks!
That works for situations where you're accessing the first 7 bytes of memory, yeah!
@@hyper_lynx Acshually 🤓 the first 8 (offset 0 to 7) and the last 8 (offset -1 to -8)
@@mattbatwingsAcshually Acshually🤓🤓 since your subtraction uses two's complement and the data memory doesn't understand it, it will load bytes from 0 to 7 skip 8 then from 9 to 16
Imagine adding a USB port and WIFI using sculk sensors! You could make different input devices that work with the USB port and use them in the code! Like a keyboard or so. Somehow this idea really fascinates me...
Better to use cubicmetre's wireless redstone at this scale
Agreed... but it's too technical for this build: it requires redstone's quantum physics...
Me: finally I can make a code door!
This guy:
These series are fire keep up the hard work!!!
Me: I can finally make a 2 by 2 piston door!
Other people:
Merry 100th-video-mas!! Love you.
These videos helped me a lot in my computer theory class tysm!
I almost spent 5 years at University and still couldn't understand what a pointer is in programming or what it does. But thanks to you I understood it in 5 minutes. Thank you so much!
10:33 write a compiler with the computers assembly and use that language to make more things lol
he already did that episodes back
I think he meant a compiler that runs on said computer, unfortunately in harward architectute it couldnt write the output anywhere
@@deltamico ohh yeah i misunderstood the comment
Cool tutorial man!
One of the best series I have ever watched! Such an amazing series, thank you for making it!
i swear someone WILL make a computer in minecraft... IN MINECRAFT.
It will happen eventually and maybe, minecraft in minecraft in minecraft.
MARK MY WORDSS
Your series inspired me to make a working computer IRL
Even though your series is about redstone computer,still it help me understand different components of a computer
i decided to start on a computer based on the BrainFrick language, which just uses 8 simple instructions, but also has a decent capability.
I like it more than trying to use an assembly language because the instructions are very easy to put into minecraft.
It works really well in minecraft because it doesn't use addressing or anything fancy, just use a piston tape of copper bulbs with an adding circuit.
The language only has 8 instructions:
move pointer left/right
increment value at pointer (took a while, but it works really fast)
decrement value at pointer (flip bits, add 1, flip bits)
begin "group" (skip if pointer is 0)
end "group"
get input
append output
Absolutely loving this series so far! Keep it up ❤
Something I wonder.... how difficult would it be making a computer where data is stored as hexadecimal values using comparitors and redstone strength instead of binary?
I can imagine it could be quite the journey to take here....
I dream of a moment when I can express my gratitude beyond a mere like. I've subscribed and kept up to date on every video since I subscribed, but I regret I can't join your community further. These videos have done more for me than my entire digital design course. Thank you for continuing this content. I'm close to earning enough to join soon.
I feel so relieved that Matt never runs out of brain cells
This video and other mattbatwings videos really helped me do redstone
9:47 Could the .skip label be moved to the DEC r14 line?
yes it could. nice catch
ok now we need another video
Hey MattBatWings! Your CPU videos are really well made and I've really been enjoying them so far. I have now set myself the challenge of making a C compiler that will turn some form of simplified C into your assembly language then into your machine code for your CPU. I've made an emulator and an assembler in cpp so far. It's a very rough start but the assembler works for those programs you have on your GitHub. The C compiler project will be tracked on my GitHub if you want to check it out. I'm looking forward to your next video :)
How hard would it be to convert this from the Harvard architecture to the Von Neumann architecture?
this is really useful
7:39 weird. Actually I did specifically make an optimisation on my compiler to variables under pointer 8, they'll simply offset from register 0.
thanks matt for mkaing these videos i luv coputer science and u explain it best.
What happens if you try to use a negative offset from too early?
For example: LOD r0 r1 -8?
I assume the addition wraps around and you get the byte eight from the end, right? Could be a cool trick to optimize loading
Mattbatwings just casually mentions reading 20 books a week is normal. Have you perfected the Uberman sleep schedule?
To improve speed, but would drastically increase size, look up 256k memory redstone video, he uses instant wires able to do memory instantly acrossed any distance and can store, well 256k
Thank you for taking your time so we can profit from it!
This is insane
The speed hierachy still holds in the abstract even when cpu and ram run at the same rate due to the need to load more bits to address the larger store. It'll always get you.
YEAH NEW VIDEO, THE CPU NOW IS FINALLY TURING COMPLETE!!! (except for memory)
that was so fun, hope sometime you would do pipeline processor
My memory is built completely different
No matter how much more storage is built its the same speed
But it's slower with more registers
And I'm on bedrock
will we learn cache? (in the future)
u make it so easy to learn computational redstone :)
ur the best
i cant even code an arduino propperly and this mf is building a gaming pc in minecraft
i think that making all processor asynchronously sequential will be faster so we wont need to wait for faster instructions :3
What i dont quiet get until bow is the timing of all of this.
Are the data lines already filled with data upon writing or do the signals come at the same time.
Is there a set delay for each command?
Same goes also fore writing back into a register. The storing of the calculated data needs to happen after a set time right? Prior data on the data lines could be wrong
8:00 register 0 is ofended by your words
5seconds after I rewatched almost the whole series
Hey Matt, are there reasons you don't utilize redstone instant lines to speed up some of your computer components? I know of a couple using pistons and rails, I wonder if you don't use them for compactness reasons or for something else
if you watch on linux you can put your 1mb/s hdd above your ram (i did it one time and it suck)
Hey matt, what's the se thing above the register in the diagram?
PPU! PPU! PPU!
100th video!!! 🎉🎉🎉🎉
Nice a 240 array of data is useful :)
Happy 100 Videos
So the reason you're so smart is you read 3 books a day. That makes sense.
Is this really necessary ? I mean I can't think of a programme that would need that much storage.
What I want to say in the and is what features or helps I am lacking if I make a computer as I planned - where the first 256 slots of the instruction memory are used for registers ? (Instructions can be written in the all of the memory, register though, are limited to being in the first 256 slots because of the way I made my instruction set)
Love the videos - Makes my brain go even though I am not actually building anything (yet) !
I still want a respond to my question, though I have changed my plans, so I will indeed use a data memory.
lets thing to add to a computer in minecraft: multi threading
Personally, I prefer CISC. No need for load and store, just one simple move instruction.
keep this going🙏🙏🙏
Question: how do i distinguish bianary instructions from numbers? Do i need an extra bit in memory to detect this? Like a instruction or not memory?
There's no way to distinguish between numbers and instructions. That's why he made them separate, so there's a instruction's register, where all instructions are stored, and there's the data memory and register's bank, to store information. On real life computers, they often make them together, but some part of it, usually the start, stores the instructions. And another one, usually the end, stores the data.
And if you are asking about the data stored in the registers, and how you know if it's a number or an address, the answer is the same... you don't know. It's up to the programmer to know if some register is storing a number or an address.
but don't 8 bit computers regularly have a memory map of some sort? where the instructions and the data are in one ROM and addresses are divided between them.
A memory map takes a large bank of memory and maps it into a smaller address spaces.
Ex: 65536 byte memory bank takes 16-bits to address. Memory map would basically take the high 8-bits and store hang on to them. When the program wants to read from memory it would use an 8-bit address that then gets combined with the high 8-bits to make the full 16-bit address.
Modern memory mapping has more features and functionality, but this is the idea they are expanding on.
How many bits do i have to add to each instruction to double storage? Is it a one to one or exponential.
One more bit in address space doubles the amount of addresses, as you can set that bit to 0 for each address and to one for each to get a different location.
There are 3(+?) ways you could go about this:
1. More bytes in the registers, which would mean you have to redesign your op codes (because more bits for LDI)
2. Use 2 registers instead of 1 to address on 16 bits instead of 8 bits. Again, needs you to redesign your opcodes.
3. Dedicate one of the RAM addresses to switching to a different Data storage (which is then called a Bank). Actually easy to set up (just use a multiplexer)
I was wondering something, Then I answered it to myself
Great video! Peace out
Would we also need to make the destination for STO become 0000 (zero register), so that it doesnt store A+offset or anything else into a register, since we cant just disable it because its needed for reading RegA
Yeah! In the real build, the mux for the destination is 2 bits, 01 10 and 11 for the 3 selections. If you do 00, it won’t select anything. So 00 is used on a store.
@@mattbatwings awesome thanks, I figured it would just be the mux lines set something like that.
Thanks
made me cryed
Baby come here, we'll finally find out how he converted 4 signed bits to 8 bits for the offset!!!
*_Respect to bro._*
His talent :🗿
nice
Isn't it easier to make the destination in the end, for building the fisical computer, like, most instructions have it in the end
I can't wait for you to make bad apple on this thing!(if you don't, YOU made a bad apple of yourself ) /j
Yippe!!! New video ❤🎉
best vid
My favourite operation is the one that compiles to 0000110101001011 (NOP r13 r4 r11)
Hi
SUPER CHALLENGE: make an AI in minecraft
I rly gotta catch up I’m still on the call stack
What's the purpose of a barrel
Provide power to the comparator which locks the repeater
@harrazgamingyt I thought it's more complicated than that, like providing specific amount of signal strength
@falihrahmandha364 yes but only signal strength 1
@@falihrahmandha364in the case of the data memory they’re used to give signal strength 1, allowing even the weakest part of the dust tower cancel all the comparators
in general, you can use a barrel to create any signal strength from 0-15 , depending on how many items are in the barrel
Hello matbat
First to watch this 🔥🔥🔥This is fire keep going
Wow Crazy
Error: segmentation fault (core dumped)
image a von Neumann redstone computer
After 12 hours😮
100th video !!!
Can it run ai?
Technically it would be possible, but he would probobly need more storage
@@cookieeater1010 ima try to make that
thank you
I love it
Is a register,ram,alu still a computer at this point
yay
Bro you could program in C or Python to make things easier
First!
But can it run doom?
Hey, I just want to note that for me it made it much less understandable that you removed the control rom. :(
Ok, but can it run Doom?
helooo
I was 7th watching
every minute 50 people watch this lol