8-bit Computer Register - Page 1
Forum section: electronics / beginners

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 04:24:16 am
content: Hello,I started to build by 8-bit breadboard computer from scratch. I first built the clock which was successful. Later, when I moved onto the register part, I was not able to be successful. I have went through the circuit couple of times and it looks like the wiring is correct. The "Load" signal which takes 8-bit value from the bus to the register is the one doing the problem and the "Enable" works perfectly as of now.I am attaching a picture of the circuit and would love if you could point out any problems and ask me any related questions...I am following this youtuber as my guidance to this project :https://www.youtube.com/user/eaterbc?ytbChannel=nullThe 8-bit register which he built is :Also, I have done the exact same built that he has done.I am using the SN74LS245N as my buffer and my 4-bit D Type Flip-Flop is HD74LS173ANIf you look over my model of the register, you will notice 3 jumper wires. The top right(yellow) is the load signal.(tied to power unless I want to use it because these are inverted signals). next to it(dark blue) is the clear signal for both the flip flop's... the bottom left(yellow) is the enable signal(same principle as the load signal but this time it outputs data back to the bus).Okay , from my point of view the wiring is perfect. I have checked them time and again. I am running these connections on an ideal 5V Supply.The power rails are also connected correctly.Here is a video taken showcasing that when the buses are all zeroes, the register takes in all zeroes when load is active. The enable is also working perfectly.Video 1 :https://youtu.be/sLSdRyBGJ1INow, here is the problem when i try to change the values of the bus and then trying to load them onto my registers.Video 2 :https://youtu.be/7V-Ck6vNDYQClearly , the first two led's should have gone off and the others must have been the same but all returned back to zero.Thank You.

author: mikerj
author_rank: Super Contributor
timestamp: December 20, 2017, 07:55:13 am
content: I don't see any supply decoupling capacitors? You absolutely need these to prevent strange faults, especially when using a breadboard. Use ~100n ceramic, one per IC and connected right next to the supply pins for each IC.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 07:58:39 am
content: Okay, but does applying them actually solve the problem?P.S : Still the same problem.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: December 20, 2017, 09:09:18 am
content: Don't see anything obvious, but driving LEDs directly without a current limiting resistor seems like a nasty hack that might work on some chips depending on manufacturer.Try pulling all the LEDs but the first, connect a reasonable (?k) current limiting resistor to it and see if the problem goes away.EDIT: another idea: some manufacturers limit you to a maximum rise time on the CLK pulse. Get a pull down on it. Also take a look at the 74LS573 and 74LS574 to save yourself some hassle.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 09:25:14 am
content: Quote from: Paul Moir on December 20, 2017, 09:09:18 amI understand your point of view but the 74ls173's have current limiting resistor's on the output built inside the chip so there is no use to put them. Should I reduce the time taken for the CLK to pulse or should I do anything else?

author: JoeN
author_rank: Frequent Contributor
timestamp: December 20, 2017, 09:31:13 am
content: I am not sure what the problem is here but I would like to mention that I have done a lot of experimenting with 7400 ICs on breadboards and you really do not need decoupling if you are working with signals that change at human input speeds, i.e. 1Hz max and mostly slower, because of using jumpers like this. It just doesn't matter until you get into high speeds of kHz at least. I agree with putting some resistors in series with the LEDs (e.g. 680 ohm or so) to protect your IC outputs.First thing I would do is use a logic probe to sanity check that every pin is at the level I think it should be. If you don't have one, they are a ton of help figuring out what is going on in systems like this. And they cost next to nothing, and can be a small project themselves if you don't just buy one for $15-$20 (e.g.https://www.amazon.com/Elenco-Electronics-LP-560-Logic-Probe/dp/B000Z9HAP4).

