# Counter ICs

Discussion in 'Electronic Basics' started by Richard, Jun 30, 2011.

1. ### RichardGuest

MC14017B

I've just begun to look at digital electronics, and of course I have
come across the 4 bit counter.

In a 4 bit counter the output is at Q1, Q2, Q3 and Q4. We can feed these
4 bits (from a decade counter usually) into a decoder to drive a 7
segment display.

MC14017B is a 5 stage counter with built in code converter and shows
outputs Q0 - Q9.

Is this actually like a 5 bit counter, or what? Thanks.

2. ### Jon KirwanGuest

Examine this java-coded display of one:

It's a 5-bit ring, but the output of the last bit is inverted
and fed back so it takes two loops through to repeat itself
completely.

Jon

3. ### Jasen BettsGuest

Hi, you've found a data-sheet that's a really good start.
actually it's a 5 bit shift register fed back it's inverted output
then run through a bunch of gates (see page 2 of the data sheet)

it counts to 10 having one output (Q0-Q9) high for each step.

It's basically the same chip as the 4017B used here.

http://www.technologystudent.com/elec1/count1.htm

not that I'm reccomend that circuit (with a 9V supply) other than as an
experiment as it's using the LEDS outside of their specifications and
they may not last very long, it's better to use one resistor for each LED

4. ### RichardGuest

Hi. So it's not a 4 digit counter, it's 10 digit counter, and that is
why we see Q0 -Q9. But there is a 5 shift register in the IC.

Not sure what the code converter is about though.

At present what interests me is a decade counter.

From what I read, for each 7 segment display, you require 4 bits
representing the count, and you are getting Binary Coded Decimal at
Q1-Q4 (because we are using decade counters) and not regular binary
(modulo 16?). So, when building for 7 segment displays you need 4 bits
for every display. Therefore you would need a 16 bit counter (4 x 4 bit)
to run four 7 segment LED displays. I guess so.

5. ### RichardGuest

I mean 4 bit and 10 bit.

6. ### RichardGuest

I've not enough knowledge yet to understand these counter IC's.

I've just started learning digital, and all I know about is 4 bit
counters and how you can use those 4 bits (BCD in a decade counter) to
run a 7 segment display (via a BCD decoder).

So, when I think about counters with 7 segment displays, I'm assuming
your counter must be 4 bit, 8 bit, 12 bit etc.

I think this is true except for ring counters.

I just don't know why, with a decade counter, there are 10 bits in the
IC MC14017B-D and not multiples of 4bits.

7. ### Josef MoellersGuest

Am 30.6.2011 schrub Richard:
They just use different codes:
the 4 bit counter outputs a base-2 code while the 10 bit counter outputs
a 1-out-of-10 code:

base-2 1-out-of-10
0000 0000000001
0001 0000000010
0010 0000000100
0011 0000001000
0100 0000010000
0101 0000100000
0110 0001000000
0111 0010000000
1000 0100000000
1001 1000000000

The 1-out-of-10 counter could just as well be implemented using a base-2
BCD counter (e.g. an SN74LS160A) and a decoder (e.g. an SN74LS145).

Josef

8. ### Josef MoellersGuest

Am 30.6.2011 schrub Richard:
It must be a decoder which outputs a special code, as a simple "BCD
decoder" will output a 1-out-of-10 code. What you need is one that
outputs a code geared towards 7-segment displays:

Input Output
0000 1110111
0001 0100100
0010 1011101
0011 1101101
0100 0101110
0101 1101011
0110 1111011
0111 0100101
1000 1111111
1001 1101111

The least significant bit of the output is the top horizontal bar, then
the more significant bits are arranged from top to bottom and from left
to right:
0
+-----+
| |
|1 |2
| 3 |
+-----+
| |
|4 |5
| 6 |
+-----+

Take a look at e.g. the 4511, the 7447 or any other "BCD to 7-segment
decoder/driver".
It depends upon your display. You might want to count in octal, then a
number of 3-bit counters is sufficient ;-)

Note that the integrated decodes/drivers also have a feature to suppress
Because the code it outputs is a 1-of-10 code.

Josef

9. ### RichardGuest

Hi. Yes, the 4 bit counters that I am reading about are all binary
counters. Even the decade (BCD) counter is, except that BCD in the whole
sequence of bits are not binary.

And in this scheme I see how each display LED requires a Q1-Q4 output
from a 4 bit counter.

So to display a count of 7953 we need four, 4 bit counters:

Q1-Q4 Q1-Q4 Q1-Q4 Q1-Q4
BCD sequence:......... 0111 1001 0101 0011

