Author Topic: Is there such a logic circuit?  (Read 4963 times)

0 Members and 1 Guest are viewing this topic.

Offline WatthTopic starter

  • Regular Contributor
  • *
  • Posts: 241
  • Country: fr
Is there such a logic circuit?
« on: September 16, 2016, 02:55:13 pm »
Hello,
I have been looking around, but couldn't find if the type of circuit I am looking for exists as a standard.

- 8 outputs, all but one are LOW, the other is HIGH for example, QO is HIGH, Q1 to Q7 are LOW
- on clock impulse, the high output shifts: Q0 and Q2 to Q7 are LOW, Q1 is HIGH, and so on. (if Q7 is HIGH on impulse, Q0 gets HIGH and the others LOW).
- (optional: another clock impulse shifts the HIGH output the other way, from Q7 to Q0).
- outputenable input allows to turn all output LOW while active
- reset return to Q0 HIGH and Q1 to Q7 LOW.

I made a timing diagram, if it helps understanding what I mean.

I think it would work as a 3 bits counter with a 3 to 8 bits demultiplexer.
So does this have a name ?

Thank you!
Because "Matth" was already taken.
 

Offline tatus1969

  • Super Contributor
  • ***
  • Posts: 1273
  • Country: de
  • Resistance is futile - We Are The Watt.
    • keenlab
Re: Is there such a logic circuit?
« Reply #1 on: September 16, 2016, 03:31:48 pm »
AFAIK there is no standard 74xx logic chip that does all this. A 74xx669 plus a 74xx238 will do it. If you have space constraints you could use a CPLD instead.
We Are The Watt - Resistance Is Futile!
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13870
  • Country: gb
    • Mike's Electric Stuff
Re: Is there such a logic circuit?
« Reply #2 on: September 16, 2016, 03:36:52 pm »
4017 would do all but the output enable.
Small MCU probably easiest & cheapest though, e.g. PIC12F505
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1163
  • Country: us
  • takin' it apart since the 70's
Re: Is there such a logic circuit?
« Reply #3 on: September 16, 2016, 04:06:00 pm »
If you need to go fast and backwards is not important, then maybe a 4022 followed by a buffer. Or, if cost is less important and you do need the backwards, program a 22V10.

If you do not need to go very fast, then a simple microcontroller is your friend. And by fast I mean > ~ 1 MHz.

You describe something called "output enable" but in your diagram it looks like you are not asking for tristate, but all zeros, is that right?
 
The following users thanked this post: Watth

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Is there such a logic circuit?
« Reply #4 on: September 16, 2016, 05:41:09 pm »
If you have space constraints you could use a CPLD instead.

+1
 

Offline WatthTopic starter

  • Regular Contributor
  • *
  • Posts: 241
  • Country: fr
Re: Is there such a logic circuit?
« Reply #5 on: September 16, 2016, 07:35:17 pm »
Thanks everybody for your thoughts on the matter.

Indeed, what I am looking for is an octal counter (such as On semi's MC14022B).

I forgot to mention that, for the project I was thinking of, this will be controled by an MCU, and not an especially fast one (Arduino or ATtiny), so speed and extra features (shifting backward, output enabling) are not required.

If you need to go fast and backwards is not important, then maybe a 4022 followed by a buffer. Or, if cost is less important and you do need the backwards, program a 22V10.
Do I really need to add a buffer if the output is used as a clock signal for a flip-flop?
Because "Matth" was already taken.
 

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1163
  • Country: us
  • takin' it apart since the 70's
Re: Is there such a logic circuit?
« Reply #6 on: September 16, 2016, 08:00:36 pm »

If you need to go fast and backwards is not important, then maybe a 4022 followed by a buffer. Or, if cost is less important and you do need the backwards, program a 22V10.
Do I really need to add a buffer if the output is used as a clock signal for a flip-flop?

I only suggested the buffer (a tristating buffer, I should have said) because you mentioned the requirement for an output enable. Whether you need something to condition the outputs in order to act as a clock for downstream logic is a question I don't think I can answer. I suspect you don't, but do not know how well behaved the output of a 4022 is. I suspect it is quite well behaved and you will not see any glitches, but do not know for sure.

In general, questions like the one you started with make people like me wonder what your overall system is about, because often enough, people head down a path of system design, then get some strange requirements based on that, and come on a message board and ask what can meet X requirements. But there is every possibility that the solution to the question asked may represent a local optimization and a global non-optimization.

That is, you've gotten a decent answer to your question, but you might get an even better one if we knew what you were trying to accomplish. :)
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Is there such a logic circuit?
« Reply #7 on: September 16, 2016, 08:16:13 pm »
If you have space constraints you could use a CPLD instead.

^ this

Obscure digital logic is just asking for a CPLD.  Xilinx Coolrunner-II 32 MCell can be had for $1.50 in single quantities and will do any bit shifting/flipping/tristating that you ask it to do, at high speeds, for relatively little power, with configurable interface voltage and pinout.
 

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1163
  • Country: us
  • takin' it apart since the 70's
Re: Is there such a logic circuit?
« Reply #8 on: September 16, 2016, 09:58:34 pm »
If you have space constraints you could use a CPLD instead.

^ this

Obscure digital logic is just asking for a CPLD.  Xilinx Coolrunner-II 32 MCell can be had for $1.50 in single quantities and will do any bit shifting/flipping/tristating that you ask it to do, at high speeds, for relatively little power, with configurable interface voltage and pinout.

Generally, but we don't know anything about this guy's project. Maybe he needs TH parts, or doesn't know how to program a CPLD or SPLD for that matter (or doesn't want to learn), or doesn't want to get a programmer because this is a one-off, etc.

I'll agree, he has hinted that there is more logic downstream, so a CPLD may be the ticket to solving not just this counter problem, but also sucking in the rest.


 

Offline onlooker

  • Frequent Contributor
  • **
  • Posts: 395
Re: Is there such a logic circuit?
« Reply #9 on: September 17, 2016, 02:10:03 am »
I was a little confused by the OP's description. But, the OP may try a serial-in and 8 bit out shift register such as SN74HC595 or the like. Then, using the last stage to drive the serial-in properly to make the 8 outputs cyclic following the clock edges. At initialization, set the output to 10000000.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22095
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Is there such a logic circuit?
« Reply #10 on: September 17, 2016, 05:21:18 am »
Up/down counter e.g. 'HC198, plus decoder e.g. '154.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline WatthTopic starter

  • Regular Contributor
  • *
  • Posts: 241
  • Country: fr
Re: Is there such a logic circuit?
« Reply #11 on: September 17, 2016, 05:53:13 pm »
(snip)
Generally, but we don't know anything about this guy's project. Maybe he needs TH parts, or doesn't know how to program a CPLD or SPLD for that matter (or doesn't want to learn), or doesn't want to get a programmer because this is a one-off, etc.

I'll agree, he has hinted that there is more logic downstream, so a CPLD may be the ticket to solving not just this counter problem, but also sucking in the rest.

Indeed, it needs more context!

This is a self learning hobbyist's project.
For example I made simple break-out-boards- such as a 595 with LEDs on each outputs, so that I can exercise using one by commanding it with a µCU. The same way I made a board for a 165 (parrallel to series) with an 8 bit DIP switch to see how I can recover data with a µCU. Learning by trial and error. I prefer using SMT to THT.

So now this project is an exercise in making a 64 (8x8) LED matrix controled by an µCU.
I am not definitive on how I will make it, thus the lack of information concerning other technical aspects.
What I can say is I chose a flip-flop for each LED in order to get rid of having to permanently refreshing the matrix.
I am not decided of how I will adress them, although 595 and/or 4022 are probably what I'll go toward to.

I make my own code, which incidentally frees me from having to adapt hardware to existing libraries.

I'll try to us as little as possible pins, as I wish to be able to command it with a limited pin number ATtiny.

Considering the original question, as far as I have seen, an octal counter (4022) is what I am looking for.

Another thing I wonder: if one wanted to cycle not 8 bits (or 10 for a decimal counter), but say 5 bits (Q0 to Q4); would you recommand connecdting Q4 to Reset as a solution?

Attached: the BoB I made for the 165 serial to parallel.
Because "Matth" was already taken.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2329
  • Country: 00
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16959
  • Country: us
  • DavidH
