Title: Counters
1???? ????
2Counters
3Edge Triggering
- Important Issue
- The T Flip-Flop and the JK Flip-Flop 1-1 option
are not stable since they are toggle
operations. - From now all FFs are assumed negative
edge-triggered Values are changed not when the
clock is up, but at the exact moment the clock
goes down notice the circle notation - Edge Triggering mechanism can be seen in the
lecture.
4New Approach To Flip-Flops (1)
- Formerly, we presented each flip-flops Truth
Table, i.e. the output as a function of former
state (former output) and the inputs.
Former State
Input
Output
T Flip-Flop Example
5New Approach To Flip-Flops (2)
- A new Approach For each former output and
desired output combination, what inputs do we
need to transform from current to desired? - This approach is more useful when creating
counters.
6New Approach To Flip-Flops (3)
7Flip-Flop Concatenation
- T Flip-Flop has an interesting Attribute
1
1
10
10
10
(In red, is the clock down-edge)
8Flip-Flop Concatenation (2)
- But doesnt that resemble counting in binary?
9Asynchronic Counter
- So we can use this attribute to create a simple
n-digit binary counter. - (shown here with the equivalent 1-1 state JK
Flip-Flop)
10BCD Counter
- Can we count in a radix which is not ?
- Yes, we can even create a binary-coded decimal
(BCD) Counter
11BCD Counter (2)
- To create it we used the diagram
12BCD Counter Concatenation
- If we can count to 10 (exclusive) we can count to
100, 1000 and so on
13BCD Counter
- Two problems
- Developing a custom-made, efficient, asynchronic
counter, such as the BCD counter is difficult! - What if we want to create a non-consecutive
counter easily?
14Counting Sequence
- A cyclic sequence of binary numbers.
- For instance 0,1,2,4,5,6,0,1,2,4,
-
15Synchronic Counter
- We want to implement a mechanism for counting in
a given counting sequence. - Well focus independently on each digit and the
changes it undergoes.
16Building A Sync. Counter
- Algorithm
- Choose a Flip-Flop type to use.
- To each digit (columns), allocate a Flip-flop.
- For each FF input create a truth table in the
following manner - For each state (line) do
- Mark state in current line as
- Mark state in next line as
- Determine the desired FFs inputs by the tables.
Those inputs are actually function results in the
truth table. - Simplify the truth table and implement the
function
173-Bit Sync. Counter using T Flip-Flops (2)
183-Bit Sync. Counter using T Flip-Flops (1)
193-Bit Sync. Counter using T Flip-Flops (3)
203-Bit Sync. Counter using T Flip-Flops (3)
213-Bit Sync. Counter using T Flip-Flops (4)
22Example using JK Flip-Flops (2)
- Shown for the 0,1,2,4,5,6,0,1,2,4,5,6, example
- Well do C as an example.
23Example using JK Flip-Flops (1)
24Example using JK Flip-Flops (3)
00
01
11
10
0
1
00
01
11
10
0
1
25Example using JK Flip-Flops (4)