Decimal displayed:.......... 7 9 5 3

Output of 4 bit counter is base-2 code.

Not sure yet how you would get to display 7953 using the 10 bit counter.
Whether in fact you would or could use 7 segment LED displays.

10. ### RichardGuest

So to display a count of 7953 we need four, 4 bit counters:

........................ Q1-Q4 Q1-Q4 Q1-Q4 Q1-Q4
BCD sequence:.......... 0111 1001 0101 0011

Decimal displayed:..... 7 9 5 3
(on 7 segment LED)

Output of 4 bit counter is base-2 code.
---

Basically, how would you complete the above arrangement for this 10 bit
counter:

........................ Q0 Q1 Q2 Q3 Q\$ Q5 Q6 Q7 Q8 Q9

??? sequence:..........

Decimal displayed:..... 7 9 5 3
(on 7 segment LED)

11. ### RichardGuest

So to display a count of 7953 we need four, 4 bit counters:

........................ Q1-Q4 Q1-Q4 Q1-Q4 Q1-Q4
BCD sequence:.......... 0111 1001 0101 0011

BCD decoder (to drive LED driver)

Decimal displayed:..... 7 9 5 3
(on four 7 segment LEDs)

Output of each 4 bit counter is base-2 code.
---

Basically, how would you make out a similar arrangement to the above for
the 10 bit counter? What would it take to display 7953 on four seven
segment display LEDs? How many counters?

........................ Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9

??? sequence:..........

??? decoder:..........

Decimal displayed:..... 7 9 5 3
(on four 7 segment LEDs)

12. ### RichardGuest

Are we saying for 10 bit counter when the count reaches 7953 we have:

........................ Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9

1 in 10 sequence:...... X X X X

X = HIGH

1 in 10 decoder: (To drive LED driver)

Decimal displayed:..... 7 9 5 3
(on four 7 segment LEDs)

13. ### Josef MoellersGuest

Am 30.6.2011 schrub Richard:
Without some additional circuitry: you can't!
The 1-of-10 code does not directly map to the 7 segments. You'd need a
couple of OR gates:
Segment 0 (the top most bar) is on if
Q0 OR Q2 OR Q3 OR Q5 OR Q6 OR Q7 OR Q8 OR Q9
is on
....

The BCD to 7-segment decode/driver chips use a slightly more complex
logic to determine which combination of the 4 bits causes which segment
to light.
It would be a nice exercise for Karnaugh-Veitch (sp?) diagrams!

Josef

14. ### RichardGuest

Do only 4 of those 10 outputs (Q0-Q9)contain the numerical information
to display a numerical digit?

15. ### RichardGuest

Well, I thought I'd better read the MC14017B notes. :c)

It says: " The ten decoded outputs are normally low, and go high only at
the appropriate decimal time period".

I've little idea how this explains how the counter is used to display a
count with (say) 7 segment LED displays.

But, seems the key is in the quote.

What has been decoded?

16. ### RichardGuest

This is what I'm seeing:

Lets say the clock frequency is 1 hertz. And the objective is to make a
counter to count up to 9999 seconds.

*Using four, 4 bit decade counters*

We connect up four 4 bit decade counters. Lets represent the 16 outputs
shared amongst the four counters as follows:

IC1 IC2 IC3 IC4
Q0Q1Q2Q3 Q0Q1Q2Q3 Q0Q1Q2Q3 Q0Q1Q2Q3

Each IC output is weighted or coded, inasmuch as each output represents
a particular numeral value. Individually for each IC, Q0 (LSB) is 1's,
Q1 is 2's, Q3 4's and Q3 8's (MSB). As the count progresses the outputs
become "hot" and spread along the 16 pin outputs. In this scheme, any
combination of outputs that are hot is (almost) possible. Almost because
the counters are decade counters and not binary counters.

From a decoding point of view, each 7 segment display needs a BCD
decoder, because the logic states on pins Q0 - Q3 is BCD. As the BCD
value rises, this makes a display show 0, 1, 2, all the way to 9.

At the start all displays read 0000. The display associated with IC1
will cycle from 0 to 9, and on the tenth pulse, go back to 0, whilst the
display controlled by IC2 will go to 1. At some point the counter will
show 7953, meaning 7953 seconds have lapsed. Q1-Q3 on each IC does cycle
in a loop regarding the binary number that is reflected in the output
states (cold or hot). Each goes from 0000 to 1001 and back to 0000.

*Using four, 19 bit Johnson decade counters*

I'm not actually sure if I'm trying to mix oranges and apples, whether
in fact this Johhson counter is suitable for use in counting clock
pulses as I've described above.

If we need four Johnson counters with 10 decoded outputs we have:

IC1 IC2
Q0Q1Q2Q3Q4Q5Q6Q7Q8Q9 Q0Q1Q2Q3Q4Q5Q6Q7Q8Q9

IC3 IC4
Q0Q1Q2Q3Q4Q5Q6Q7Q8Q9 Q0Q1Q2Q3Q4Q5Q6Q7Q8Q9

Each IC will only have one output that is hot at any given moment.

Going by what is said, at the start, Q1 on IC is hot. I suppose Q1 on
all IC's is hot.

On the first pulse Q1 will be hot, Q0 cold. Again, not sure about what
is happening to the other outputs on the other IC's. I think after the
tenth pulse Q9 on IC1 is hot. Not sure what outputs are hot on the
9753rd pulse, except that only one output is hot for each IC.

But, whatever the state of the outputs, I'm trying to discover how the
state of these outputs on the four ICs lead to four, 7 segment LEDs,
showing elapsed time.

I understand how counting, using 4 bit decade counters works. How each
IC produces a BCD output, and that these 4 outputs on each IC is decoded
in order to get each LED display to show a numeral.

I don't understand at all, how the outputs in the Johnson counter chips,
with their form of outputs, can eventually lead to each LED display to
show a numeral.

I could be trying to mix apples and oranges. I don't know.

17. ### Michael BlackGuest

It isn't, you're using the wrong device.

The 4017 would work if for each digit you had 10 LEDs, labelled 0-9. ONly
one LED would go on, to indicate the count between 0 and 9. Once upon a
time, the readouts were like that, Nixie tubes that 10 distinct numbers
in an envelope, and a BCD decoder would turn the BCD into one of ten
distinct outputs to turn on the needed digit.

The 4017 is a bcd decade counter and a bcd to "1of10" decoder in the same
pacakge. Since it doesn't output BCD, it won't work for thise project.

7 segment readouts don't work that way. There are 7 segments, but for
each number you have to turn on a number of those segments. Hence there
are BCD to 7segment decoders, which take the BCD code and turns it into
the outputs that will turn on the needed segments to display the matching

These are not the same thing. If you want to drive a 7segment readout,
you need a bcd output counter, then a bcd to 7segment decoder. The 4017
is useful as a simple decade counter, and for things where you need an
distinct indicator for each of the distinct digits 0-9. There are lots
of uses for that.

There are lots of bcd counters that will do what you need, and I assume
one can still get BCD to 7segement decoders.

Once upon a time, these things were common enough that one could find
devices that had the counter, decoder and even a latch between the two in
a single package, one company even put it in the same package as the

Michael

18. ### RichardGuest

So, the 4017 is a bcd decade counter. But it has a decoder that decodes
the bcd, such that only one of the 10 outputs is hot at any given moment
or time.

As the count progresses, each clock step leads to the next output going
hot. So, in 10 pulses, every output has been hot at some time, and the
cycle repeats. In theory then, to make one Johnson decade counter IC
control a single 7 segment LED, you would need a further decoder that
assigns the appropriate series of LEDS that are to be turned on, for
each of the 10 inputs possible. But, that is just not done. The 4017
was not envisioned to run 7 segment LED displays. Will run a nixie tube
though with suitable driver.

That's what I understand at this point.

19. ### Rich WebbGuest

There is no "bcd" (binary coded decimal) involved in the 4017. It's a
decade counter with a carry out. As clock pulses come in, the discrete
outputs Q0 to Q9 are asserted, individually, in order. Wipe BCD from

20. ### RichardGuest

What has slowed me down a bit is a sort of assumption I've had about
counters. I've been thinking that a counter is a counter is a counter.
When in fact you cannot just select any counter for your needs. When I
say mixing oranges and apples, this is what I am referring to. You do
that when you try to treat all counters the same. When seeking to use 7
segment LED displays not all counters have outputs that are suitable.
The 4017 is not suitable, because although it is a decade counter it's
outputs are "1in10" type and there is no "1in10" to 7 segment LED
decoder available. If there was it could be a substitute for a counter
whose outputs are BCD. People mentioned that, but when starting out
things sometimes just pass you by.

I don't think there is any BCD in the 4017 because it's a ring counter.
So, whatever decoder that is in that IC, (the outputs are "decoded
outputs")it's not decoding BCD to 1in10. I don't think so. I don't know
what is decoded.

I've learned something. Thanks for all contributors. Rich