author: Paul Moir
author_rank: Frequent Contributor
timestamp: December 20, 2017, 09:38:46 am
content: Quote from: Balakumaran Selvaraji on December 20, 2017, 09:25:14 amNo that is not meant for that. Ioh recommended operating conditions max -5.2ma. Take more than that and suffer the consequences of what's feeding the base of the upper of the totem pole. It's a nasty hack that might work OK.Nothing drastic needed for speeding up the CLK. Just pull it down so it's definitely off (~1K) and touch your input to Vcc like you've been doing.

author: mrkev
author_rank: Regular Contributor
timestamp: December 20, 2017, 09:59:51 am
content: Quote from: Balakumaran Selvaraji on December 20, 2017, 09:25:14 amIt's most likely the source of your problems. Those diods will clamp output voltage at 1,4V and other ICs won't ever see logic 1 on those lines.Quote from: JoeN on December 20, 2017, 09:31:13 amThat is completely wrong. Speed of logic is not determined by the speed of signal you are feeding in, but by maximum speed it's capable of handling. Even 1Hz is going tohave edge time of several ns, which means you have MHz signal on board even if you don't realize that you do...

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 10:13:44 am
content: Okay, I have tried a couple of stuff. I have added the current limiting resistors of about 820. The register still behaves the same way...The wiring is not a problem because I have tried loading the bus when I switched on the power and it seems to have loaded the correct value once in 10 times probably.(without the clock running) I am now getting doubtful about my clock. Is there any fix to it?Here is a video of the current working status....Link :https://youtu.be/kkDp7mF5-Jo

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 10:23:16 am
content: Quote from: JoeN on December 20, 2017, 09:31:13 amThe problem here is that when the load signal is on , it must take in the value of the bus through the flip-flops and the led and store them. But, unfortunately the values are getting defaulted to zero i.e., 00000000.(The Reset signal is set to LOW to prevent it from resetting the flip-flop)

author: danadak
author_rank: Super Contributor
timestamp: December 20, 2017, 11:18:23 am
content: The very first section of this TI ap note discusses bypassing fornoise. Mandatory.http://www.ti.com/lit/an/sdya002/sdya002.pdf"TTL Cookbook" by Don Lancaster is excellent resource.Regards, Dana.

author: cracked_machine
author_rank: Newbie
timestamp: December 20, 2017, 11:55:41 am
content: Yes, get yourself a cheap logic analyser as other have already said.Something isn't triggering correctly and you're making things a lot harder for yourself by not having one.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 01:13:42 pm
content: Regret the previous message. The problem still continuesWhen the load is active , the flip flop's keep going back to zero's.

author: rstofer
author_rank: Super Contributor
timestamp: December 20, 2017, 04:31:40 pm
content: http://www.ti.com/lit/ds/sdls067a/sdls067a.pdfPage 7 says the recommended high level output current is -2.6 mA. Don't know if that matters.When I first started playing with TTL, I usually got dubious results by trying to 'scratch' a clock. It is far better to use a debouncer circuit like a SPDT switch with a pair of ring-tailed NAND gates.See about 1/2 way down the page here:http://www.electronics-tutorials.ws/sequential/seq_1.htmlI don't see any bulk capacitance in addition to the decoupling capacitors mentioned above. I usually have 100 ufd on the power inputs to a breadboard. I sometimes put another capacitance on the far end of the breadboard.You're switching a LOT of current when all the LEDs go on at once.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 04:49:01 pm
content: I modified the circuit by adding some capacitors before(not in those screenshots nor in the video). But, it just does not work. I once tried 3.3V Supply and it worked for a second and then it did not. I have built couple other hexadecimal output circuits and I haven't seen any weird kind of error like this. Only if I finish this, I would be able to start the ALU Unit. Tomorrow, I might start to debug the clock circuit(astable,mono and bi).