Re: Is there such a logic circuit?
« Reply #13 on: September 17, 2016, 08:49:16 pm »
I do not think you will find it as a single integrated function.  The 74LS299 comes close but it would be easier to use an up/down counter driving a decoder because it will be easier to start at a known state.  A CPLD is probably the way to go and will be less expensive anyway.
 

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1163
  • Country: us
  • takin' it apart since the 70's
Re: Is there such a logic circuit?
« Reply #14 on: September 17, 2016, 11:15:42 pm »

So now this project is an exercise in making a 64 (8x8) LED matrix controled by an µCU.


Ah, ok. So, the good news is that there are about a zillion different ways to do this, so you should definitely feel fine going about it however you like!

I have had good luck driving an 8x8 and a 16x16 using nothing more than 74HC595's -- for both the horizontal and the vertical. For one axis, you shift in the needed bit pattern. For the other you shift in a 1 and all zeroes, depending on the row you want to light. You can actually shift both the column and the row simultaneously, saving time. You do need to be careful and not RCLK the one-hot axis while you are still messing with the other one, but with a little fooling around and appropriate use of RCLK and /OE, you can figure it out. You can probably get by with driving the LEDs from the 595's directly, but for more drive strength you can drive P device on one axis and N devices on the other. I have a wall clock in my office I made just this way. The display is painted by an ISR that runs at a fixed frequency and adjustable duty cycle.

Have fun!


 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Is there such a logic circuit?
« Reply #15 on: September 17, 2016, 11:53:20 pm »
You can do all this and much more in a Cypress PSOC.

Cypress PSOC has ARM core, A/D (SAR and DelSig), DSP, logic fabric that can be used at
a GUI level or programmed in Verilog (much more important in future career), DMA, OpAmps,
PWM, COM, onboard Vref......see attached "component" list. In PSOC a component is a piece
of onboard HW. PSOC has LUTs and basic gates, counters, shift regs....you can either config
with GUI tool or program in Verilog. Tons of training videos, tool has many example project
solutions you can draw from. All components come with APIs you use in code to operate the
various components.

You can even design your own components, as well as program DSP engine in ASM to create
high performance custom DSP designs. DSP is a separate core inside PSOC.

Component list attached, as well as an example using DSP to filter a signal. Note this only used
a small %age of the resources, eg. one could have added a lot more functionality to the project.

Keep in mind you route the signals internally and to pins, with the GUI tool. its its own
breadboard, FPGA like.

SW tool free, low cost boards, $ 10 - $ 25.


Regards, Dana.


Notice counters, shift registers, mux/demux all in component library. In library a LUT you can
program (GUI tool) to do all that, leaving you 95% of the rest of the chip to use.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9915
  • Country: us
Re: Is there such a logic circuit?
« Reply #16 on: September 18, 2016, 01:49:16 am »
if the real objective is to drive an 8x8 LED array, how about the MAX7219

Here is a project:
http://www.best-microcontroller-projects.com/max7219.html
Here is a datasheet:
https://www.sparkfun.com/datasheets/Components/General/COM-09622-MAX7219-MAX7221.pdf

All the uC brings to the dance is the smarts and an SPI interface that can run as high as 10 MHz.

Notice that under certain conditions, the units can be daisy-chained.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16959
  • Country: us
  • DavidH
Re: Is there such a logic circuit?
« Reply #17 on: September 18, 2016, 07:39:48 am »
I have had good luck driving an 8x8 and a 16x16 using nothing more than 74HC595's -- for both the horizontal and the vertical. For one axis, you shift in the needed bit pattern. For the other you shift in a 1 and all zeroes, depending on the row you want to light. You can actually shift both the column and the row simultaneously, saving time. You do need to be careful and not RCLK the one-hot axis while you are still messing with the other one, but with a little fooling around and appropriate use of RCLK and /OE, you can figure it out. You can probably get by with driving the LEDs from the 595's directly, but for more drive strength you can drive P device on one axis and N devices on the other. I have a wall clock in my office I made just this way. The display is painted by an ISR that runs at a fixed frequency and adjustable duty cycle.

It would be cute to use the latch command of the 74HC595 to also increment a counter which drives the row/column select.

Note that multiplexed displays can be more energy efficient if the drive current is closer to the peak of the LED efficiency curve.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf