SR-latch extension help

Discussion in 'General Electronics Chat' started by Tanax, Oct 23, 2010.

  1. Tanax

    Thread Starter New Member

    Oct 23, 2010
    4
    0
    Hello! I'm new to this forum so I'm not 100% sure if this is the correct section but ohwell! Perhaps a moderator can move the thread if it is in the wrong section :)

    What I'm looking for is.. Kinda complicated, I think. I've tried searching for it on both google and here but found nothing.

    Basically what I want is a circuit that would "hold" a state. Kinda like the SR-latch where it holds either the S state or the R state. But I want it with more than only 2 inputs/outputs. I'd want 4 inputs and 4 outputs. Also want it "impossible" to have more than 1 input active at the same time and perhaps even an "enabler"(Gated/Clocked).

    Does anyone know how I would go about to create this?

    Thanks in advance!
    Kind regards,
    Marcus
     
  2. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    That is pretty simple. You just need 4 SR latches, and connect each switch to set one latch and reset the other three.
     
    Tanax likes this.
  3. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Sounds somewhat like a 4-bit priority encoder with some back end logic to define the outputs.

    You probably need to provide a tighter definition with a logic table &/or state transition table showing the relationship you require between inputs and outputs.
     
    Tanax likes this.
  4. Tanax

    Thread Starter New Member

    Oct 23, 2010
    4
    0
    That would work how I want it, I believe. However, isn't it kinda waste to use 4 SR-latches at the end? I mean, that would give me 8 outputs while I'm only using 1 output from each latch? If I understood your suggestion correctly. Wouldn't it be possible to get only 4 outputs?

    Your suggestion does however provide an easy way to extend it to even more inputs/outputs if I sometime in the future want to extend the system.

    I have no idea what that is, sorry! I'm not quite that advanced with these kinds of things :)

    I'll try provide you with a logic table, don't have any fancy programs or anything so I'll just have to do it here.

    Input: EN Input: A Input: B Input: C Input: D Output: E Output: F Output: G Output: H
    0 1 0 0 0 0 0 0 0
    0 0 1 0 0 0 0 0 0
    0 0 0 1 0 0 0 0 0
    0 0 0 0 1 0 0 0 0
    1 1 0 0 0 1 0 0 0
    1 0 1 0 0 0 1 0 0
    1 0 0 1 0 0 0 1 0
    1 0 0 0 1 0 0 0 1
    So as you see, only when the enabler is active, it provides a result. When input A is active, only output E is active. So on and so forth.

    It would be good also if there would be some kind of "security" so that if both input A and B gets active, the output would simply either keep the last output it had or output 0 on all outputs.

    Sorry if my explanations aren't very good. Hopefully you'll understand what I want :)

    EDIT: The key importance here is that for instance if output F is active and I activate input A, output F is deactivated and output E is activated. Also another key thing here is that the output would hold this state even if the input is deactivated(exactly how a SR-latch works).
     
    Last edited: Oct 23, 2010
  5. Alexio

    New Member

    Oct 16, 2010
    6
    1
    It might be a bit wasteful to use four RS latches rather than two but it's possible with two. It depends on what you require and if this circuit is multiplied I suppose?

    You could have the two RS latches connected to a sort of two bit 'address' decoder (which takes a number in two bits of binary and outputs to one of four). This is more complicated though depending on what you want to do?
     
    Tanax likes this.
  6. Tanax

    Thread Starter New Member

    Oct 23, 2010
    4
    0
    Well, I guess 4 SR-latches could be fine then :) And as I said, it also allows for fairly easy extending of the circuit if neccessary/required in the future.

    What do you mean with if this circuit is multiplied?

    So how would I go about to create this circuit with 4 SR-latches? I know I need 4 SR-latches - obviously - at the end but how would the rest of the circuit look? The part where it resets 3 and activates 1.

    Would it simply be 4 different switches and have each of them split up into 4.

    ------------ SR SET
    | | |
    | | ----- SR RESET
    | -------- SR RESET
    ---------- SR RESET

    And then do that for each of the switches?
    BTW, does anyone know any good free circuit program for MAC?
     
  7. Tanax

    Thread Starter New Member

    Oct 23, 2010
    4
    0
    Here's an image I managed to create in Eagle. The wiring is a mess but hopefully you'll understand.
    [​IMG]
    Unfortunately, this circuit could potentially allow several inputs to be activated at the same time, what would happen then?
     
  8. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,775
    931
  9. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Actually you need a diode on each wire, otherwise all the inputs will be connected together. Like this:
    1------>|--- SR SET
    | | |
    | | ---->|--- SR RESET
    | ------>|--- SR RESET
    -------->|--- SR RESET
     
  10. Alexio

    New Member

    Oct 16, 2010
    6
    1
    Oh I meant if this is used more than once then the number of logic gates required to scale might quickly mount up, although I don't think that's what you're after, having read back some posts again.

    Just using 4 flip flops rather than 2 to hold a two bit address uses less gates anyway I think.
     
Loading...