author: tggzzz
author_rank: Super Contributor
timestamp: December 20, 2017, 05:18:17 pm
content: Quote from: JoeN on December 20, 2017, 09:31:13 amAll that means is that your particular experiments haven't revealed the problem to you. That's the problem with blind experiments in the absence of theory and understanding.Start by working outdi/dtfor the relevant currents and transition times. Then work out the voltage that will induce in the various wires, using v=Ldi/dtand assuming that L is 1nH per mm of wire. Now, how will those voltage spikes affect the logic?Once you've grokked that, you will decide never to use solderless breadboards for logic; the breadboard technique causes too many problems.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 20, 2017, 05:39:46 pm
content: Okay, so I went through the circuit once again, added couple of capacitors to each registers. Seemed to work for a while perfectly and then when I connected the Instruction Register everything failed to work once again.... Wondering is that any loose connections or something else..

author: rstofer
author_rank: Super Contributor
timestamp: December 20, 2017, 06:01:06 pm
content: Quote from: tggzzz on December 20, 2017, 05:18:17 pmI agree, breadboards can certainly be a problem. OTOH, there are significant logic type projects built on them:There are many others, this is just the one I tumbled to first when I did a search.As you point out, routing the wires all parallel to each other probably isn't the best way but most breadboard CPU projects I have seen do it this way. Rats nest wiring would be very difficult to trace.ETA: Here's another onehttps://www.extremetech.com/wp-content/uploads/2012/05/8-bit-hovey-CPU-640x353.jpg

author: matseng
author_rank: Frequent Contributor
timestamp: December 20, 2017, 06:30:03 pm
content: Quote from: tggzzz on December 20, 2017, 05:18:17 pmSo what you're saying is that the inductance in a solderlesss breadboard with jumper wires with a reasonable length f*cks up digital logic? That would mean that all the professionally made wire-wrapped digital boards would be even worse? There you usually have thinner wires and longer lengths - must be totally unusable then ;-) Granted - oldskool LS TTL had a rise/fall time of about 6ns, but that is more or less what standard cheap HC/HCT have as well....

author: tggzzz
author_rank: Super Contributor
timestamp: December 20, 2017, 06:49:53 pm
content: Quote from: matseng on December 20, 2017, 06:30:03 pmAh, but the professionally made boardsdon'tdo it like that. In this context there is a significant difference between signal wires and power wires. Some thought, understanding and research will indicate how the problems were mitigated.Things like Rogers Micro-Q capacitors were available for retrofitting to try to reduce problems found after layout; I doubt they can be obtained any more, but I can't be bothered to find out.http://www.farnell.com/datasheets/22715.pdfAlternatively there were also ic sockets with built-in capacitors, but they could never be as good.

author: tggzzz
author_rank: Super Contributor
timestamp: December 20, 2017, 06:53:08 pm
content: Quote from: rstofer on December 20, 2017, 06:01:06 pmPeople also build castles on sand, but that doesn't make it a sensible choice! Some people are just dimwitted; others are harmlessly contrary

author: JoeN
author_rank: Frequent Contributor
timestamp: December 21, 2017, 07:00:14 am
content: Quote from: mrkev on December 20, 2017, 09:59:51 amIn this application, he's feeding the circuit inputs by hand and they are driving LEDs. Even if there is a glitch on the rail because of a flip-flop changing state or whatever, it's going to settle out. There is no counter or something here where a glitch could possibly matter.Here's a TTL project from way back when, a 555 running at 1KHz drives a counter and an adder and a multiplexer is used to read text off a (8 bit) ROM and then lookup a 14 segment map from a second (16 bit) ROM to display and scroll a message across 16 14 segment LEDs at 4cps. I was pretty new at this stuff back then and put no bypassing on it. It works. It may be glitching to high heaven, for all I know, but not on the counters at least and it works perfectly.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 21, 2017, 07:23:10 am
content: Quote from: rstofer on December 20, 2017, 06:01:06 pmSo, should I be connecting the wires in a collinear manner ?Also, got this probable solution from reddit :1.You can EASILY be inducing stray signals (false triggers) by grabbing insulation of your wires! Try this: Add 1K to 10K ohms resistors from these wires to ground. Now, the coupling of stray signals will be minimized by this lower resistance.Seems not the best way?

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 21, 2017, 01:57:39 pm
content: Okay, so is there any way to troubleshoot the registers using multi-metersI am not able to get the correct values from the bus to the register and vice versa.

