CPU flags register

  Рет қаралды 290,882

Ben Eater

Ben Eater

Күн бұрын

Пікірлер: 490
@jamesd.4842
@jamesd.4842 6 жыл бұрын
Wow the new graphics really add a lot to the video. Its amazing to see the growth not only of the computer but also Ben's video design, execution and editing skills as well.
@abdelrahmangamalmahdy
@abdelrahmangamalmahdy 6 жыл бұрын
he's a legend
@ajreukgjdi94
@ajreukgjdi94 4 жыл бұрын
I'm implementing a JFT (jump if forty-two) in my CPU, and nobody can stop me. The ultimate answer is that important
@mohammedjawahri5726
@mohammedjawahri5726 3 жыл бұрын
The only truly turing complete computer
@kenrickman6697
@kenrickman6697 10 ай бұрын
Old comment, I know, but oh well. Wouldn’t that make the computer Pratchett complete? Or would that also require a mouse?
@ajreukgjdi94
@ajreukgjdi94 10 ай бұрын
@@kenrickman6697 Adams?
@richiebarnes3038
@richiebarnes3038 3 ай бұрын
you ever see a 42 year old jump lol
@ajreukgjdi94
@ajreukgjdi94 3 ай бұрын
@@richiebarnes3038 I bet Johanna Quaas jumped at least once while 42
@Wanttoknowabout
@Wanttoknowabout 6 жыл бұрын
Please never be done!
@usern4m32
@usern4m32 6 жыл бұрын
I hope it to be pluged onto a TV screen with a keyboard, one day...Esperantanaso did it, but he didn't explain it's work.
@aqbaplaygames3435
@aqbaplaygames3435 5 жыл бұрын
@@usern4m32 oh man I hope it'll once utilise internet
@ducksonplays4190
@ducksonplays4190 4 жыл бұрын
My breadboard computer im making could use 255 graphics cards and use up to 16 mb of ram and run at 10 mhz :D and a keynote and mouse so that's neat
@gatedrat6382
@gatedrat6382 3 жыл бұрын
@@ducksonplays4190 what do you mean by 255 graphics cards?
@ducksonplays4190
@ducksonplays4190 3 жыл бұрын
@@gatedrat6382 that was an ages old comment that i dont remember and that was my old inefficient design
@pablossjui
@pablossjui 6 жыл бұрын
Total Time of the whole series by now: 11h 36m 03s
@AnastasisGrammenos
@AnastasisGrammenos 6 жыл бұрын
I can confirm that, as a cs student myselft.
@biehdc
@biehdc 6 жыл бұрын
not a single second of live wasted
@marekl8805
@marekl8805 6 жыл бұрын
I guess there is a lot of room for improvement in our eductation system. And also a lot savings in the spendings of our taxes money..
@cthree87
@cthree87 6 жыл бұрын
Maybe the best 11h 36m 03s KZbin has to offer.
@usern4m32
@usern4m32 6 жыл бұрын
@@cthree87 surely
@levvayner4509
@levvayner4509 6 жыл бұрын
So .. the real question is.. when are we going to have us a Ben Eater computer spin-off competition!? It looks like Ben got a lot of people into building 8 bit machines :)
@BenEater
@BenEater 6 жыл бұрын
It's really cool to see the different directions people have taken this project. It's definitely the sort of thing that-as the comments here indicate-can be improved on in tons of different directions. I've lost track of all the different projects I've seen, but there's some truly impressive stuff going on! I definitely encourage everyone to post videos, pictures, etc.
@levvayner4509
@levvayner4509 6 жыл бұрын
Human ingenuity is awesome; it just needs a kick start sometimes. Ben, on a very personal and serious note, I would like to thank you. I stumbled onto your video in December and couldn't stop watching. As a result, I fulfilled a childhood passion.. really, thank you x 1000! On a silly note, you must have more strict time constraints than some of us.. I've evolved mine already quite a bit further than this :-) If there is a place you have for uploading pictures (of spin off projects), I'd be happy to do it there, but otherwise I really don't post content anywhere except Facebook (and those are mostly copy+paste memes).
@levvayner4509
@levvayner4509 6 жыл бұрын
And.. I'm sure it is easy to lose track with so many people inspired by you, out there chizziling away. I took a sightly different approach than most; I watched what you did, but then I tried to build the logical connections myself between components, signals, etc. What happened as a result, with time, my computer deviated more and more from what you were doing. By the time I got to MAR, I didn't use any RAM at first, it was just a 2K EEPROM. I expanded my op codes to be all 8 bits of the program counter, so I can do 256 instructions. I added a second byte to some instructions where data needed to be passed along with the op code. I used some decoders to multiplex my control rom signals, so I have bits 9 and 10, one to signify an active Read from bus and another for active Write to bus, and divided lowest 8 bits of the Control Matrix ROMs into 4 bit nibbles, each encoding 1 of 16 read and write sources. So with my lowest 10 bits, I am able to read and write (toggle load and out signals) for 16 devices. I added some registers, so I have A, B, C, and D. I have designed for SI and DI, but have not added these. I used the next three control signals (bits 10 - 12) to control another EEPROM for conditional logic. That one takes in flags register and control signals as input. Yes, added flag register. I then added segment registers (CS,SS,DS,ES) with the two next bits (bits 13 and 14) of the control rom used to select which are active. I added a stack pointer with some increment decrement, read and load control lines. I expanded my MAR to use the EEPROM for the lowest 2k, but an SRAM chip if the address is > 2k. I've recently tested this thoroughly and have the ability to create conditional statements, make calls/rets to/from procedures. I've now shifted a bit to the programming side of things. I am working on my assembler. Just finished my first version yesterday :). Probably a lot of less significant changes that I'm leaving out, but the fun stuff is just now coming. I plan to add input for parsing keyboard scan codes (probably will use ps2). I've started learning/working with FPGA to add a video card to this thing :) Thanks again for all the fun you've added to my life :D
@Byefriendo
@Byefriendo 6 жыл бұрын
@@BenEater Im makin one in minecraft lmao, redstone is super versatile
@Mr_Happy_Face
@Mr_Happy_Face 5 жыл бұрын
@@Byefriendo how would you make all the logic gates and flip flops in minecraft? especially the EEPROM, how would you build that in minecraft?
@danidiaz9510
@danidiaz9510 6 жыл бұрын
You people can't imagine the rush of dopamine I just got. Here we go again!
@RogerBarraud
@RogerBarraud 6 жыл бұрын
Yusss!!!!11!! :-)
@masthisis3914
@masthisis3914 5 жыл бұрын
I can...
@wiz7716
@wiz7716 5 жыл бұрын
exactly .... I was trying to find the suitable word to describe the euphoria I am having just by watching it!
@gorillaau
@gorillaau 5 жыл бұрын
Penny is in the air.... Penny drops. I am amazed how I don't really understand this material at the beginning, but do at the end.
@isbestlizard
@isbestlizard 5 жыл бұрын
i am hooking up power and ground to things in my sleep now ;D
@djalbrig
@djalbrig 6 жыл бұрын
Fantastically produced video - they keep getting better! Congratulations and thanks for the hard work that goes into making these videos.
@bakkasur9614
@bakkasur9614 6 жыл бұрын
Awesome teaching. This is the way to teach.
@nockieboy
@nockieboy 6 жыл бұрын
Love the new graphics Ben. Makes it all much clearer - in fact your videos are extremely well done and getting better all the time.
@TYKUHN2
@TYKUHN2 6 жыл бұрын
All your flags (in the register) are arithmetic based. As such they are only updated when an arithmetic operation is performed which, by design, requires a Sum-Out control flag. You can conserve a bit of EEPROM by using Sum-Out to control the Flags-In signal.
@BartoszBanachewicz
@BartoszBanachewicz 4 жыл бұрын
Exactly what I thought when he made the flags register. At first I incorrectly assumed that AI could be used, but then realized that LDA shouldn't actually clear the flags. EO is completely fine, though, and would definitely save some wiring and programming. Even if a more complex ALU is added, FI would then be an "or" of all ALU output control bits.
@gideonmaxmerling204
@gideonmaxmerling204 4 жыл бұрын
he could also make alu instructions which don't change the A register
@rogerhueppin2995
@rogerhueppin2995 4 жыл бұрын
How about connecting AI and EO to G1/G2 respectively, so only instructions which use the Sum-Out AND A-In result in changing the flags content.
@emberleona6671
@emberleona6671 4 жыл бұрын
I think he did it right you don't need to output register to set overflow but he should have put the negative and twos complement logic since the display can output a negative number
@jan_en_ik
@jan_en_ik 4 жыл бұрын
I think he did it this way so that he could add flags that have nothing to do with arithmetic
@jasonzurlo1543
@jasonzurlo1543 6 жыл бұрын
I've been waiting so long
@AudreyAzura
@AudreyAzura 6 жыл бұрын
I discovered this project recently and get through it in about a week. I only have one thing to say: thank you so much for doing this serie. I always was curious on how a computer was working, how it could carry these instruction, and never really get to read the complete manual. These videos gives a really good idea of what is happening, and basically answer all the questions I could have had. Thank you so much for making them, this is an awesome project and probably one of the best playlist on youtube.
@witchofengineering
@witchofengineering 5 жыл бұрын
Watching Your previous videos I thought, that they have the max value on the production-quality-meter, but this video just added a carry bit to it's output
@garydunken7934
@garydunken7934 6 жыл бұрын
Thanks Ben. It has been a long time! 28:45 cpu running an accumulator in an endless loop - the machine you built; I could watch forever!
@liberatemi9642
@liberatemi9642 3 жыл бұрын
Anyone this dedicated to communicating a subject proves that teaching is a calling, not just a “job”. You sir are an example of what people can achieve if they commit to a subject, and exercise discipline. Thank you
@kareemdabbour4680
@kareemdabbour4680 6 жыл бұрын
Can't believe you only have 117k subs! You desire so much more recognition Ben! Great Work, keep it up!!
@msjaxp
@msjaxp 6 жыл бұрын
Dude, you are awesome This the first lectures that contain practical explanations of what is going on in computers
@luigischiavone2232
@luigischiavone2232 6 жыл бұрын
Thanks for your wonderful job!
@domainshax5611
@domainshax5611 6 жыл бұрын
are u italian? xD, i love like u, his job
@luigischiavone2232
@luigischiavone2232 6 жыл бұрын
Domains Hax Si sono italiano 🤞
@infrakazos
@infrakazos 3 жыл бұрын
@@luigischiavone2232 luigi
@ninjalacoon
@ninjalacoon 6 жыл бұрын
I love this series. Your computer reminds me of the opening scene in alien with all of the nostromo’s boot sequence sounds and lights firing off. There is something really pleasing about seeing a machine at work.
@minikretz1
@minikretz1 4 жыл бұрын
Love the video editing with the graphics when you're adding wires!
@alexanderquilty5705
@alexanderquilty5705 3 жыл бұрын
I’m so glad you showed the math for the carry bit 😂 definitely really helps in understanding what is happening.
@squelchedotter
@squelchedotter 6 жыл бұрын
THANK YOU for not making this an April fools Video!
@ndvazly
@ndvazly 2 жыл бұрын
I’ve watched this whole series twice by now. First of all, gotta tell you, You are an AMAZING teacher. Thank you so much for that!! Secondly, your remark about the feedback-loop thing blew my mind 🤯. Been thinking the same thing about feedback loops for a while now (in a completely different context…) ❤️
@TW19567
@TW19567 4 жыл бұрын
Hi Ben, first of all thank you very much for your videos. You have inspired me to study electronics as much as possible and get my little boy into it as well. Once the world has stopped going crazy and things are a little bit more certain I feel must support you on Patreon. One thing I would like to point out is that I followed you every step of the way with building your 8 bit computer from scratch and was really enjoying it and understanding it. Until you introduced your Arduino into programming the EEPROM. I understood about how to get the flags register to latch in when a zero the result and also when the carry bit is active. But the programming of the EEPROM to use the flags register I got completely lost as I don’t know the C programming language yet and you were ploughing through so fast I just got completely lost. You had done so so well in your explanations up until that point but the speed at which you were explaining the programming of the EEPROM using the Arduino was a blur and I really did not understand the flags register. When you manually programmed the EEPROM it was very easy to follow along and understand what you were doing. The Arduino is very difficult for complete beginners to understand what is being put into the EEPROM
@gjmpeeters
@gjmpeeters 6 жыл бұрын
Ben is the very reason I again picked up my ‘old’ hobby of diy electronics after a decade or so. Now re-learning everything I once knew, looking in datasheets and getting nice thingies to build with.... Tnx Ben!
@Fwacer
@Fwacer 6 жыл бұрын
Lots of fancy editing in this one.. well done! Makes it accessible to people new to the series. Looking forward to the next video!
@AS-wi6hr
@AS-wi6hr 2 жыл бұрын
Ben has an exceptional talent at explaining things. A natural teacher/instructor plus years of learning and a passion for teaching and explaining. Awesome combination.
@babylonfive
@babylonfive 6 жыл бұрын
Great stuff, Ben! Glad to see more of you.
@gravypod
@gravypod 6 жыл бұрын
Why did the carry bit come on when you were subtracting 5? Is it because of two's compliment addition overflowing the number?
@BenEater
@BenEater 6 жыл бұрын
Yep, that's right. Another way to think of the carry bit is as a "carry/borrow" bit because it indicates that either a carry or a borrow occurred out of the most-significant bit. In fact, that's exactly how the Intel x86 developers manual that I showed briefly describes it.
@JolykYa
@JolykYa 3 жыл бұрын
There are 2 opposite styles. Intel x86 has carry/borrow, which inverts carry after sub. This CPU and 6502 have only carry. 5-3 sets carry on this CPU, but doesn't on x86.
@fastundercoverkitgoogle7381
@fastundercoverkitgoogle7381 6 жыл бұрын
Your videos are some of the best content on youtube. I'm really excited to see what your next project is gonna be.
@anunaccountablescience6464
@anunaccountablescience6464 6 жыл бұрын
great videos Ben Very straight to the point , esp your intuition with the feedback loop and how they seem similar to real life in this video
@brunorufier5581
@brunorufier5581 6 жыл бұрын
Hello Ben, Great video as always. May i suggest two thing : - The Zero Flag should also take into account the carry overwise a result at 256 will be considered as a zero. - You also could have hook the flag register enable to the SUM Register OUT, then avoiding to create a new control word bit. Continue your great video, it's always a pleasure to see a new video from your channel.
@MrBluemoon74
@MrBluemoon74 6 жыл бұрын
Bruno RUFIER the microinstructions for both FC and FZ set could be the same as none of the flags set effectively ignoring the zero flag when there is an overflow.
@brunorufier5581
@brunorufier5581 6 жыл бұрын
MrBluemoon74, took me a while to understood and to check if it can lead to "unexpected" results ( i had to come back to my school book : 8051 assembler manual from 1993 (that don't make me feel very young !) but in the end you are right, everything will depend on the way he implement the conditional jump instruction. Thanks leaving this answer.
@themike97_58
@themike97_58 4 жыл бұрын
i love these videos. i love this channel. please never stop. i learn so much from these
@jordanhall1136
@jordanhall1136 6 жыл бұрын
Love this video, you're so informative and all I can ask is that you make more at your own pace!
@hydrochloricacid2146
@hydrochloricacid2146 6 жыл бұрын
I'm currently building a MIPS-like CPU myself , your videos were certainly very helpful while i was learning CA , and i thank you for that
@PerMortensen
@PerMortensen 6 жыл бұрын
Phenomenal video as alway, Ben.
@AaronSeigo
@AaronSeigo 6 жыл бұрын
As to the ability to signal the end of microcode for an instruction, while you are out of bits in the control word, you could encode it as 0 (no bits set) and for instructions with 4 or fewer microcode instructions save 1 or more clock cycles by feeding the control word into a 16 bit not-or. A bit more hackishly you could also assert that e.g. halt may never be called in combination with other instructions and then treat (halt && (or other_15_bits)) as a signal to skip the rest. definitely lowers the elegance and optimizing isn't a key feature on such a device, but the thought that no more bits in the control word made skipping to the next instruction not feasible got me thinking :) p.s. I have really enjoyed this series and passed it on to many in my circles :) cheers
@possible-realities
@possible-realities 3 жыл бұрын
Another way to save bits in the microinstruction would be to add a demultiplexer for all the output-to-bus signals. You never want more than one of them to be set at once, so this would also make the hardware safer (that would try to drive the bus from two places; right now the default with an unprogrammed eeprom is to try to drive the bus from all five places at once...). If for some reason you don't always want to drive the bus, you can dedicate one code to that. There's five of output-to-bus signals, but 3 bits would be enough to encode one of eight possibilities, so that would save two bits that can be used for other things.
@Dragonmastur24
@Dragonmastur24 6 жыл бұрын
Another fantastic, informative, and entertaining video!!! and great editing on this one too!!
@koshyalex8009
@koshyalex8009 6 жыл бұрын
thank u ben. still waiting for more of your work.
@briandecker8403
@briandecker8403 6 жыл бұрын
Yay!!!!!! Easter surprise! Thanks Ben for everything you do!!!
@fifaham
@fifaham 2 жыл бұрын
@28:30 Feedback is a vital element for control. Also I worry about operating frequency (MAX) of the board, for if there is no shielding and proper signal routing then the logic levels may cut off (deviate or distorted) from the intended signal, thus rendering the system problematic. There are many considerations one must pay attention to when designing the final product, from compliance to certifications to passing the regularities testing to EMI and interference and power handling and on and on... It is amazing how much is going inside the laptop you are now using.
@AttilaAsztalos
@AttilaAsztalos Жыл бұрын
Considering he stated he doesn't intend to go over 300Hz or so, dynamic signal integrity is not a concept that exists here. On the other hand, his insistence on using LEDs directly on TTL outputs "because those have built-in current limiting anyway" means every signal on that board is clamped down to LED forward voltage from actually proper TTL "high" levels, making basically ALL signals marginally flaky anyway, regardless of routing or breadboard considerations.
@555timer4
@555timer4 6 жыл бұрын
Hi Ben you asked what we would like to see next and before you move on to something totally different I would like to be able to store the programs we have written in to perhaps another EEPROM and be able to select with dip switches which program to execute. I hope that you can see that this addition to this project would be a good conclusion. Absolutely brilliant series of videos that I have followed and learned a lot from.
@tonybell1597
@tonybell1597 6 жыл бұрын
Excellent work Ben, the first computer I worked on was a 32 bit mainframe, it used one of the first diode micro program engine.... now I get it! Keep up the good work.....
@olarmariusalex
@olarmariusalex 5 жыл бұрын
You are a mine of gold! Thanks for your video's and for your great education work!
@ThePharphis
@ThePharphis 6 жыл бұрын
I'm just about to finish my digital systems course in the next 2 weeks, so I plan to give this video (and series) full attention from the ground up afterwards :) Very exciting!
@SamBebbington
@SamBebbington 6 жыл бұрын
Thanks so much! Amazing videos as always!
@ericdubois1529
@ericdubois1529 6 жыл бұрын
Thank you Ben, really love your teaching! What I'll like to view next is what I think is the logical next step: using a real CPU and building a small computer. I.e. 6502 or Z80. I would be interested in seeing how to decode addresses for ROM/RAM/IO, including banking; how interrupt can be multiplexed, etc...
@prof.tahseen6104
@prof.tahseen6104 3 жыл бұрын
ooo he did that
@ferrari2k
@ferrari2k 6 жыл бұрын
Just thank you very much for this series, it is very interesting. Looking forward to the addition of new microcode to the EEPROMs.
@aiscorp1
@aiscorp1 5 жыл бұрын
It's amazing to watch this and to try understanding more or less))
@bluefirexde
@bluefirexde 5 жыл бұрын
First of all, a huge thank you for this series. The ~12h until now have finally taught me how a CPU works, something I never got in the 4-month university course I had 3 years ago. I think, I'll build a 16-bit version of this soon and maybe use it to control things around the house.
@Omena0
@Omena0 3 жыл бұрын
Good luck with that! It will be hard BUT DO NOT GIVE UP!!!
@DarthZackTheFirstI
@DarthZackTheFirstI 6 жыл бұрын
oh finally he finished all the necessary things to build a "game & watch" console :o ! love it how he just "randomly" adds cables here and there to enhance it further after such a long break from the last video back then.
@voxelfusion9894
@voxelfusion9894 6 жыл бұрын
Definitely worth the wait! Awesome as always.
@oscararturovaldiviaalvarez4852
@oscararturovaldiviaalvarez4852 6 жыл бұрын
great video man... thanks for sharing your style :-)
@banderfargoyl
@banderfargoyl 6 жыл бұрын
Really love this series. Thanks!
@domainshax5611
@domainshax5611 6 жыл бұрын
A great feature can be a buffer for inputs and outputs where you can store data from input, and then manage that data. and another feature can be a connection between 2 computers of your project, to communicate
@dmitry.shpakov
@dmitry.shpakov 2 жыл бұрын
My feedback loop with Ben is to hit that like button, so Ben makes a lot more amazing videos.
@SimpleBanana
@SimpleBanana 4 жыл бұрын
Interesting. I was watching a video of yours on npn transistors and gates and this lead to me googling neurons to try and see what kind of circuits would exist in our bodies. Something that stuck out to me was the existence of feedback loops in our bodies and then when I watch this video you make a big point of having one in the computer. It's crazy how similar the circuitry is on a base level between humans and machines. Both types of loops can be interrupted like how we can have voluntary control over our breathing.
@alptekinakturk4185
@alptekinakturk4185 6 жыл бұрын
Thank you for the new video Sir!
@GLO2k7
@GLO2k7 6 жыл бұрын
Well crap. I'm the 257th like. So much for 8 bits
@RussellTeapot
@RussellTeapot 6 жыл бұрын
oh man, Likes are overflowing!!
@jdubya7139
@jdubya7139 6 жыл бұрын
good thing we have a carry bit now
@usern4m32
@usern4m32 6 жыл бұрын
@@jdubya7139 But the carry works for 256
@taureon_
@taureon_ 6 жыл бұрын
@@usern4m32 so?
@usern4m32
@usern4m32 6 жыл бұрын
@@taureon_ So never mind, i didnt understand the joke.
@MasthaX
@MasthaX 6 жыл бұрын
I really enjoy this content, been watching all of it since the first video, very interesting to enrich my low level computer and electronics knowledge.
@willofirony
@willofirony 6 жыл бұрын
Absolutely awesome. Thank you Ben.
@cheeto4493
@cheeto4493 6 жыл бұрын
OOOhhh, I like the fancy new graphics. Just the right amount of pop in the videos.
@asus12351
@asus12351 6 жыл бұрын
Mr Eater does a darn good job of presenting the material. However, I discovered this computer a few years back in an old computer organization book called Digital Computer electronics by Albert P. Malvino. What Mr eater is building is the Sap 1. However if your interested the book takes you all the way to a system that can perform like an 8085 called the SAP 3 its very cool and worth a read if you really want to dig in. Keep in mind of they didn't have eeprom chips back then so the control unit is build a little differently.
@Troleeboy
@Troleeboy 6 жыл бұрын
Graphics are fantastic, love your work. Please keep it up :]
@charlesjmouse
@charlesjmouse 3 жыл бұрын
Surely all you need to do is remove the last step from the 'ADD' instruction? -The Sum register puts it's result on the Bus so there is no need to store that result to the A register - it is available 'to further operations 'for free' -If you don't move the result to the A register you don't mess up the Sum register or it's flags -if you don't mess up your flags you don't need to store their values for later
@fifaham
@fifaham 2 жыл бұрын
@12:32 All microcontrollers I have used for over two decades use the "Flag - status - Registers". They are very valuable asset that help us make intelligent decision based on current status.
@AlejandroRodriguez-lq9mz
@AlejandroRodriguez-lq9mz 6 жыл бұрын
Awesome work bro! really! :D, i want to thank you, this videos are helping me a lot to my proyect of computer architecture:)
@satviksharma8025
@satviksharma8025 6 жыл бұрын
Ben Eater you are awesome
@biehdc
@biehdc 6 жыл бұрын
i would like to see in future videos that you can store and load programs you have typed in and if you would really ever finish this project, go for 16-bit. i know the complexity would increase a lot, but i would follow all of it locally, meaning building what you show me, because its very exciting!
@TheDELLFIRE
@TheDELLFIRE 5 жыл бұрын
Fantastic work. as a software engineer, this stuff greases my gears so to speak.
@galier2
@galier2 5 жыл бұрын
By using the address lines for the flags input one can easily understand why ARM-1 had conditional predicates for every instruction: it does not cost anything to implement in hardware when using a rom as microcode, and that is what ARM used (see Ken Shirrif's excellent analysis on the silicon level of the ARM-1 chip).
@ryanregier9376
@ryanregier9376 6 жыл бұрын
If you want extra microcode instructions without an extra EEPROM, you could demultiplex all the output codes. There is no reason you would want to output two registers to the bus at the same time. (Well, it is a poor man's AND, but that should really be done by the ALU instead). There are 5 output instructions, if I counted correctly, so you would only need three bits to specify which output you want. That would give you an extra two bits of microcode, which could be used for the other conditional jump and to reset the step counter, as you mentioned in the video.
@RetroRogersLab
@RetroRogersLab 6 жыл бұрын
And you would add a 74LS138 3 to 8 line decoder chip somewhere to decode the SELECT line for each output module?
@r.igormortis149
@r.igormortis149 6 жыл бұрын
Why not? It's cheaper than a third EEPROM.
@Gilhad1
@Gilhad1 6 жыл бұрын
That is exactly what I want to do in my next project :)
@jimmywennlund
@jimmywennlund 6 жыл бұрын
Hi Ben! Love your videos! I think the next thing you should add is a 16550(or 8250) UART, make the machine reply on telnet, and hook up a live video feed for people to play with it. Maybe you can write a simple bootloader in rom to remotely program the chip.. Otherwise i think timers and interrupts might be the next step, hook up some interrupt lines to the eprom and program them to ignore current command and jump to a specified instruction in ram. So much to do! Happy easter!
@vsa1551
@vsa1551 Жыл бұрын
I study Computer Architecture as part of Computer Science and I find it really cool to see things I leaned being used elsewhere than my finals
@blockedByCorsPolicy
@blockedByCorsPolicy 4 жыл бұрын
Thank you Ben, you're the best!!!!!!!!!!!!!!!!!!!!!!
@JiffyJames85
@JiffyJames85 6 жыл бұрын
I like the approach for the flag register. In my design I was using an SR with an AND gate acting as an enable. I then used the instruction bit to reset the SR latches.
@silvenshadow
@silvenshadow 6 жыл бұрын
This is great. I'd love to see human friendly i/o kbd and screen or so.
@s90210h
@s90210h 6 жыл бұрын
Hi Ben, this has been an amazing series! Thank you so much for sharing it. I'd be interested in seeing an Analog-To-Digital audio signal input converter and a Digital-To-Analog audio signal output converter added to this project. Or perhaps you could explain how ADC's and DAC's works with another set-up?
@64jcl
@64jcl 5 жыл бұрын
A sign cpu flag (bit7 of A) is also useful for a lot of things. 6502 has the bmi (branch if minus) and bpl (branch if positive) which are frequently used in code for that CPU.
@AttilaAsztalos
@AttilaAsztalos Жыл бұрын
Yes well you kinda NEED one of those if you intend to do "is A larger or smaller than B" comparisons/jumps too, not just "is A equal to B" ones. Which probably absolutely all CPUs except this one do.
@zignitz
@zignitz 6 жыл бұрын
I can't believe I binged this whole playlist all at once. I guess that is worth a subscription. *clicks*
@erichaag5229
@erichaag5229 6 жыл бұрын
Don't stop! Add video support to run a monochrome monitor or maybe just a LCD graphics display. But whatever you do, don't stop with the project. By the way, the new animations are nice.
@byronwatkins2591
@byronwatkins2591 5 жыл бұрын
I think a four-clock instruction cycle is far more natural... 2-cyles to fetch and 2-cycles to execute. Of course, this means that automatically transferring sums to A is no longer possible, but I don't think this is a bad thing: 1) the status remains valid for JC and JZ without a need to latch them, 2) there is no need to reset the microcode counter at instruction end, 3) another EEPROM address pin is available for expansion (perhaps another conditional branch), 4) the status latch signal is still available for expansion. This approach will require a store sum (STS mm) instruction that I suggest writes to memory. I also suggest that OUT be changed to OUT mm so that any memory contents can be displayed. Together, these make the upper memory locations into independent accumulators. Since STS does not affect the flags, the option is available to store before and/or after a branch.
@sergeiklimov2029
@sergeiklimov2029 6 ай бұрын
Excellent content
@willyarma_uk
@willyarma_uk 6 жыл бұрын
This series has been brilliant. I've learned a lot from these videos. What about adding a stack?
@darer13
@darer13 6 жыл бұрын
Look up James Bates
@flightvision
@flightvision 6 жыл бұрын
Be careful when implementing branch prediction ;) Please clear caches when branches are invalidated to avoid the Intel facepalm ;) And btw: your videos are absolutely enlighting to watch and pure fun!
@iuppiterzeus9663
@iuppiterzeus9663 Жыл бұрын
augmenting this project into a CPU which does branch prediction would be wild, but very interesting
@karanpatel1419
@karanpatel1419 6 жыл бұрын
This was great series, As a mechanical engineer I never thought that i would be able to understand how computer work at their fundamental level
@TimothyChapman
@TimothyChapman 6 жыл бұрын
26:02 - Why didn't I think of that? My solution was to set that 16th bit on the microcode ROMs as the JC signal, and do a bit of combinational logic with that, the regular J signal and the carry flag.
@RussellTeapot
@RussellTeapot 6 жыл бұрын
ha, we had the same idea :D
@RetroRogersLab
@RetroRogersLab 6 жыл бұрын
As did I. I would have never thought to connect the flag bits to the unused instruction decoder ROMs.
@Gilhad1
@Gilhad1 6 жыл бұрын
If you think about it, then you can have all instructions conditional, so you may eg. do "if cary load this memory to A otherwise just do NOP" and avoid lot of short conditional jumps. I think, that some processor really does it (at least for big part of its instruction set). On simple architecture it just saves few instructions here and there, on more sofisticated it can help optimize the internal work of such processor, as there are much less branches to cope with in instruction queue
@TimothyChapman
@TimothyChapman 6 жыл бұрын
15:53 In the Logisim simulation I built of your CPU, I tied the flag's write enable signal to the sum-out signal. And XORed the carry flag with the subtract signal, which was then sent to a single D flip-flop. I only built a JC instruction because I needed it to be able to do fibonacci just like one of the demo videos you did earlier. EDIT: Disregard this comment. I somehow misread "clock" for "write enable."
@cheewurz
@cheewurz 6 жыл бұрын
I think your Computer is Pretty Darn Cool Mr. Ben!
@multechpro7151
@multechpro7151 6 жыл бұрын
Hey ben , i hope you are doing well and i hope that you will, someday finish the series about networking when you have some free time, you re doing a great job, i love you man
@guntherschadow9383
@guntherschadow9383 5 жыл бұрын
I know this is an old video, but it's a classic. I just want to say that the flags issue is going to be a lot more complicated for real computation. You have a way to add with carry and so add larger numbers beyond your word size of 8 bits. However, you need to be able to control your carry, to be able to clear it before you start with a fresh addition. In the simplest case you'd have to start with a throw away addition of zero or something. Else you need a clear carry micro instruction, and then you need to build something around your 74LS173 flag register to just clear the carry. But for the substraction you need to change your entire carry logic, as you want to start the substraction with a carry bit set, but then as you continue a subtraction with higher order bytes, you need to NOT set the carry. Instead you leave it set on as it comes out of the previous subtraction. This is why the 6502 you need to use the CLC before your first ADC and SEC before your first SBC instruction. So your SU control line does not set the carry. Actually I now wonder that you never did hook up the carry flag with the carry input of your ALU, did you? Since that SEC and CLC instructions with the 74LS173 register can be really complicated, I wonder if there is a type of flip flop where we can have individual clear signals rather than one for all flags?
@andrewdavison2721
@andrewdavison2721 4 жыл бұрын
This might be the first feedback loop at the microcode level, but there's been other loops at lower levels -- the logic gate feedback loops to build the flip-flops, and loops at the circuit level to control the 555 timer for example.
@jslugbug37
@jslugbug37 6 жыл бұрын
Beautiful artwork
@brettmiller7469
@brettmiller7469 4 жыл бұрын
Thank you. 100,000 noobs on KZbin doing the same boring stuff with Arduino and Pi, etc. Finally a series of worthwhile videos. All my gratitude and goodwill. A machine code guy from 1985 - present...
@MrWilliam932
@MrWilliam932 6 жыл бұрын
Shouldn't the Zero Flag take into acount the carry flag too? I mean, If you add 255+1 the result is 256 which is 1 00000000 the result on the 8 bits will be 0, but the real result will be 256 because of the carry bit, I think the Zero Flag should not be 1 if the Carry bit is 1
@AnastasisGrammenos
@AnastasisGrammenos 6 жыл бұрын
Yes I think you are right. I thought of the same thing.
@KuraIthys
@KuraIthys 6 жыл бұрын
Jump on zero or it's inverse jump if not zero are the most common conditionals in existence. Including the carry bit, while it sounds useful actually makes a bunch of conditional code a lot more complex than it needs to be... Though strictly speaking as long as you document it properly and stay consistent you can use any form you like... It's just... Some forms are more useful than others...
@JasonMasters
@JasonMasters 6 жыл бұрын
So far as I am aware, all current "real" CPUs do it the same way as in Ben Eater's breadboard computer: The Zero flag is set along with the Carry flag if there is an overflow which leaves zero in the accumulator. In fact, doing it that way is key to implementing more complicated jump instructions such as "jump if greater than or equal to".
@Boom2219
@Boom2219 6 жыл бұрын
MrWilliam932 If you think about the example where he checked A = 5 by setting B to be 5 and subtracting. Well, 5 - 5 becomes 5 + 251 = 256. That would set the carry bit, but it's the zero we're looking for. It's easier to have two separate jump conditions, and if you need both for some reason, you can chain them.
@LightInspiration
@LightInspiration 6 жыл бұрын
MrWilliam932 I'm agree with u!
@TerabyteDragon
@TerabyteDragon 4 жыл бұрын
Wiring schematic at 6:30 is awesome!
@qubex
@qubex 5 жыл бұрын
Strictly speaking, you don’t require a conditional jump to be Turing Complete, you need a Conditional function. It’s just conventional (and convenient) for the conditional to be a jump instruction. One could, for example, have an instruction that conditionally loads a different block of instruction code (“conditional copy”) into the instruction stream. Other alternatives are also possible (One Instruction Set Computing is actually possible and has been implemented, and features instructions such as “subtract one and jump if negative”).
@paulandreizagan2309
@paulandreizagan2309 5 жыл бұрын
I've watched all of your videos on this series over a looking period of time cause my time is just limited. Idea for a next video series: a rudimentary digital oscilloscope maybe?
@yatharthagarwal2041
@yatharthagarwal2041 6 жыл бұрын
I'm currently building my registers!! Can't wait to reach this
@elvirus6994
@elvirus6994 4 жыл бұрын
3:25 FI: Hello, I'm here! 3:27 J:FI disappeared! 3:29 FI: I'm back!
Conditional jump instructions
43:10
Ben Eater
Рет қаралды 341 М.
Installing the world’s worst video card
25:12
Ben Eater
Рет қаралды 1 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Emulating a CPU in C++ (6502)
52:28
Dave Poo
Рет қаралды 1 МЛН
World's worst video card gets better?
44:25
Ben Eater
Рет қаралды 854 М.
The World's First Microprocessor: F-14 Central Air Data Computer
54:44
Alexander the ok
Рет қаралды 1 МЛН
I designed my own 8-bit computer just to play PONG
17:19
I built my own 16-Bit CPU in Excel
15:45
Inkbox
Рет қаралды 1,7 МЛН
Making a computer Turing complete
18:20
Ben Eater
Рет қаралды 547 М.
Hacking a weird TV censoring device
20:59
Ben Eater
Рет қаралды 3,4 МЛН
How Do Computers Remember?
19:32
Sebastian Lague
Рет қаралды 6 МЛН
Playing Music on the Oldest Running Computer in America!
27:06
Usagi Electric
Рет қаралды 380 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН