Lecture 3.1.1 3.1.2


Saswatsamantaray1147

Uploaded on Mar 6, 2023

lecture

Comments

                     

Lecture 3.1.1 3.1.2

UNIVERSITY INSTITUTE OF ENGG. UIE ACADEMIC UNIT 2 Bachelor of Engineering (Computer Science & Engineering) Digital Electronics 22ECH-101 Counters DISCOVER . LEARN . EMPOWER Counters Course Outcome CO To identify the different types of digital circuits and their difference and to 1 illustrate the various types of gates. CO To understand the various elements of digital system and to implement their 2 applications. CO To illustrate the relation between Combinational & Sequential Circuits and to 3 apply for practical applications. CO To solve the basic problems related to different types of digital circuits and to 4 calculate it using various numerical problems. CO To create different hardware and software based digital applications. 5 2 Definitio n • Counter : A sequential circuit that goes through prescribed sequence of states upon the application of clock pulse is called a counter. • The input pulses are called count pulses, may be clock pulses or they may originate from an external source or occur at prescribed intervals or at random. • In a counter the sequence of states may follow binary count or any other sequence. • Counters are found in almost all equipment containing digital system Binary Counter • Binary Counter : A counter that follows the binary sequence is called a Binary counter. • An n-bit Binary Counter consists of n flipflops and can count in binary from 0 to 2n-1. • For eg. Binary counter for two digits is as follows: 1 Presen Stat Nex Stat 00 01 t A e t e B A B 1 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 0 11 10 Example of binary counter • Here’s the another example for binary counter and its state table: Present State Inputs Next State 0 Q1 Q0 X Q1 Q0 00 01 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 11 10 1 0 1 0 1 0 1 1 0 0 0 1 1 1 1 0 Applications of Counters • Some of the applications of counters in a sequential circuits are as follows:  To count the number of occurances  Generating Timing sequences  Count up or down  Increment or decrement count  Sequence events  Divide frequency  Address memory  As temporary memory Two principal categories • Counters are divided in two categories, these are: – Asynchronous (Ripple) Counters - the first flip-flop is clocked by the external clock pulse, and then each successive flip-flop is clocked by the Q or Q' output of the previous flip-flop. – Synchronous Counters - all memory elements are simultaneously triggered by the same clock. Few other categories of counters: • Apart from synchronous and asynchronous counters which are the major ones the other types of counters are as follows: – Ring counter – Johnson counter – Decade counter – Up–down counter Asynchronous Counters: • Here flipflop output transition serves as a source for triggering other flipflops. • This means that that the clockpulse is provided to a single flipflop • The change of state of a given flipflop is dependent on the states of other flipflops. • In other words the flipflops are not triggered by simultanous clock pulses but the transitions in other flipflops. Asynchronous Counters • This counter is called asynchronous because not all flip flops are have the same clock. • Look at the waveform of the output, Q, in the timing diagram. It resembles a clock as well. • This provides a clock that runs twice as slow. If we feed the clock into a T flip flop, where T is hardwired to 1. The output will be a clock who's period is twice as long. Four-bit asynchronous counter • The external clock is connected to the clock input of the first flip-flop only. • So, it changes state at the negative edge of each clock pulse, but the next flipflop changes only when triggered by the negative edge of the Q output of the first one. State Sequence Timing Diagram Asynchronous counter • Usually, all the CLEAR inputs are connected together, so that a single pulse can clear all the flip-flops before counting starts. • The 2-bit ripple counter circuit above has four different states, each one corresponding to a count value. • Similarly, a counter with n flip-flops can have 2N states. • The number of states in a counter is known as its mod (modulo) number. Two-bit asynchronous counter • Thus a 2-bit counter is a mod-4 counter. • This is because the most significant flip-flop produces one pulse for every n pulses at the clock input of the least significant flip-flop . 3 bit asynchronous “ripple” counter using T flip flops • This is called as a ripple counter due to the way the FFs respond one after another in a kind of rippling effect. Up/Down Counter Explanation of Up counter –  Case 1 – When M=0, then M’ =1. Put this in Y= M’Q + MQ’= Q So Q is acting as clock for next FFs.  Therefore, the counter will act as Up counter.     • The 1st FF is connected to logic 1. Therefore, it will toggle for every falling edge. • The 2nd FF input is connected to Q1.Therefore it changes its state when Q1= 1 and there is falling edge of clock. • Similarly, 3rd FF is connected to Q2. Therefore, it changes its state when Q2= 1 and there is falling edge of clock. • By this we can generate counting states of Up counter. • After every 8th falling edge the counter is again reaching to state 0 0 0. Therefore, it is also known as divide by 8 circuit or mod 8 counter. Explanation of Down counter • Case 2 – When M=1, then M’ =0. Put this in Y= M’Q + MQ’= Q’.  So Q’ is acting as clock for next FFs.  Therefore, the counter will act as Down counter. • The 1st FF is connected to logic 1. Therefore, it will toggle for every falling edge. • The 2nd FF input is connected to Q’1.Therefore it changes its state when Q’1= 1 and there is falling edge of clock. • Similarly, 3rd FF is connected to Q’2. Therefore, it changes its state when Q’2= 1 and there is falling edge of clock. • By this we can generate counting states of down counter. • After every 8th falling edge the counter is again reaching to state 0 0 0. Therefore, it is also known as divide by 8 circuit or mod 8 counter. Modulus-M (MOD-M) counter • A modulus-M counter is a counter where M represents the number of states present in the counter. Here M