author: rstofer
author_rank: Super Contributor
timestamp: December 21, 2017, 03:05:38 pm
content: Sure, replace all the LEDs with 2.2k resistors and use a meter. I'm not real excited about driving the LEDs directly from the D flops since they will clearly require more than 2.6 mA which is the recommended load limit. Assuming the LEDs are being pulled up by the D flops.If we assume that Vf of the LED is 2V and the Vcc is 5V, the LED current is (5V-2V)/100 Ohms (internal pull-up resistor) or 30 mA. Just about 15 times the recommended load.I'm surprised the magic smoke hasn't escaped.For 2.6 mA, ignoring the internal resistor and assuming the chip is pulling UP, 5V / 2.6mA = 1923 Ohms. 2.2k seems good.If the resistors are being pulled down, the recommended operating condition is 24 mA so the load resistor can be much smaller. However, there is no internal resistor in the pull-down path. In this case, the LEDs absolutely need resistors. (5v-2V)/0.024 = 124 Ohms. I would probably aim for 10 mA and use a 220 Ohm resistor.All of this comes from page 7 of the datasheet. In the top block they specify IOHand IOL.http://www.ti.com/lit/ds/sdls067a/sdls067a.pdf

author: tggzzz
author_rank: Super Contributor
timestamp: December 21, 2017, 03:50:34 pm
content: Quote from: Balakumaran Selvaraji on December 21, 2017, 01:57:39 pmMake sure you understand VOHVOLVIHVILlisted in the data sheet. You can measure the output voltage with a multimeter.But a multimeter won't show any transients due to poor construction technique.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 22, 2017, 07:23:51 am
content: So does the 74ls245 chip is pulled high or low? and also I referred to the 74ls245 datasheet and it tells me that the VIHMin = 2V and VILMax = 0.8... and can anybody tell me what is the exact reason behind this problem... I am so confused...Also, the datasheet is attached below.

author: paulca
author_rank: Super Contributor
timestamp: December 22, 2017, 09:41:25 am
content: I'm confused. In the original video the yellow LEDs showing the input to the bus are all 0, OFF, nada. When you set the load enable and pulse the clock the register shows all 0, off, nada.What's the problem? More importantly, why do you think the first two LEDs should change and the others remain the same? Because you pulled them to ground? What on earth would that do when there is no power on them anyway? The only thing I can think is that pulled to ground gives a clear logical low, rather than the pretty much disconnected state the others seem to be in.If those yellow LEDs are showing the state of the bus, then the register is correctly capturing the bus.Remove all the yellow LEDs. Wire the odd wires to Vcc and the even wires to GND. Set the load enable and pulse the clock. What happens?EDIT:Further. In the second video you posted about the clock problem. The bus is all 0. When you enable the load and pulse the clock the register then shows all 0. That's what's meant to happen!I currently have the flu and maybe I'm away with the fairies but why would you expect something else in the register? Where would it get that data from?Maybe you are trying to load the bus from the register, in which case the direct link to ground without resistor for the first two bits is surely just going to short the bus transceiver output to ground when it sets those outputs high, dropping Vcc into the floor and resetting the logic chips.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 22, 2017, 12:29:18 pm
content: Okay, so my registers(A,B and Instruction) and ALU seems to be working perfectly fine. But I faced this very problem and would like to know the possible solutions to it :Scenario:So I tried to connect all the led's to ground via some jumper wires and the only power which was to these led's was a common ground from some register. Now, I haven't connected the power as I burnt up one of my led'sas passed in too much voltage through it. So, now when I try to connect some of these jumper wires to ground and as well as have my load active in one of the registers, I noticed that the value was not taken by the registers and it defaulted to zero. So, I watched his video(Ben Eater) on "TroubleShooting the ALU" and he seems to get it working perfectly alright. So, I am wondering what might be wrong...

author: danadak
author_rank: Super Contributor
timestamp: December 22, 2017, 12:43:49 pm
content: Your leds have a series current limiting R in their connection, right ?Regards, Dana.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 22, 2017, 12:49:34 pm
content: Quote from: danadak on December 22, 2017, 12:43:49 pmThe LED's in my register have them but not the LED's on the bus.

author: ebastler
author_rank: Super Contributor
timestamp: December 22, 2017, 03:18:47 pm
content: Quote from: Balakumaran Selvaraji on December 22, 2017, 12:29:18 pmSorry, I find your description hard to follow. Can you please try again, and be more specific? What is connected to one side of the LED, what is connected to the other?Also, *all* your LEDs should be connected via series resistors! Without resistors, you can damage your chips or cause the circuit to work unreliably due to nasty current peaks. You should read up on how to calculate the right resistor value based on the drive voltage, the LED's forward voltage, and the desired LED current. But for the time being, simply use 470 Ohm or so -- much better than connecting them without a resistor!

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 22, 2017, 03:26:30 pm
content: I too had that doubt in my mind but when I watched the youtuber's model then I was like, it was working for him but why not me?I will try to add resistor's and see if the problem resolves.

author: cracked_machine
author_rank: Newbie
timestamp: December 25, 2017, 07:34:27 am
content: Seriously just buy thishttps://www.amazon.co.uk/Hobby-Components-24MHz-Logic-Analyser/dp/B00DAYAREW/ref=sr_1_1?ie=UTF8&qid=1514187041&sr=8-1&keywords=logic+analyserIt's less than £15 and you would have resolved the problem by now already... Is there a reason you are resisting this?

author: Nusa
author_rank: Super Contributor
timestamp: December 25, 2017, 08:28:52 am
content: Quote from: Balakumaran Selvaraji on December 22, 2017, 03:26:30 pm5V LED's can be had with integrated resistors that are not visually obvious, which might explain the confusion:https://www.mouser.com/new/kingbright/kingbright-resistor-LEDs/It's more expensive than adding the resistor yourself, but having them can make breadboarding easier.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 26, 2017, 03:52:38 pm
content: Okay, So he was not using the LED's with built in resistors as you said. He once mentioned that some of the TTL chips have current limiting resistors on the output so that no resistors are needed

author: Old Printer
author_rank: Frequent Contributor
timestamp: December 26, 2017, 05:53:10 pm
content: I have watched Ben Eater's logic gate videos to death, but I am still not knlowadgble enough to troubleshoot your problem. I will say that the devil is in the details, and judging by the system he has built from wires and breadboards he has discovered a lot of Devils. Have you watched his video on choosing good breadboards from bad ones?

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 27, 2017, 03:18:56 am
content: The problem is resolved few days back. I have no idea what it was....

author: Old Printer
author_rank: Frequent Contributor
timestamp: December 27, 2017, 03:34:54 am
content: Quote from: Balakumaran Selvaraji on December 27, 2017, 03:18:56 amThat's too bad, you had a lot of input on that situation, it would have been nice to come away from it with a conclusion, though by reading between the lines it seems possible there was nothing actually wrong, just a different expectation. Rule #1 in troubleshooting - never change more than one thing at a time if you really want to come to a solid conclusion.

author: Balakumaran Selvaraji
author_rank: Contributor
timestamp: December 27, 2017, 07:59:55 am
content: Yup, I learnt that when I was troubleshooting the ALU module

author: Nusa
author_rank: Super Contributor
timestamp: December 27, 2017, 09:54:24 am
content: Quote from: Balakumaran Selvaraji on December 26, 2017, 03:52:38 pmThat may be adequate if all you're doing is displaying the output on the LED. However, if you're also trying to use that output as an input to something else, remember that the diode (that's what an LED is!) tied to ground on that input may pull the voltage down enough to change it's digital value.