Latched 2bit binary

Thread Starter

PAKMAN

Joined Apr 21, 2018
16
Any ideas on how to latch a 2-bit binary output? I want to latch 00 when momentary push button 1 is pressed, 01 when button 2 is pressed, 10 for button 3 and 11 for button 4. The output must latch though. Been playing with flip flops and and logic gates, but just cant get the logic correct.
 

MrChips

Joined Oct 2, 2009
34,628
Any ideas on how to latch a 2-bit binary output? I want to latch 00 when momentary push button 1 is pressed, 01 when button 2 is pressed, 10 for button 3 and 11 for button 4. The output must latch though. Been playing with flip flops and and logic gates, but just cant get the logic correct.
It is called a priority encoder. Look up CD4532.
You can add a 2-bit latch.
 

crutschow

Joined Mar 14, 2008
38,323
Been playing with flip flops and and logic gates, but just cant get the logic correct
If you generate the truth table for the preset and clear inputs the two FF's need when used as latches, then the circuit required becomes readily apparent.

Below is the LTspice sim of a circuit for that, using one CD4017 quad, 2-input OR gate package, and one dual CD4013 FF package:
V1 through V4 simulate the 5V PB output signals.
Note that for the push-button signal you will need to add a 10kΩ pull-down resistor from each PB output to ground.

The priority encoder will also work, but this may be simpler for generating latched outputs.

1699288454763.png
 
Last edited:

Thread Starter

PAKMAN

Joined Apr 21, 2018
16
Thanks, I will check the CD4532B.
Thanks for the pointer to the CD4532B IC, it guided me in a much simpler direction than I was originally attempting.

Thought I would share the results with you. Here's my Part 3 YouTube video of what I was building if your interested:-

 
Top