problem with shift registers

Thread Starter

super7800

Joined Apr 3, 2019
42
i am an EE student, and we are just now getting into shift registers. i know that this is a basic question, but what am i doing wrong with my circuit? attached is a video. when i use a clock and hold the button, everything works fine, but when i do it this way it doesnt. any help would be appreciated.
 

BobaMosfet

Joined Jul 1, 2009
2,113
@super7800 - Looks like you're using a 74LS154D 4-line BCD to 16-line multiplexer/decoder. Not exactly a 'shift-register'. Read the data sheet to learn how to properly use this chip. If you want an actual shift-register, choose a different chip.
 

mvas

Joined Jun 19, 2017
539
U4 is getting latched before U14 updates its outputs.
I think, that is called a "race" condition.
 
Last edited:

Thread Starter

super7800

Joined Apr 3, 2019
42

here is a clearer schematic of my system. the intended opperation is when a button is pressed, the shift registers store that value and advance, for a maximum of 4 stored values.
@mvas - thanks i will see if that's the problem
@BobaMosfet i understand your confusion, it sure was a bad video. i am indeed using the 74ls194 shift registers.
 

djsfantasi

Joined Apr 11, 2010
9,163
Looking at the datasheet, your inputs are only copied to the outputs when the clock cycles. You have circuitry for the clock, so what’s happening?

When each chip parallel loads from the previous chip, that chip is also loading. it’s outputs are indeterminate. And so on down the line.

You need to ‘ripple’ the clock from the last chip to the first chip, in a manner that the inputs are not changing. You might accomplish this by clicking the last chip first and by inserting something between each preceding chip to delay the clock signal. Or adding circuitry to clock the 74ls194s in the proper order (counter to decimal decoder).
 

BobaMosfet

Joined Jul 1, 2009
2,113
The 74LS147 is technically NOT a shift-register either. Shift registers take inputs and ripple-shift them in sync with a clock, through the register in series. Usually serial input, and parallel output. Or parallel input and serial output.

The 74LS147 is a 9-4bit encoder/decoder. Parallel in, parallel out. Not the easiest way to do a keypad input by a long shot.
 

Thread Starter

super7800

Joined Apr 3, 2019
42


i added a delay and now it works. i'm running this in multisim which does not run real time. does this small of a delay seem right? would this delay component on the simulation transfer to the real life delay line component?

@mvas that was exactly what was happening. thanks.
@BobaMosfet of course the 74ls147 is a 10 to 4 encoder, that way the 4 shift registers can be in 4-bit binary. all my components are parallel in parallel out.
 

mvas

Joined Jun 19, 2017
539
i added a delay and now it works. i'm running this in multisim which does not run real time. does this small of a delay seem right? would this delay component on the simulation transfer to the real life delay line component?

@mvas that was exactly what was happening. thanks.
@BobaMosfet of course the 74ls147 is a 10 to 4 encoder, that way the 4 shift registers can be in 4-bit binary. all my components are parallel in parallel out.
[/QUOTE]
Yes, in the real world and in your simulation, you do need to account for propagation delay of your signal ( the clock) through the various Gate Delays. You have created two parallel signal paths, and the CLOCK must arrive after the 74ls147 updates its outputs. What is the "worst-case" Gate Delay of the 74ls147 ?
 
Last edited:

Thread Starter

super7800

Joined Apr 3, 2019
42

i have one more shift register question. i want to press backspace and shift all values left, deleting the most recent value in the process. i have the logic "working", but the values are still shifting right. do i need to use the clear line, or am i doing something horribly wrong? thanks.
 

Thread Starter

super7800

Joined Apr 3, 2019
42

@mvas yes that was my problem. cant believe i overlooked that.

the backspace button shifts the values of each shift register left, but does not shift them into the other shift registers.
What is happening: (0010 0110 => 0100 1100 => 1000 1000), and what i want to happen: (0010 0110 => 0110 0000 => 0000 0000). I've tried looking online for an example of this to no avail. any suggestions for a solution, am i simply using the wrong type of shift registers? thanks.
 

