Author Topic: 8-bit Computer Register  (Read 3583 times)

0 Members and 1 Guest are viewing this topic.

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
8-bit Computer Register
« on: December 20, 2017, 04:24:16 am »
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=null
  The 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 HD74LS173AN




If 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/sLSdRyBGJ1I

Now, 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-Ck6vNDYQ

Clearly , 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.
« Last Edit: December 20, 2017, 07:13:05 am by Balakumaran Selvaraji »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: 8-bit Computer Register
« Reply #1 on: December 20, 2017, 07:55:13 am »
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.
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #2 on: December 20, 2017, 07:58:39 am »
Okay, but does applying them actually solve the problem?

P.S : Still the same problem.
« Last Edit: December 20, 2017, 08:04:49 am by Balakumaran Selvaraji »
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: ca
Re: 8-bit Computer Register
« Reply #3 on: December 20, 2017, 09:09:18 am »
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.
« Last Edit: December 20, 2017, 09:17:33 am by Paul Moir »
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #4 on: December 20, 2017, 09:25:14 am »
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.


I 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?
 

Offline JoeN

  • Frequent Contributor
  • **
  • Posts: 984
  • Country: us
  • We Buy Trannies By The Truckload
Re: 8-bit Computer Register
« Reply #5 on: December 20, 2017, 09:31:13 am »
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).
« Last Edit: December 20, 2017, 09:32:59 am by JoeN »
Have You Been Triggered Today?
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: ca
Re: 8-bit Computer Register
« Reply #6 on: December 20, 2017, 09:38:46 am »
.. 74ls173's have current limiting resistor's on the output built inside the chip...
No 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.
 

Offline mrkev

  • Regular Contributor
  • *
  • Posts: 214
  • Country: cz
Re: 8-bit Computer Register
« Reply #7 on: December 20, 2017, 09:59:51 am »
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.


I 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?

It'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.

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).

That 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...
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #8 on: December 20, 2017, 10:13:44 am »
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
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #9 on: December 20, 2017, 10:23:16 am »
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).

The 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)
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: 8-bit Computer Register
« Reply #10 on: December 20, 2017, 11:18:23 am »
The very first section of this TI ap note discusses bypassing for
noise. Mandatory.


http://www.ti.com/lit/an/sdya002/sdya002.pdf


"TTL Cookbook" by Don Lancaster is excellent resource.



Regards, Dana.
« Last Edit: December 20, 2017, 11:21:38 am by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline cracked_machine

  • Contributor
  • Posts: 8
  • Country: gb
Re: 8-bit Computer Register
« Reply #11 on: December 20, 2017, 11:55:41 am »
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.
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #12 on: December 20, 2017, 01:13:42 pm »
Regret the previous message. The problem still continues  :horse: When the load is active , the flip flop's keep going back to zero's.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 6353
  • Country: us
Re: 8-bit Computer Register
« Reply #13 on: December 20, 2017, 04:31:40 pm »
http://www.ti.com/lit/ds/sdls067a/sdls067a.pdf

Page 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.html

I 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.

 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #14 on: December 20, 2017, 04:49:01 pm »
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).
 
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 9842
  • Country: gb
    • Having fun doing more, with less
Re: 8-bit Computer Register
« Reply #15 on: December 20, 2017, 05:18:17 pm »
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.

All 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 out di/dt for the relevant currents and transition times. Then work out the voltage that will induce in the various wires, using v=Ldi/dt and 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.
« Last Edit: December 20, 2017, 05:20:24 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #16 on: December 20, 2017, 05:39:46 pm »
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..
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 6353
  • Country: us
Re: 8-bit Computer Register
« Reply #17 on: December 20, 2017, 06:01:06 pm »

Once you've grokked that, you will decide never to use solderless breadboards for logic; the breadboard technique causes too many problems.

I 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 one
https://www.extremetech.com/wp-content/uploads/2012/05/8-bit-hovey-CPU-640x353.jpg
« Last Edit: December 20, 2017, 06:20:42 pm by rstofer »
 

Offline matseng

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: se
    • My Github
Re: 8-bit Computer Register
« Reply #18 on: December 20, 2017, 06:30:03 pm »
Start by working out di/dt for the relevant currents and transition times. Then work out the voltage that will induce in the various wires, using v=Ldi/dt and 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.
So 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....
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 9842
  • Country: gb
    • Having fun doing more, with less
Re: 8-bit Computer Register
« Reply #19 on: December 20, 2017, 06:49:53 pm »
Start by working out di/dt for the relevant currents and transition times. Then work out the voltage that will induce in the various wires, using v=Ldi/dt and 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.
So 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....

Ah, but the professionally made boards don't do 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.pdf

Alternatively there were also ic sockets with built-in capacitors, but they could never be as good.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 9842
  • Country: gb
    • Having fun doing more, with less
Re: 8-bit Computer Register
« Reply #20 on: December 20, 2017, 06:53:08 pm »

Once you've grokked that, you will decide never to use solderless breadboards for logic; the breadboard technique causes too many problems.

I agree, breadboards can certainly be a problem.  OTOH, there are significant logic type projects built on them:

People also build castles on sand, but that doesn't make it a sensible choice! Some people are just dimwitted; others are harmlessly contrary :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline JoeN

  • Frequent Contributor
  • **
  • Posts: 984
  • Country: us
  • We Buy Trannies By The Truckload
Re: 8-bit Computer Register
« Reply #21 on: December 21, 2017, 07:00:14 am »
That 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...

In 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.

« Last Edit: December 21, 2017, 07:09:58 am by JoeN »
Have You Been Triggered Today?
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #22 on: December 21, 2017, 07:23:10 am »

Once you've grokked that, you will decide never to use solderless breadboards for logic; the breadboard technique causes too many problems.

I 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 one
https://www.extremetech.com/wp-content/uploads/2012/05/8-bit-hovey-CPU-640x353.jpg

So, 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?
« Last Edit: December 21, 2017, 07:27:43 am by Balakumaran Selvaraji »
 

Offline Balakumaran Selvaraji

  • Contributor
  • Posts: 26
  • Country: in
Re: 8-bit Computer Register
« Reply #23 on: December 21, 2017, 01:57:39 pm »
Okay, so is there any way to troubleshoot the registers using multi-meters :-DMM I am not able to get the correct values from the bus to the register and vice versa.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 6353
  • Country: us
Re: 8-bit Computer Register
« Reply #24 on: December 21, 2017, 03:05:38 pm »
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 IOH and IOL.

http://www.ti.com/lit/ds/sdls067a/sdls067a.pdf




 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf