Lets take a moment and appreciate how there is no nerv wracking intro on this videos and you can just go from one to another in your flow state learning so much without getting interrupted.
If your program counter appears to be resetting or erratic, make sure you tie pin 1 of the 74LS161 to 5V! Ben’s seemed to work fine without doing so. Mine was obviously resetting as the pin was floating.
the comment i was looking for. was too tired to check the datasheets again XD. sometimes i wonder how those chips can be so different from his. now only the display part left :o
DarthZackTheFirst Haha. That’s the way I feel. I finished my build but have run into an issue that I cannot resolve with the ALU I believe. When I try to get the computer to count up from 1 to 255. It stops at 240 and resets.( Start with 1 in A and B register. ALU sends total to the bus which gets put back into the A register). The last total of 240 never makes it into the A register. It resets to zero at that clock pulse. I have done everything I know to do short of disassembling the entire thing. It actually worked at one time but stopped somewhere along the way. Any ideas from a fresh mind???
im not that far. just finished the 7 segment part. so next is hooking up the bus. didnt think it would take that long getting there ^^``. could be lot from what i experienced so far XD . did you put enough capacitors into the power rails? there cant be enough. i put at least one in each power rail. did you use the same grounding if there are different power supplies used? is the power supply for at least 2 amp rated? i had one with 1 amp, the capacitor got quite warm :S . i had also power issues when i didnt ground my leds with a resistor. just the chip wasnt enough. caused weird behaviour. doesnt sound like a programming issue if it counts up that far (?). maybe the carry/flag does soemthing wrong if its always the same number? those are just wild guesses ;( . anyway might want to try google "reddit beneater" . ask someone there. seems to be quite active. what video are you at or is that already the last? when i get there i can answer it maybe XD .
Yeah, I mean the whole point of building your own computer is the flashing lights. If it does something and you can't even see it, that would be kinda stupid
For those with problems, I had two and was able to solve them. 1. I had only 1 LED flashing. After tying pin 1 of the 74LS161 to HIGH, other LEDs began to flash. 2. But, the LEDs seemed to flash in an unpredictable manner. It wasn't counting 0-15. I then tied pin 9 on the 74LS161 to HIGH. This fixed it. After those 2 changes, the program counter was working as Ben's did.
Who would down vote this? This whole series is amazing. I've been looking for a series like this for a very long time. I think this is the first video series to ever do this. Thank you for making this!
and the counting starts for the controller/sequencer circuit! cant wait to see how that magic works. thanks a lot Ben for your efforts and continuing the series.
New video? oh man.. Ive known how computers work on the logical level for a while, but thanks to you I now know how to actually implement them with electrical components. Someday I hope to build my own pc with a subleq instruction set.
I have to voice a small complaint here. Keep in mind that I do love Ben's videos, but he has spent the last 6 videos building the simplest board of all the boards on the SAP-1. I actually built my program counter with 2 74LS107's and a 74LS126 a long time ago. We have been working on this project for almost a year now. and still not near completion yet. When we should be moving on to more advanced projects like programming and burning micro controllers and ROMs for our boards and or building boards with full 8-bit processors like the 6502. Ben has gotten us all hooked on learning, and we are all grateful for him sharing his knowledge with us. He has a great talent for teaching electronics in a clear and precise manner. Thank you Ben
Abnormal counting behavior additional solution: TL;DR: Ben is using his clock circuit by itself, but my clock circuit is still hooked to the RAM module. The capacitor on the NAND gate for clock edge detection on the RAM manual input causes this to screw up the voltage in the circuit. I still don't have a solution other than just pulling the capacitor for now. Many comments talk about the abnormal behavior of the circuit and its inability to count properly. I had the same problem. Many solutions mention tying pin 1 of the 161 to 5v and one mentions a putting a 470 ohm resistor in line with the clock circuit at pin2. Both changed the behavior for me but didn't solve the problem. While troubleshooting I accidentally tied the first bit of the 161 to high with a loose wire and all of a sudden the other three bits were counting just fine (albeit only with three digits). This made me realize it was a power problem. After many mods with various resistor and breadboard layouts, and measuring voltages all over, I realized the issue wasn't at the 161, but at the clock input. The only other thing hooked up is the capacitor from the "RAM module testing and troubleshooting" video he inserts at 13:10 for edge detection. since Ben only has the clock-module hooked up in this video he doesn't have the same problem. For now I'm just removing the capacitor and simple NAND-ing my RAM. I havn't watched further yet, so hopefully he encounters and discusses this issue in later videos. I would love to hear solutions to this problem if others have it! Thanks.
I was also seeing erratic behavior from my clock module. This was extremely helpful, as the removal of the edge detection circuit immediately brought my clock circuit back into functioning again.
Thank you Ben for your great videos! I'm going to start building copy of your computer in few month. Already ordered bunch of TTL/breadboards/jumpers from ebay. Can't wait to start :)
Thoroughly enjoying the series. Am building this slowly although not always with the same 74 series chips - if I can find a cheaper alternate on E-bay / Farnell I'm going for those and hoping I can work out the difference. Big step up from my only previous custom electronics which was a simple reaction timer game.
Just finished binge watching all the videos in your breadboard computer playlist. Can't wait for the next ones!! I've been programming for over 20 years and never really had a true understanding of how exactly computers work on an electronics level. You explain everything very well and it's easy to follow and understand. Thank you so much for all the time and effort you put into these videos! Is there already a complete list of all components for the entire computer? That way I can order everything upfront so I'm ready to go when a new video comes online. P.S. I'm putting a few bucks in your tip jar at Patreon!
Look here eater.net/ and take it with grain of salt - Ben is buildind all from scratch then replaces some modules with single IC, so some small duplicities are possible. Also I count just 3 EEPROMS, not 4 and maybe you may need add some basic parts over (pullups, isolate the RC in RAM with two NOTs or NANDs, the RAM may be hard to find, but modern, larger and cheaper versions are avaiable, if you dare change the design around a little - as it is not inverting, no NOTs are needed, ground excessive address lines and such - Bens drawer can have some not common (or obsolete) parts, but the line of thinking is easy to follow even with improper substitues and drop of creativity)
Couldn't we use the binary counter chips for all the other registers as well? I mean, a counter is a register too: it stores its current value, we can load a new value into it, reset it, and it outputs a value which we can then interface to the bus through the octal bus transceiver as usual for output enable. As a bonus, we would have a nice quick way of incrementing each of these registers :> And those chips aren't that much more expensive than the registers. Am I missing something?
No, you are not missing anything. There are also direct register chips like 74646 with integrated 3-state logic and clock edge using - but Ben is starting from more basic chips to show, how it works INSIDE (so he also have LEDs everywhere, even if it means to not use 3-state output and put extra 74245 after those LEDs) - it is matter of didactic aproach as in contrast to most efficient result.
So I had issues with the counter being very glitchy. It would double count some times and log a count even when the clock was halted. I found 2 thing that made it stable. First was to tie the clear line 1 to VCC instead of leaving it floating. The next was to tie the clocks from the other registers to the clock clock line with the rest of the computer. I’m not sure why that would matter but it seemed not to double count when I did that. Any ideas why that would be?
Flippin' HECK, man, this is fascinating. If you would teach us how to do all of this in VHDL or Verilog, well, Ben, I sure would appreciate that. I've always wanted to design CPUs on FPGAs and I have no clue how to get going. Also, watching you wire stuff up is REALLY making me wish that there were solderless breadboard designs that give you more room to wire things up. One should be able to wire up 8 things without laying them on top of each other.
Couldn't you just do each module in VHDL your self and test it that way? if you know what I mean , like do a block for the clock, registers etc. I've only just really started learning VHDL but I can see how some things would work.
If anyone has issues with their counter randomly resetting like I did, make sure that you tie the bottom left pin (pin number one) to high. This pin is the master reset pin, and if the chip detects it going low it will randomly reset. I guess for whatever reason the breadboard I am using causes more issues than others as Ben never had the issue.
I wonder if that explains why at 6 minutes into the video, when he's working on the jump signal, it seems to reset a few times. I notice he does not have pin 1 set to high.
I have a problem with this counter. I built this but when I power the circuit, the least significant LED of this counter keeps blinking along with the clock a couple of times and then it starts counting regularly. What could be the issue? I put 100uF bypass capacitors across 70% of the power strips but did not help. I also put a 0.01uF ceramic across the clock as the wire enters the 74LS171 chip. Any help would be appreciated.
I have a very similar issue. When I run the clock fast, it counts normally, but when I slow the clock down, the least significant LED blinks a couple times like yours, and it will only count up to the third bit before starting back at zero. Have you figured anything out yet?
Like many others, I'm waiting for the instruction decoder. I'm going to be interested to see how you implement it. I've guessed that it can be done either with discrete logic or by using a ROM.
yes, indeed if you search for "SAP-1 by Albert Malvino", in the paper both ways are explained, with discrete logic and ROMs. I really hope Ben will implement it with ROMs: I tried myself (it's not the real deal tho, I'm using a simulation software to do this) and I'm stuck with the correct timing. A discrete logic "solution" is easier to pull off, but it's a little bit tedious when it comes to wire the control matrix
The instruction decoder is fairly simple, and does not depend on the control matrix. All you have to do is hook it up to your instruction register. Anyway, this document has a simple instruction register as well as an actual working control matrix. drive.google.com/open?id=0B6LIgQzDkH8fRmpSYm9ROTMzSGM
There is something that I don't understand. I'm using a software to implement this, so I'm not restricted to "stock" ICs, I can make my own, and I can't understand why some inputs are "active low"? For instance, the load input in the 74LS161 is "active low", meaning that if is 0, then loading a value from the bus to the counter is enabled. But this is very confusing to me: shouldn't be easier to have it so that, when load is 1 (active high, if I understand the terminology correctly), then the counter loads from the bus? It's something related to electronics design principles?
It's because of a peculiarity of the TTL logic family. It takes quite a lot more current to drive a TTL input low than to drive it high, so signals that were expected to be inactive most of the time were designed to be active low to reduce power consumption. For more recent logic families, such as CMOS, it doesn't matter. If you're not building your circuit out of real hardware, it doesn't matter either -- just use whatever is most convenient.
It's not just the peculiarity of TTL logic or to do with current draw though it is also because NAND and NOR gates are universal gates that you can make everything from. Often your load signal will be based on the combination of a high enable and a high clock pulse from another part of the circuit. By using a NAND you can AND the signals together and get a LOW when both are HIGH and that is the result that you want in this situation... in many situations it can save a gate. I agree it can be confusing for some though.
Fabulous work Ben, very much appreciated. I have built the full clock module and Program counter (to me that made sense in that order). Which module do you think makes the best sense after these two?
hi , im having problems with my counter, it is jumping from binary 01 to 10 i have tried every suggestion , im loosing my mind, the counter work fines when the 74ls161 counter enable pin is enabled by a pullup connector, but it doesnt work when is connected to the control logic circuit.
Same issue, using the chip that came with the kit. Only sometimes does it actually lineup all correctly it seems to just be jumping around sporadically and turns to 0 in between the count up as well periodically
Is your entire PC signal set current limited already before being sent through? I see you just jumped LEDs through, or is it just because they're yellow and green that they don't just explode immediately?
If it helps anyone, you might need a 1k pull up resister to 5v on the reset pin (pin 1) of your 74LS161. I'm using a SN74LS161N, It's super super finky and simply won't cooperate without the pull up resister. I tried tying reset to 5v and it works most the time, but sometimes still doesn't, but a pullup resister seems to have fixed the issue. I hopes it helps someone :) I'm still working on my copy of the computer after a year lol.
Oh :( it was more complex then that, the edge detector circuit in the ram module was somehow interfering with the 74LS161, so I've placed a 74LS08 in a spare area on the ram module area and passed the click signal through it ANDing it to 5v. This filters out whatever the issue was :( I couldn't detect any difference between the signal with my oscilloscope though :( But it least now by program counter and ram both work. I wish I knew why this helps, I think it has something to do with signal integrity? not sure
well this is a bit of a pain, i got a 54ls161 which has the same outputs as this, but it counts Weird?!?!, instead of 0000,0001,0010,0011,0100....ect, it gets too 1111 then instead of them all turning off it goes to 1001,1011,0101 then some random crap. Any ideas anyone?
My binary counter is counting when the clock goes high and when it goes low. Anyone know why this is happening? It seems like it’s almost experiencing the racing affect as it will sometimes jump ahead in the count by more then one place on a rise or fall of the clock. I’ve looked at comments on the website about disconnecting the clock from the register circuit, but even when the clock is only connected to the binary counter the problem still persists. Any help would be very much appreciated!
I'm having difficulty sending the program counter to the data bus. The LED's on the bus seem to flicker then suddenly they're all on... then flicker away quickly. They remind me of Steve Martin looking for his rhythm in The Jerk. It feels like some capacitance is building up somewhere and suddenly pulsing out. I've replaced both the 74LS245 and 74LS161 (in case those were fried) but they seem to be ok. And every other module interacts with the data bus just fine and dandy. I've rebuilt the circuit a handful of times now. Any ideas?
Late to the party, but I am still interested in building this. Sadly in 2022 the ICs are not readily available and 74LS are very hard to come. (perhaps I should add I am based in the UK!) Found out that you can use 74HC as an equivalent, so 74HC00 instead of 74LS00, but I am unable to source anything that looks like a replacement for a 74LS161, are there any site that show the replacement or equivalent chips in this case?
Your best bet is to search the description of the IC... not sure where you buy your stuff, but have a look at RS Components (edit: take note of descriptions at RS... stuff is often sold in packs instead of single)
You cannot use HC together with LS in this project. I believe the output of one does not correctly drive the input of the other, forgot which is which though.
I think I have some weird power supply issues... The counter basically works (sometimes), but the output of LS245 is wrong (the highest bit / pin 6 is always 0) and the rest 3 pins sometimes output correct LOW/HIGH voltage and sometimes not
1:10 oh ripple carry out so we can build 8 bit counter and change instruction register to be 2 8bit register another has op code another has data and build computer move opcode and data invidual. thats minium 8bit computer(cpu model) to use 8bit address and data
LEDs can drive as much as 10-20mA. But they shine even with less current too as long, as there is the voltage on them (and their characteristics are highly non-linear - so if you have weak source, big resistor, then LED, and start increasing voltage from zero, then on red LED is all the voltage (and no current so no shine) up to something like 1.8V ( well, 1.6 - 2.03V en.wikipedia.org/wiki/Light-emitting_diode#Colors_and_materials ) , then the current start rising, while the voltage is nearly the same (and voltage on the resistor is increasing, so the resistor limits the current, not the LED) and when the voltage increase enough to push big current (bigger than like 30-40mA) thru the resistor (where is voltage less by 1.8V which are on the LED), then the LED will just burn. As those LS are able to sink only like 4mA per pin, 8mA per chip ( ecelabs.njit.edu/student_resources/datas/74ls00.pdf ), then the LEDs are safe. Also TTL recognize everything from at least 2V up as logical HIGH, so with some small voltage drop here and there and some safety margin on good chips even LED against Ground allows for the output be considered HIGH
My circuit doesn't seem to be working, the 74LS161 is outputting only on Q0 or Pin14. I have to hold the chip down to make it count up and output on the other pins. Any suggestions?
I found a fix for the Program Counter, at least it worked for me. My clock module's blue LED is extremely bright, so I put in a 470 ohm resistor and connected this to the Program Counter clock input. After I did this my Program Counter worked flawlessly. Hope this helps!
Hmm. I just tried that after your suggestion; no luck. It runs te same. When I touch the output pins it runs as expected. When left unattended, it seems to reset (the 74LS161) really, really quick. The resistor didn't make a difference. I suspect the breadboard to be the issue. Will try another breadboard tomorrow, but until then, anyone that got something for me is welcome to share. Strange things happening here. I still think it is a faulty GND connection of something.
I have found a definitive fix for this problem. The CLR pin on the 74LS161 has to be held HIGH. So add a connection to Vcc to make this go away. In essence the pin is floating in Bens version. Could work for years but still good to add this connection to prevent future problems.
Yes - just spent 2 hours struggling all over the clock circuit and other connections before finding this simple, and in retrospect pretty obvious, fix...!
I've seen all your videos and will do something like this, but I have one basic question: Why did you do it 4 bit, when you could do 8 bit? Same with memory address. That would allow fancier programs to be ran. Thanks!
Hey Ben my counter is incrementing on the up and down edge of my clock pulse. (so twice the rate yours is) any ideas what could be causing this? I tried cutting the CLK signal in half with a 74LS107 (JK FF) but it still incremented on the falling edge and randomly reset itself? Any ideas?
Its probably a little late now but I had the same problem and found a post of Alex Roetter on Ben eaters homepage. He traced the problem back to the RC Circuit build to only write to the RAM on the rising edge of the clock. As soon as I unplugged the Clock signal going there my problem was solved. Alex suggests to use the NAND gate as a diode. Or you could just implement a real diode. This will stop the capacitor from interfering.
I had issues with weird random counting as well that were fixed by isolating the capacitor by using a spare NAND with the incoming CLK and 5V before the capacitor. I can't see any obvious difference looking through the oscilloscope, would love to know how to "see" the problem. :)
@Beng a diode lets electricity flow only in one direction. If you for example would use an AND gate to AND 5V and CLK you have the CLK signal on the output again but also effectively build a diode because now electricity can only flow from the 5v and CLK input side to the output but not from the output back to the inputs. If you build the output how Ben designed it you conveniently have some NAND gates lying around there unused. So to emulate the CLK AND 5V you can build (CLK NAND 5V) NAND 5V which is equivalent.
João Constantino Probably because the RAM has only a 4bit address. Program counter is used only to specify an address for the next instruction in memory, therefore it only needs 4bits.
That's exactly right. The memory used in this breadboard computer is 16bytes. So 4bits are sufficient. If you are building your own, perhaps you could try expanding it to 256bytes (using an 8bit program counter) to fit larger program. The bigger the code size, more painful it gets to program using dip switches. But other options are possible.
The bus is 8 bits wide, so if you use 4 to encode the instruction you'll always have 4 left for an address (or a constant). That means you can handle each (memory-related) instruction "in one go". If you want larger addresses then you'd have to either make the bus wider or load the MAR (Memory Address Register) in steps. As for the manual input: there are also rotary encoder switches with 16 positions, so you can use two of those for inputting a byte. They are a bit costly though, ~ 2€ per piece.
Spent 2 hours trying to find our why the counter wasnt working but apparently pin 1 and 9 have to be tied high and it never was in the video. WORD OF CAUTION EVERYONE
TheKetsa The program counter is only a 4 bit counter. If this was 16 bit, you'd be able to do way more than this.. because with 4bits you only have 16 cycles but with 16 bits you could have up to 2^16 which is about 65,000 cycles!
Russell Teapot yeah it makes a lot of sense, thanks for the clarification :) that said, you can't have more than 16 iterations in the loop anyways. I mean, you can program it to print out 01010101010... Or 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,... but after 16 cycles it must repeat.. it can't keep updating new values, or can it ??
Given that quantum logic is only really stable on sub-spacial temperatures..... Maybe if you buy one of the mega-freezer racks and put your breadboard in here, with your **AMAZING** quantum gates, which will not draw current but will still make salty your bills
Late, but consider this: we're breadboarding something that was just barely possible in high tech labs 70 years ago. Quantum computing is barely possible in high tech labs right now. So maybe i 70 years you can get a cheap chip with a laser chiller trapping and poking around a few cubits for you.
@@galfisk Maybe you can not build your own yet, but you can run your experiments, for free, on a REAL quantum computer. See "Learn with IBM Quantum Experience" th-cam.com/video/pwwuF-DaPk0/w-d-xo.html. Its is fun, I did it a year ago.
I have a question. At 6:00 when you bring the counter enable low, the counter stops counting. But then a second (maybe clock tick?) later it clears out the counter completely. Is that how it is supposed to perform?
Lets take a moment and appreciate how there is no nerv wracking intro on this videos and you can just go from one to another in your flow state learning so much without getting interrupted.
until you run into an ad
what comes after the 4 clock module videos - is it the JK flip flop?
If your program counter appears to be resetting or erratic, make sure you tie pin 1 of the 74LS161 to 5V! Ben’s seemed to work fine without doing so. Mine was obviously resetting as the pin was floating.
the comment i was looking for. was too tired to check the datasheets again XD. sometimes i wonder how those chips can be so different from his. now only the display part left :o
DarthZackTheFirst Are u fairly knowledgeable on the workings of this computer?
maybe, maybe not, i dont know XD
DarthZackTheFirst Haha. That’s the way I feel. I finished my build but have run into an issue that I cannot resolve with the ALU I believe. When I try to get the computer to count up from 1 to 255. It stops at 240 and resets.( Start with 1 in A and B register. ALU sends total to the bus which gets put back into the A register). The last total of 240 never makes it into the A register. It resets to zero at that clock pulse. I have done everything I know to do short of disassembling the entire thing. It actually worked at one time but stopped somewhere along the way. Any ideas from a fresh mind???
im not that far. just finished the 7 segment part. so next is hooking up the bus. didnt think it would take that long getting there ^^``. could be lot from what i experienced so far XD . did you put enough capacitors into the power rails? there cant be enough. i put at least one in each power rail. did you use the same grounding if there are different power supplies used? is the power supply for at least 2 amp rated? i had one with 1 amp, the capacitor got quite warm :S . i had also power issues when i didnt ground my leds with a resistor. just the chip wasnt enough. caused weird behaviour. doesnt sound like a programming issue if it counts up that far (?). maybe the carry/flag does soemthing wrong if its always the same number? those are just wild guesses ;( . anyway might want to try google "reddit beneater" . ask someone there. seems to be quite active. what video are you at or is that already the last? when i get there i can answer it maybe XD .
I really appreciate your editing to smooth the moments where you need to do something off camera and not just leaving silence in there.
"You can never have too many LEDs"
Truer words have never been spoken
Yeah, I mean the whole point of building your own computer is the flashing lights. If it does something and you can't even see it, that would be kinda stupid
For those with problems, I had two and was able to solve them.
1. I had only 1 LED flashing. After tying pin 1 of the 74LS161 to HIGH, other LEDs began to flash.
2. But, the LEDs seemed to flash in an unpredictable manner. It wasn't counting 0-15. I then tied pin 9 on the 74LS161 to HIGH. This fixed it.
After those 2 changes, the program counter was working as Ben's did.
Absolute savior !! Thank you !
Truly a life-saver!
Who would down vote this? This whole series is amazing. I've been looking for a series like this for a very long time. I think this is the first video series to ever do this. Thank you for making this!
No idea. It seems they were expecting a working breadboard computer to magically appear in front of them, and were apparently disappointed.
Make sure to tie the clear pin to high on the counter. Had some issues with that affecting my counter.
Had the same problem! Hope your comment will help someone else
Thanks was having same problem. Luckily checked replies to this vid after only a few minutes of troubleshooting.
Thank you so much! That solved my problem.
How did Ben get his counter to work without tying pin 1 of the 161 to anything???
Yes, had this as well!! Solved now
Ben is single-handedly keeping the LED companies in business.
And it was! Now for the final, please with sugar on top, show us how the controller works!
the control unit depends generally on a what is called "Finite State machine" you could google it if you want
Contango1000
It's the basic element that makes a computer programmable, I think it's gonna be the most important part of this series
also, there are other pieces to be covered: IR, MAR and sequencer..
and the counting starts for the controller/sequencer circuit! cant wait to see how that magic works. thanks a lot Ben for your efforts and continuing the series.
New video? oh man.. Ive known how computers work on the logical level for a while, but thanks to you I now know how to actually implement them with electrical components. Someday I hope to build my own pc with a subleq instruction set.
I have to voice a small complaint here. Keep in mind that I do love Ben's videos, but he has spent the last 6 videos
building the simplest board of all the boards on the SAP-1. I actually built my program counter with 2 74LS107's and a 74LS126
a long time ago.
We have been working on this project for almost a year now. and still not near completion yet. When we should be moving on to more advanced projects like programming and burning micro controllers and ROMs for our boards and or building boards with
full 8-bit processors like the 6502.
Ben has gotten us all hooked on learning, and we are all grateful for him sharing his knowledge with us. He has a great talent for
teaching electronics in a clear and precise manner.
Thank you Ben
Awesome new video! I have bought a lot of things online since I started watching this series.
So did I! hahaha
Clone36 I already had most of them :P
Abnormal counting behavior additional solution:
TL;DR: Ben is using his clock circuit by itself, but my clock circuit is still hooked to the RAM module. The capacitor on the NAND gate for clock edge detection on the RAM manual input causes this to screw up the voltage in the circuit. I still don't have a solution other than just pulling the capacitor for now.
Many comments talk about the abnormal behavior of the circuit and its inability to count properly. I had the same problem. Many solutions mention tying pin 1 of the 161 to 5v and one mentions a putting a 470 ohm resistor in line with the clock circuit at pin2. Both changed the behavior for me but didn't solve the problem. While troubleshooting I accidentally tied the first bit of the 161 to high with a loose wire and all of a sudden the other three bits were counting just fine (albeit only with three digits). This made me realize it was a power problem. After many mods with various resistor and breadboard layouts, and measuring voltages all over, I realized the issue wasn't at the 161, but at the clock input. The only other thing hooked up is the capacitor from the "RAM module testing and troubleshooting" video he inserts at 13:10 for edge detection. since Ben only has the clock-module hooked up in this video he doesn't have the same problem. For now I'm just removing the capacitor and simple NAND-ing my RAM. I havn't watched further yet, so hopefully he encounters and discusses this issue in later videos. I would love to hear solutions to this problem if others have it! Thanks.
Thanks man, you saved my day!
Hans Dampf, fixing this took me hours....glad to have helped someone.
The blue led on the clock. if it doesn’t have a current limiting resistor it causes the counter to act sporadic. I just removed it.
I was also seeing erratic behavior from my clock module. This was extremely helpful, as the removal of the edge detection circuit immediately brought my clock circuit back into functioning again.
Building computer circuits is a lot of fun.
Thank you Ben for your great videos! I'm going to start building copy of your computer in few month. Already ordered bunch of TTL/breadboards/jumpers from ebay. Can't wait to start :)
Thoroughly enjoying the series. Am building this slowly although not always with the same 74 series chips - if I can find a cheaper alternate on E-bay / Farnell I'm going for those and hoping I can work out the difference. Big step up from my only previous custom electronics which was a simple reaction timer game.
you are always the man in computer !
Just finished binge watching all the videos in your breadboard computer playlist. Can't wait for the next ones!!
I've been programming for over 20 years and never really had a true understanding of how exactly computers work on an electronics level.
You explain everything very well and it's easy to follow and understand.
Thank you so much for all the time and effort you put into these videos!
Is there already a complete list of all components for the entire computer?
That way I can order everything upfront so I'm ready to go when a new video comes online.
P.S. I'm putting a few bucks in your tip jar at Patreon!
Look here eater.net/ and take it with grain of salt - Ben is buildind all from scratch then replaces some modules with single IC, so some small duplicities are possible. Also I count just 3 EEPROMS, not 4 and maybe you may need add some basic parts over (pullups, isolate the RC in RAM with two NOTs or NANDs, the RAM may be hard to find, but modern, larger and cheaper versions are avaiable, if you dare change the design around a little - as it is not inverting, no NOTs are needed, ground excessive address lines and such - Bens drawer can have some not common (or obsolete) parts, but the line of thinking is easy to follow even with improper substitues and drop of creativity)
Please upload more, I love your videos! :)
New vid - CELEBRATION!
it's so nice how you explain. makes me want to start doing it my self
Couldn't we use the binary counter chips for all the other registers as well? I mean, a counter is a register too: it stores its current value, we can load a new value into it, reset it, and it outputs a value which we can then interface to the bus through the octal bus transceiver as usual for output enable. As a bonus, we would have a nice quick way of incrementing each of these registers :> And those chips aren't that much more expensive than the registers. Am I missing something?
No, you are not missing anything. There are also direct register chips like 74646 with integrated 3-state logic and clock edge using - but Ben is starting from more basic chips to show, how it works INSIDE (so he also have LEDs everywhere, even if it means to not use 3-state output and put extra 74245 after those LEDs) - it is matter of didactic aproach as in contrast to most efficient result.
So I had issues with the counter being very glitchy. It would double count some times and log a count even when the clock was halted. I found 2 thing that made it stable. First was to tie the clear line 1 to VCC instead of leaving it floating. The next was to tie the clocks from the other registers to the clock clock line with the rest of the computer. I’m not sure why that would matter but it seemed not to double count when I did that. Any ideas why that would be?
😆😆😆😆 Awesome! Been waiting for this, and couldn't wait to comment before I watch it. No preassure, it will be great.
Flippin' HECK, man, this is fascinating. If you would teach us how to do all of this in VHDL or Verilog, well, Ben, I sure would appreciate that. I've always wanted to design CPUs on FPGAs and I have no clue how to get going.
Also, watching you wire stuff up is REALLY making me wish that there were solderless breadboard designs that give you more room to wire things up. One should be able to wire up 8 things without laying them on top of each other.
Couldn't you just do each module in VHDL your self and test it that way? if you know what I mean , like do a block for the clock, registers etc. I've only just really started learning VHDL but I can see how some things would work.
Thanks from Texas.
Ben eater in his last video: instead of these components that we used to built an computer, i am gonna use an 8 bit computer.
If anyone has issues with their counter randomly resetting like I did, make sure that you tie the bottom left pin (pin number one) to high. This pin is the master reset pin, and if the chip detects it going low it will randomly reset. I guess for whatever reason the breadboard I am using causes more issues than others as Ben never had the issue.
I wonder if that explains why at 6 minutes into the video, when he's working on the jump signal, it seems to reset a few times. I notice he does not have pin 1 set to high.
Many questions. Most important, why no inverted output? Extremely useful. W/O it, no debug back step.
It's like the 74LS1 was specifically made to make a Programme Counter.
I like the content you make. Very good video
I have a problem with this counter. I built this but when I power the circuit, the least significant LED of this counter keeps blinking along with the clock a couple of times and then it starts counting regularly. What could be the issue? I put 100uF bypass capacitors across 70% of the power strips but did not help. I also put a 0.01uF ceramic across the clock as the wire enters the 74LS171 chip. Any help would be appreciated.
I have a very similar issue. When I run the clock fast, it counts normally, but when I slow the clock down, the least significant LED blinks a couple times like yours, and it will only count up to the third bit before starting back at zero. Have you figured anything out yet?
Try to set first pin (CLEAR active-low pin) to high.
can't wait till i see the end wonderfull series of videos :)
Like many others, I'm waiting for the instruction decoder. I'm going to be interested to see how you implement it. I've guessed that it can be done either with discrete logic or by using a ROM.
yes, indeed if you search for "SAP-1 by Albert Malvino", in the paper both ways are explained, with discrete logic and ROMs. I really hope Ben will implement it with ROMs: I tried myself (it's not the real deal tho, I'm using a simulation software to do this) and I'm stuck with the correct timing. A discrete logic "solution" is easier to pull off, but it's a little bit tedious when it comes to wire the control matrix
The instruction decoder is fairly simple, and does not depend on the control matrix. All you have to do is hook it up to your instruction register.
Anyway, this document has a simple instruction register as well as an actual working control matrix.
drive.google.com/open?id=0B6LIgQzDkH8fRmpSYm9ROTMzSGM
There is something that I don't understand. I'm using a software to implement this, so I'm not restricted to "stock" ICs, I can make my own, and I can't understand why some inputs are "active low"? For instance, the load input in the 74LS161 is "active low", meaning that if is 0, then loading a value from the bus to the counter is enabled. But this is very confusing to me: shouldn't be easier to have it so that, when load is 1 (active high, if I understand the terminology correctly), then the counter loads from the bus? It's something related to electronics design principles?
It's because of a peculiarity of the TTL logic family. It takes quite a lot more current to drive a TTL input low than to drive it high, so signals that were expected to be inactive most of the time were designed to be active low to reduce power consumption. For more recent logic families, such as CMOS, it doesn't matter. If you're not building your circuit out of real hardware, it doesn't matter either -- just use whatever is most convenient.
It's not just the peculiarity of TTL logic or to do with current draw though it is also because NAND and NOR gates are universal gates that you can make everything from. Often your load signal will be based on the combination of a high enable and a high clock pulse from another part of the circuit. By using a NAND you can AND the signals together and get a LOW when both are HIGH and that is the result that you want in this situation... in many situations it can save a gate. I agree it can be confusing for some though.
Fabulous work Ben, very much appreciated. I have built the full clock module and Program counter (to me that made sense in that order). Which module do you think makes the best sense after these two?
hi , im having problems with my counter, it is jumping from binary 01 to 10 i have tried every suggestion , im loosing my mind, the counter work fines when the 74ls161 counter enable pin is enabled by a pullup connector, but it doesnt work when is connected to the control logic circuit.
Same issue, using the chip that came with the kit. Only sometimes does it actually lineup all correctly it seems to just be jumping around sporadically and turns to 0 in between the count up as well periodically
@@chopov11 Have you tied pin 1 to +5V? I solved my issues with this.
Is your entire PC signal set current limited already before being sent through? I see you just jumped LEDs through, or is it just because they're yellow and green that they don't just explode immediately?
In place of using the tri-state buffer could you not connect a diode to each of the outputs going to the bus?
why does the input into the program counter from the bus not require a tri-state buffer?
would you do the same in 16 bit and using serial shifting ic's?
If it helps anyone, you might need a 1k pull up resister to 5v on the reset pin (pin 1) of your 74LS161. I'm using a SN74LS161N, It's super super finky and simply won't cooperate without the pull up resister. I tried tying reset to 5v and it works most the time, but sometimes still doesn't, but a pullup resister seems to have fixed the issue. I hopes it helps someone :) I'm still working on my copy of the computer after a year lol.
Oh :( it was more complex then that, the edge detector circuit in the ram module was somehow interfering with the 74LS161, so I've placed a 74LS08 in a spare area on the ram module area and passed the click signal through it ANDing it to 5v. This filters out whatever the issue was :( I couldn't detect any difference between the signal with my oscilloscope though :( But it least now by program counter and ram both work. I wish I knew why this helps, I think it has something to do with signal integrity? not sure
can we use 74193 instead of 74161? Will that cause any problem to the jump instruction? Oh and thnx for the detailed coverage:)
So I don’t have access to these tools. Is there anyway all these chips can be simulated by software.?
well this is a bit of a pain, i got a 54ls161 which has the same outputs as this, but it counts Weird?!?!, instead of 0000,0001,0010,0011,0100....ect, it gets too 1111 then instead of them all turning off it goes to 1001,1011,0101 then some random crap. Any ideas anyone?
My binary counter is counting when the clock goes high and when it goes low. Anyone know why this is happening? It seems like it’s almost experiencing the racing affect as it will sometimes jump ahead in the count by more then one place on a rise or fall of the clock. I’ve looked at comments on the website about disconnecting the clock from the register circuit, but even when the clock is only connected to the binary counter the problem still persists. Any help would be very much appreciated!
Is there already a video for the instruction decoder ?
are you going to make (or is there already) a full list of parts you used for the computer?
Are the LEDs 5V LEDs with internal resistor?
I’m very interested to know why the LEDs are not using current limiting resistors?
The chips supposedly are current limiting output themselves, but I have heard many people with issues if they did not use current limiting resistors.
I'm having difficulty sending the program counter to the data bus. The LED's on the bus seem to flicker then suddenly they're all on... then flicker away quickly. They remind me of Steve Martin looking for his rhythm in The Jerk. It feels like some capacitance is building up somewhere and suddenly pulsing out.
I've replaced both the 74LS245 and 74LS161 (in case those were fried) but they seem to be ok. And every other module interacts with the data bus just fine and dandy. I've rebuilt the circuit a handful of times now. Any ideas?
Nevermind. My replacement 74LS245 was fried too 😅
Late to the party, but I am still interested in building this. Sadly in 2022 the ICs are not readily available and 74LS are very hard to come. (perhaps I should add I am based in the UK!) Found out that you can use 74HC as an equivalent, so 74HC00 instead of 74LS00, but I am unable to source anything that looks like a replacement for a 74LS161, are there any site that show the replacement or equivalent chips in this case?
Your best bet is to search the description of the IC... not sure where you buy your stuff, but have a look at RS Components (edit: take note of descriptions at RS... stuff is often sold in packs instead of single)
You cannot use HC together with LS in this project. I believe the output of one does not correctly drive the input of the other, forgot which is which though.
I think I have some weird power supply issues... The counter basically works (sometimes), but the output of LS245 is wrong (the highest bit / pin 6 is always 0) and the rest 3 pins sometimes output correct LOW/HIGH voltage and sometimes not
nevermind, I've figured it out, I forgot to put the resistors
6:02 Why do the leds go inactive ?
the clear signal was not tied up...
Ari is right, it worths adding that they didnt go low before because when you are "enabled" it uses some nand gates to disable the "clear".
1:10 oh ripple carry out so we can build 8 bit counter and change instruction register to be 2 8bit register another has op code another has data and build computer move opcode and data invidual.
thats minium 8bit computer(cpu model) to use 8bit address and data
Can you actually try to implement a screen/monitor for your 8 bit computer?
Nice video, btw :)
Divasi Mao the instruction set and ram size are too limiting for that to be possible
Divasi Mao
a good idea if you were building a 32-bit computer!
Even a monochrome, low resolution screen?
Divasi Mao
Actually, he's using a 7-segment display and I think this's more suitable in our case..
How does he drive LEDs with ttl outputs?? Most ttl chips including the 74ls161 can only source 0.4mA and LEDs usually require like 10mA.
LEDs can drive as much as 10-20mA. But they shine even with less current too as long, as there is the voltage on them (and their characteristics are highly non-linear - so if you have weak source, big resistor, then LED, and start increasing voltage from zero, then on red LED is all the voltage (and no current so no shine) up to something like 1.8V ( well, 1.6 - 2.03V en.wikipedia.org/wiki/Light-emitting_diode#Colors_and_materials ) , then the current start rising, while the voltage is nearly the same (and voltage on the resistor is increasing, so the resistor limits the current, not the LED) and when the voltage increase enough to push big current (bigger than like 30-40mA) thru the resistor (where is voltage less by 1.8V which are on the LED), then the LED will just burn.
As those LS are able to sink only like 4mA per pin, 8mA per chip ( ecelabs.njit.edu/student_resources/datas/74ls00.pdf ), then the LEDs are safe. Also TTL recognize everything from at least 2V up as logical HIGH, so with some small voltage drop here and there and some safety margin on good chips even LED against Ground allows for the output be considered HIGH
My circuit doesn't seem to be working, the 74LS161 is outputting only on Q0 or Pin14. I have to hold the chip down to make it count up and output on the other pins. Any suggestions?
I just built this and I have the same issue. I suspect it to be a faulty GND connection. My cheap ass bought cheap eBay breadboards.
I found a fix for the Program Counter, at least it worked for me. My clock module's blue LED is extremely bright, so I put in a 470 ohm resistor and connected this to the Program Counter clock input. After I did this my Program Counter worked flawlessly. Hope this helps!
Hmm. I just tried that after your suggestion; no luck. It runs te same. When I touch the output pins it runs as expected. When left unattended, it seems to reset (the 74LS161) really, really quick. The resistor didn't make a difference. I suspect the breadboard to be the issue. Will try another breadboard tomorrow, but until then, anyone that got something for me is welcome to share. Strange things happening here. I still think it is a faulty GND connection of something.
I have found a definitive fix for this problem. The CLR pin on the 74LS161 has to be held HIGH. So add a connection to Vcc to make this go away. In essence the pin is floating in Bens version. Could work for years but still good to add this connection to prevent future problems.
Yes - just spent 2 hours struggling all over the clock circuit and other connections before finding this simple, and in retrospect pretty obvious, fix...!
I've seen all your videos and will do something like this, but I have one basic question: Why did you do it 4 bit, when you could do 8 bit? Same with memory address. That would allow fancier programs to be ran. Thanks!
His computer only has 16 bytes of RAM, so 4 bits are needed to address that much (2^4 = 16). A 8 bit computer would require 2^8 bytes of RAM.
@@sligovolts exactly. That's my question. By doing it 8 bit you could have 256 bytes of ram, so why not?
@@Gaspar.Albertengo Oh, I see, sorry I misunderstood your question. That I don't know either, as I haven't watched the RAM video yet.
simplicity my friend,
Why my all leds blink together? Anyone face same issue?
If you using 74hc161 better for you to hook pin 1 and pin 9 to 5v otherwise your 74ls245 goes cou cou .
I'm want to try to build things like this in programs like logicaly and minecraft
ayyyyyy new video!
Hey Ben my counter is incrementing on the up and down edge of my clock pulse. (so twice the rate yours is) any ideas what could be causing this? I tried cutting the CLK signal in half with a 74LS107 (JK FF) but it still incremented on the falling edge and randomly reset itself? Any ideas?
Try tying the CLR pin (1) high
Actually I also have this issue, even with CLR tied high. It counts on the rise and fall. Did you fix this?
Its probably a little late now but I had the same problem and found a post of Alex Roetter on Ben eaters homepage. He traced the problem back to the RC Circuit build to only write to the RAM on the rising edge of the clock. As soon as I unplugged the Clock signal going there my problem was solved. Alex suggests to use the NAND gate as a diode. Or you could just implement a real diode. This will stop the capacitor from interfering.
I had issues with weird random counting as well that were fixed by isolating the capacitor by using a spare NAND with the incoming CLK and 5V before the capacitor. I can't see any obvious difference looking through the oscilloscope, would love to know how to "see" the problem. :)
@Beng a diode lets electricity flow only in one direction. If you for example would use an AND gate to AND 5V and CLK you have the CLK signal on the output again but also effectively build a diode because now electricity can only flow from the 5v and CLK input side to the output but not from the output back to the inputs. If you build the output how Ben designed it you conveniently have some NAND gates lying around there unused. So to emulate the CLK AND 5V you can build (CLK NAND 5V) NAND 5V which is equivalent.
Great!
he has 999K subscribers right as im watching this video
Why only 4 bits for the counter ? Isn't it a 8 bit computer ? sorry for the question.
João Constantino Probably because the RAM has only a 4bit address. Program counter is used only to specify an address for the next instruction in memory, therefore it only needs 4bits.
That's exactly right. The memory used in this breadboard computer is 16bytes. So 4bits are sufficient. If you are building your own, perhaps you could try expanding it to 256bytes (using an 8bit program counter) to fit larger program. The bigger the code size, more painful it gets to program using dip switches. But other options are possible.
G Yogaraja Thank you very much, now I understand.
The bus is 8 bits wide, so if you use 4 to encode the instruction you'll always have 4 left for an address (or a constant). That means you can handle each (memory-related) instruction "in one go". If you want larger addresses then you'd have to either make the bus wider or load the MAR (Memory Address Register) in steps.
As for the manual input: there are also rotary encoder switches with 16 positions, so you can use two of those for inputting a byte. They are a bit costly though, ~ 2€ per piece.
Spent 2 hours trying to find our why the counter wasnt working but apparently pin 1 and 9 have to be tied high and it never was in the video. WORD OF CAUTION EVERYONE
yes!
4:42 counter acts strangely
So your programs can only be 16 bit max ?
TheKetsa
had it been great if it were 16-bit.. it's only 16 cycles :)
Yeah, how is this going to work ?
TheKetsa
The program counter is only a 4 bit counter. If this was 16 bit, you'd be able to do way more than this.. because with 4bits you only have 16 cycles but with 16 bits you could have up to 2^16 which is about 65,000 cycles!
16 cycles was what I meant, sorry I am not an english native speaker.
Russell Teapot
yeah it makes a lot of sense, thanks for the clarification :)
that said, you can't have more than 16 iterations in the loop anyways. I mean, you can program it to print out 01010101010...
Or
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,...
but after 16 cycles it must repeat.. it can't keep updating new values, or can it ??
I may be asking much here, but say 2018, can we breadboard a quantum computer, please? Only one qbit. Please!!!!
Contango1000
who knows, we may have quantum logic chips in the near future for cheap :)
Given that quantum logic is only really stable on sub-spacial temperatures..... Maybe if you buy one of the mega-freezer racks and put your breadboard in here, with your **AMAZING** quantum gates, which will not draw current but will still make salty your bills
Late, but consider this: we're breadboarding something that was just barely possible in high tech labs 70 years ago. Quantum computing is barely possible in high tech labs right now. So maybe i 70 years you can get a cheap chip with a laser chiller trapping and poking around a few cubits for you.
@@galfisk Maybe you can not build your own yet, but you can run your experiments, for free, on a REAL quantum computer. See "Learn with IBM Quantum Experience" th-cam.com/video/pwwuF-DaPk0/w-d-xo.html. Its is fun, I did it a year ago.
I'M STIIIIIILL
IN A DREEEEAAAAM
Ben Eater!
*dum dum dum duuuuuh*
Great content though!
I have a question. At 6:00 when you bring the counter enable low, the counter stops counting. But then a second (maybe clock tick?) later it clears out the counter completely. Is that how it is supposed to perform?