mvas

Joined Jun 19, 2017
539
Refer back to post #7
Do you realize that Message #7 was discussing U14, the 74ls147, which is the Keyboard Decoder chip?
And the Keyboard Decoding appears to be working, just fine.

We are discussing U2, U3, U4 & U5 which are 74ls194, which is a 4-Bit Bidirectional Universal Shift Register.
 

djsfantasi

Joined Apr 11, 2010
9,163
Do you realize that Message #7 was discussing U14, the 74ls147, which is the Keyboard Decoder chip?
And the Keyboard Decoding appears to be working, just fine.

We are discussing U2, U3, U4 & U5 which are 74ls194, which is a 4-Bit Bidirectional Universal Shift Register.
Oh. Never mind
 

mvas

Joined Jun 19, 2017
539

@mvas yes that was my problem. cant believe i overlooked that.

the backspace button shifts the values of each shift register left, but does not shift them into the other shift registers.
What is happening: (0010 0110 => 0100 1100 => 1000 1000), and what i want to happen: (0010 0110 => 0110 0000 => 0000 0000). I've tried looking online for an example of this to no avail. any suggestions for a solution, am i simply using the wrong type of shift registers? thanks.
Look at the "Shift Left Serial Input" of each 74ls194 .. where should that Input Bit come from?
The High Bit of the previous nibble ?
Where is the Daisy Chain connection for the Shift Left Input pin ?

I think ...
U4 "SL" Input needs to be connected to U2 QA
U2 "SL" Input needs to be connected to U3 QA
U3 "SL" Input needs to be connected to U5 QA
U5 "SL" Input needs to be connected to Gnd

Then four (4) presses of the "Backspace" button should shift each nibble, 4 bits to the left.
 
Last edited:

Thread Starter

super7800

Joined Apr 3, 2019
42


@mvas thanks for the advice about the debounce circuit, and for helping me with shifting things left.

i now have created the above circuit, which works great, but the problem still persists that i want to, at the push of a singe button once, shift the shift registers 4 bits left (it only does it 1 bit a a time now). i know that i will need to create a circuit that will pulse a clock signal 4 times with a small delay between each pulse and then reset itself, but i have been unable to find a solution online. i found lots about clock generators, but nothing about stopping said clock after 4 pulses. any help would be appreciated, thanks!
 

AnalogKid

Joined Aug 1, 2013
11,044
the problem still persists that i want to, at the push of a singe button once, shift the shift registers 4 bits left (it only does it 1 bit a a time now).
To be clear, by "4 bits left" do you mean 4 shift register stages? If so, wouldn't that load the same value into all four registers?

The debounce circuit is not correct. You are relying on the inability of the gate output to charge/discharge the capacitor instantly. This is true, it cannot. But the cap appears as a short-term dead short to the gate output, not good for reliability. One solution is to place the resistor in series between the gate and the cap. There is a max value for resistors driving and LS chip input, so the R will have to get smaller and the cap get larger for the same debounce period.

ak
 

Thread Starter

super7800

Joined Apr 3, 2019
42


@AnalogKid what i mean is if the registers are like this (1001 0010 0010 0000) and i press the backspace button i want it to do this
(0010 0010 0000 0000). thanks for the help on debounce circuit. i will work on that next.

pictured above are two circuits that i plan to use to implement the "backspace" function, i.e. 1 pulse in 4 pulses out with slight delay in between. the circuit using the 74ls161 works great, but i have been unable to get the 555 timer circuit to work. its supposed to generate a 50-60hz clock signal. it generates no signal at all and instead after about 0.05 seconds burns out the 1.5ohm resistor. i've tried other circuits, have gotten them working, but they all generated a much faster inconsistant clock. this one seems to be the closest to working. is this layout (the 555 timer and counter) efficient use of chips or is there a simpler solution and does anyone have any ideas for what is wrong with my 555 timer circuit that i seem unable to make work? thanks.
 
Top