SlideShare a Scribd company logo
Courtesy: R. P. Jain (Modern Digital
Electronics)
Analog
and
Digital Electronics
(Second Year BTech Computer)
(2019-20)
(Faculty: Mr. Y. K. Sharma)
Courtesy: R. P. Jain & J. S. Katre
UNIT- 4
Counters
Counters
➢Counters: Asynchronous counter. Synchronous counter, ring counters, Johnson Counter,
Modulus of the counter (IC 7490).
➢Synchronous Sequential Circuit Design: Models – Moore and Mealy, State diagram and State
Tables, Design Procedure, Sequence generator and detector.
➢Asynchronous Sequential Circuit Design: Difference with synchronous circuit design, design
principles and procedure, applications.
Counters
➢There are two types of counters Asynchronous (ripple) & Synchronous counters.
➢Asynchronous counter is easy to design & requires the least amount of homework.
➢Asynchronous counter is not triggered simultaneously & is also called as serial or series counter.
➢Design of Synchronous counter requires some amount of homework & each Flip-Flop is triggered
simultaneously.
➢Each count of the counter is called as a state of the counter.
➢The number of states through which the counter passes before returning to the starting state is called
the modulus of the counter.
➢E.g. A 2-bit counter has 4 states, it is called a mod-4 counter & as it divides the clock signal frequency
by 4, it is called as divide-by-4 counter.
➢An n-bit counter will have n FF’s & 2n states, and divides the input frequency by 2n. Hence it is called as
divide-by-2n counter. The LSB of ripple counters is the Q output of the FF to which the external clock is
applied.
Counters
Classification of Sequential Circuits:
➢ Synchronous sequential circuits: Contents of memory elements can be changed only at the rising or falling edges of clock
signal.
➢ Asynchronous sequential circuits: Contents of memory elements can be changed at any instant of time.
Asynchronous Synchronous
1. Depends upon the sequence 1. Behaviour can be defined from the knowledge of its signal at
in which the input signals discrete instants of time.
change.
2. Commonly used memory 2. Memory elements used are Flip-Flops.
elements are time delays.
3. Design is tedious. 3. Design is easy.
4. They are combinational circuit 4. Synchronization is achieved by system clock.
with feedback.
5. Also called as clocked sequential circuit.
➢It is common for the FF types we have mentioned to also have additional so called ‘asynchronous’ inputs
➢They are called asynchronous since they take effect independently of any clock or enable inputs.
➢Reset/Clear – force Q to 0
➢Preset/Set – force Q to 1
➢Often used to force a synchronous circuit into a known state, say at start-up.
Asynchronous Inputs
Ripple Counters
➢It can be designed by using negative edge triggered T-type FF’s operating in toggle mode, i.e T=1.
➢Since FF’s are not clocked using the same clock therefore it is called as asynchronous or ripple counters.
Ripple Counters
➢ Timing diagram for ripple counter.
➢ Outputs do not change synchronously, so hard to know when count
output is actually valid.
➢Propagation delay builds up from stage to stage, limiting maximum clock
speed before miscounting occurs.
Synchronous Counters
➢All flip flop clock inputs are directly connected to the clock signal and so all FF outputs change at the
same time, i.e. synchronously.
➢More complex combinational logic is now needed to generate the appropriate FF input signals(Which will
be different depending upon the type of FF chosen.)
➢We can design synchronous counters using any type of Flip-Flops.
➢We will consider using D-type FFs to design 0-7 up counter.
➢ While designing counter we will make use of a modified state transition table. This table has additional
columns that defines the required FF inputs(or excitation table values).
➢We make use of excitation table for a particular type of FF.
➢Firstly investigate the so called characteristic table and characteristic equation for a FF.
➢For D-FFs it is not necessary to write out the FF input columns, since we know they are identical to those
for the next state.
➢To design the circuit we need to determine appropriate combinational logic circuits which will generate
the required FF inputs from the current states.
➢This can be done using Boolean algebra or using K-maps.
Characteristic Table
Excitation Table
Characteristic and Excitation Tables
Modified State Transition Table
Modified State Transitation Table
Synchronous Counter
Ring Counter
➢If the serial output Q0 of the shift register is connected back to the serial input, then an injected pulse will
keep circulating. This circuit is referred to as a ring counter.
➢The pulse is injected by entering 00001 in the parallel form after clearing the Flip-Flop’s.
➢When Clock pulses are applied, this 1 circulates around the circuit.
➢The outputs are sequential non-overlapping pulses which are useful for control-state counters, for stepper
motor (which rotates in steps) which require sequential pulses to rotate it from one position to the next etc.
➢This circuit can also be used for counting the number of pulses.
➢The number of pulses counted is read by noting which FF is in state 1.
➢Since there is one pulse at the output for each of the N clock pulses, this circuit is referred to as a divide-by-
N counter or an N:1 scalar.
➢If Q0 is connected to the serial output, the resulting circuit is referred to as a twisted ring, johnson, or
moebius counter.
➢If the clock pulses are applied after clearing the FF’s, square waveform is obtained at the Q outputs.
➢It is useful for the generation of multiphase clock.
Ring Counter
➢Ring counters are constructed by modifying the serial-in, serial-out, shift registers. There are two types of
ring counters- basic ring counter & Johnson counter.
➢The basic ring counter can be obtained from a serial-in, serial-out, shift register by connecting Q output of
the last FF to D input of first FF.
➢The ring counter is the decimal counter. It is divide-by-N counter, where N is the number of stages. The
keyboard encoder is an application of a ring counter.
Twisted Ring Counter (Johnson Counter)
➢It is obtained from a serial-in, serial-out shift register by providing a feedback from Q bar of last FF to the
D input of first FF, called as twisted ring counter.
➢The output Q is connected to the D input of next stage.
➢It produces the unique sequence of states.
➢Initially all the FF’s are reset i.e. the state of counter is 0000.
➢After each clock pulse, the level of Q1 is shifted to Q2, the level of Q2 to Q3, Q3 to Q4 & finally Q4 bar to
Q1. The sequence is repeated after every 8 clock pulse.
➢N Flip-Flop or n-bit Johnson counter can have 2n unique states and can count up to 2n states. So it is mod-
2n counter.
Twisted Ring Counter (Johnson Counter)
Advantages:
1. It is more economical than ring counter but less than ripple counter.
Disadvantages:
1. It requires 2 input gates for decoding regardless of number of Flip-Flops.
2. Both the ring counters suffer from problem of lock out i.e. if the counter finds itself in an unused
state, it will persist in moving from one unused state to another and will never find its way to a used
state.
Modulus of the counter (IC 7490)
7490 Asynchronous Counter IC: (Modulus of the counter)
➢ IC’s available are divided into 3 groups A,B,C depending on its features. It consists of four MS-FF.
➢ The load, set & reset (clear) operations are asynchronous. i.e. independent of clock pulse.
➢ It consists of four FF’s internally connected to provide mod-2 counter & a mod-5 counter. These
counters can be used independently or in combination.
➢ FFA operates as a mod-2 counter whereas the combination of FFB, FFC & FFD form a mod-5 counter.
➢ The two reset inputs R1 & R2 both are connected to logic 1 level for clearing all FF’s.
➢ The two set inputs S1 & S2 when connected to logic 1 level, are used for setting the counter to 1001.
➢ E.g. In a 7490 if QA output is connected to B input and the pulses are applied at A input, find the count
sequence. Ans. It is a decade counter.
Generalized FSM model: Moore and Mealy
➢Combinational logic computes next state and outputs
• Next state is a function of current state and inputs
• Outputs are functions of
• Current state (Moore machine)
• Current state and inputs (Mealy machine)
Inputs
Outputs
Next State
Current State
output
logic
Next-state
logic
Moore and Mealy Machines
There are two types of finite state machine that can be built from sequential logic circuits:
➢Moore machine: The output depends only on the internal state. (Since the internal state only changes on a
clock edge, the output only changes on a clock edge).
➢Mealy Machine: The output depends not only on the internal state, but also on the inputs.
➢A clocked sequential system is a kind of Moore machine.
Moore versus Mealy machines
outputs
state feedback
inputs
reg
combinational
logic for
next state
logic for
outputs
Moore machine
Outputs are a function
of current state
Outputs change
synchronously with
state changes
Mealy machine
Outputs depend on state
and on inputs
Input changes can cause
immediate output changes
(asynchronous)
inputs outputs
state feedback
reg
combinational
logic for
next state
logic for
outputs
Impacts start of the FSM design procedure
➢Counter-design procedure
1. State diagram
2. State-transition table
3. Next-state logic minimization
4. Implement the design
➢FSM-design procedure
1. State diagram
2. State-transition table
3. State minimization
4. State encoding
5. Next-state logic minimization
6. Implement the design
State Diagrams
➢ Moore machine
• Each state is labeled by a pair:
state-name/output or state-name [output]
➢ Mealy machine
• Each transition arc is labeled by a pair:
input-condition/output
D Q
Q
D Q
Q
D Q
Q
D Q
Q
A
B
clock
out
D Q
Q
D Q
Q
A
B
clock
out
Example 10 → 01: Moore or Mealy?
• Circuits recognize AB=10 followed by AB=01
• What kinds of machines are they?
Moore
Mealy
Example “01 or 10” detector: a Moore machine
• Output is a function of state only
• Specify output in the state bubble
D/1
E/1
B/0
A/0
C/0
1
0
0
0
0
1
1
1
1
0
reset
current next current
reset input state state output
1 – – A 0
0 0 A B 0
0 1 A C 0
0 0 B B 0
0 1 B D 0
0 0 C E 0
0 1 C C 0
0 0 D E 1
0 1 D C 1
0 0 E B 1
0 1 E D 1
Example “01 or 10” detector: a Mealy machine
• Output is a function of state and inputs
• Specify outputs on transition arcs
current next current
reset input state state output
B
A
C
0/1
0/0
0/0
1/1
1/0
1/0
reset/0
1 – – A 0
0 0 A B 0
0 1 A C 0
0 0 B B 0
0 1 B C 1
0 0 C B 1
0 1 C C 0
Detect input sequence 1101
fsm
din
doutclk
clr
din
dout
1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0
0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0
Creating a State Diagram
Detect input sequence 1101
S0
0
S1
0
S11
0
S110
0
S1101
1
1
1
0
1
0
1
0
0
1
0
CLR
Mealy and Moore Machine
In general, a sequential machine will have the following:
1. A set S containing a finite number, say p, of internal states, so that
S={S1, S2,……Sp}
2. A set X having a finite number, say n, of inputs, so that
X={X1, X2,……Xn}
3. A set Z containing a finite number, say m, of outputs, so that
Z={Z1, Z2,……Zm}
4. A characterizing function f that uniquely defines the next state St+1 as a function of the present state St and the
present input Xt , so that St+1 = f(St , Xt )
5.A) Mealy machine
A characterizing function g that uniquely defines the output Zt as a function of the present input Xt and the
present internal state St , so that
Zt = g(St , Xt )
5.B) Moore machine
A characterizing function g that uniquely defines the output Zt as a function of the present internal state St , so that
Zt = g(St )
Mealy and Moore Machine
A sequential machine can therefore formally be defined as follows:
Definition:A sequential machine is a quintuple,
M=(X,Z,S,f,g), where X, Z and S are the finite and nonempty sets of inputs, outputs, and states
respectively.
f is the next-state function, such that
St+1 = f(St , Xt )
and the g is the output function such that
Zt = g(St , Xt ) for a Mealy machine
Zt = g(St ) for a Moore machine
To describe a sequential machine, either a state table or a state diagram is used.
State table
➢Table1 is a state table describing an example sequential
machine M1. It can be seen that machine M1 has a set of
four internal states A,B,C and D, a set of two inputs I1 and
I2 and a set of outputs O1 ,O2
➢The characterizing functions f and g are depicted in
tabular form, which is the state table.
State table
• State table of a Mealy machine M1
Present state Next state, output
Input
I1 I2
A A,O1 B,O2
B D,O2 A,O1
C B,O1 D,O2
D A,O1 C,O1
State table
➢ For example, for the present state B when the input is I1, the next state is D and the output is O2. If
the input is I2, the next state is A and the output is O1.
➢ Thus the table shows the next state and the output for each combination of the present state and the
input.
➢ Since the output of the machine M1 depends on both the present state and the input, it is a Mealy
machine.
➢ Table2 shows the state table of a Moore machine. Here the output is independent of the input and
depends only on the present state of the machine.
➢ Therefore, this table has a separate column defining the outputs, and two input columns defining the
next state without having any output associated with it.
State table
• State table of a Moore machine M2
Present state Next state
Input
I1 I2
Output
A B C O1
B C D O2
C A C O1
D A C O2
State table
➢Another interesting property of of the machines M1, M2 which we have depicted in the two state tables is
that for all combinations of present state and input, the next state and the output are completely
specified. Such machines are therefore called completely specified sequential machines (CSSMs).
➢There is another clas of sequential machines, where sometimes the next state or the output or both may
remain unspecified. Such machines are known as incompetely specified sequential machines (ISSMs).
State diagram
➢The information contained in the state table can also be shown in a graphical manner with the help of
nodes conected by directed graphs. Such diagrams are called state diagrams.
➢Following figures show the state diagrams of machines M1 and M2 respectively.
State diagram of the Mealy machine M1 State diagram of the Moore machine M2
B
A
C
0/1
0/0
0/0
1/1
1/0
1/0
reset/0
D/1
E/1
B/0
A/0
C/0
1
0
0
0
0
1
1
1
1
0
reset
Comparing Moore and Mealy machines
• Moore machines
+ Safer to use because outputs change at clock edge
– May take additional logic to decode state into outputs
• Mealy machines
+ Typically have fewer states
+ React faster to inputs — don't wait for clock
– Asynchronous outputs can be dangerous
Synchronous (registered) Mealy machine
• Registered state and registered outputs
• No glitches on outputs
• No race conditions between communicating machines
inputs outputs
state feedback
reg
combinational
logic for
next state
logic for
outputs
reg
D Q
Q
B
A
clock
out
D Q
Q
D Q
Q
clock
out
A
B
Example “=01”: Moore or Mealy?
➢ Recognize AB = 01
➢ Mealy or Moore?
Registered Mealy
(actually Moore)
Moore
Applications of Flip-Flops
Counters
➢ A clocked sequential circuit that goes through a predetermined sequence of states.
➢ A commonly used counter is an n-bit binary counter. This has n FFs and 2n states which are passed through in
the order 0, 1, 2, ….2n-1, 0, 1, .
Uses include:
➢ Counting
➢ Producing delays of a particular duration.
➢ Sequencers for control logic in a processor.
➢ Divide by m counter (a divider), as used in a digital watch.
Memories, e.g.,
➢ Shift register
➢ Parallel loading shift register : can be used for parallel to serial conversion in serial data communication
➢ Serial in, parallel out shift register: can be used for serial to parallel conversion in a serial data
communication system.
End
of
Unit-4

More Related Content

What's hot

Group 11 introduction to registers and counters
Group 11 introduction to registers and countersGroup 11 introduction to registers and counters
Group 11 introduction to registers and counters
university of education,Lahore
 
Chapter#8
Chapter#8Chapter#8
CSL 202, Counters using Flipflops
CSL 202, Counters using FlipflopsCSL 202, Counters using Flipflops
CSL 202, Counters using Flipflops
CKSunith1
 
Eceg 3201-dld-lec 12-synchronous_counter_design
Eceg 3201-dld-lec 12-synchronous_counter_designEceg 3201-dld-lec 12-synchronous_counter_design
Eceg 3201-dld-lec 12-synchronous_counter_design
Nebiyu Musie
 
Lecture7
Lecture7Lecture7
Lecture7
Mahmut Yildiz
 
Counters
CountersCounters
Counters
Randaqra
 
FYBSC IT Digital Electronics Unit V Chapter II Shift Register
FYBSC IT Digital Electronics Unit V Chapter II Shift RegisterFYBSC IT Digital Electronics Unit V Chapter II Shift Register
FYBSC IT Digital Electronics Unit V Chapter II Shift Register
Arti Parab Academics
 
Counters
CountersCounters
Counters
CountersCounters
Counters
Ravi Maurya
 
Embedded systems, lesson 16
Embedded systems, lesson 16Embedded systems, lesson 16
Embedded systems, lesson 16
REKHASENCHAgs0801bm1
 
Shift Registers
Shift RegistersShift Registers
Shift Registers
Abhilash Nair
 
Logic Design - Chapter 8: counters
Logic Design - Chapter 8: countersLogic Design - Chapter 8: counters
Logic Design - Chapter 8: counters
Gouda Mando
 
Digital electronics sequential ckts counters
Digital electronics sequential ckts countersDigital electronics sequential ckts counters
Digital electronics sequential ckts counters
Nilesh Bhaskarrao Bahadure
 
3 Bit Synchronous Down Counter
3 Bit Synchronous Down Counter3 Bit Synchronous Down Counter
3 Bit Synchronous Down Counter
Rabin BK
 
Module 4 registers and counters
Module 4 registers and counters Module 4 registers and counters
Module 4 registers and counters
Deepak John
 
Registers-shift registers
Registers-shift registersRegisters-shift registers
Registers-shift registers
Bilawal Fayyaz
 
Counter
CounterCounter
Counter
Naufal Qodari
 
Binary up and down counter using IC 74193
Binary up and down counter using IC 74193Binary up and down counter using IC 74193
Binary up and down counter using IC 74193
Yashvant Kathiriya
 
Mod 10 synchronous counter updated
Mod 10 synchronous counter updatedMod 10 synchronous counter updated
Mod 10 synchronous counter updated
DANISHAMIN950
 
Registers-shift register
Registers-shift registerRegisters-shift register
Registers-shift register
Bilawal Fiaz
 

What's hot (20)

Group 11 introduction to registers and counters
Group 11 introduction to registers and countersGroup 11 introduction to registers and counters
Group 11 introduction to registers and counters
 
Chapter#8
Chapter#8Chapter#8
Chapter#8
 
CSL 202, Counters using Flipflops
CSL 202, Counters using FlipflopsCSL 202, Counters using Flipflops
CSL 202, Counters using Flipflops
 
Eceg 3201-dld-lec 12-synchronous_counter_design
Eceg 3201-dld-lec 12-synchronous_counter_designEceg 3201-dld-lec 12-synchronous_counter_design
Eceg 3201-dld-lec 12-synchronous_counter_design
 
Lecture7
Lecture7Lecture7
Lecture7
 
Counters
CountersCounters
Counters
 
FYBSC IT Digital Electronics Unit V Chapter II Shift Register
FYBSC IT Digital Electronics Unit V Chapter II Shift RegisterFYBSC IT Digital Electronics Unit V Chapter II Shift Register
FYBSC IT Digital Electronics Unit V Chapter II Shift Register
 
Counters
CountersCounters
Counters
 
Counters
CountersCounters
Counters
 
Embedded systems, lesson 16
Embedded systems, lesson 16Embedded systems, lesson 16
Embedded systems, lesson 16
 
Shift Registers
Shift RegistersShift Registers
Shift Registers
 
Logic Design - Chapter 8: counters
Logic Design - Chapter 8: countersLogic Design - Chapter 8: counters
Logic Design - Chapter 8: counters
 
Digital electronics sequential ckts counters
Digital electronics sequential ckts countersDigital electronics sequential ckts counters
Digital electronics sequential ckts counters
 
3 Bit Synchronous Down Counter
3 Bit Synchronous Down Counter3 Bit Synchronous Down Counter
3 Bit Synchronous Down Counter
 
Module 4 registers and counters
Module 4 registers and counters Module 4 registers and counters
Module 4 registers and counters
 
Registers-shift registers
Registers-shift registersRegisters-shift registers
Registers-shift registers
 
Counter
CounterCounter
Counter
 
Binary up and down counter using IC 74193
Binary up and down counter using IC 74193Binary up and down counter using IC 74193
Binary up and down counter using IC 74193
 
Mod 10 synchronous counter updated
Mod 10 synchronous counter updatedMod 10 synchronous counter updated
Mod 10 synchronous counter updated
 
Registers-shift register
Registers-shift registerRegisters-shift register
Registers-shift register
 

Similar to Ade(unit 4) Counters

FYBSC IT Digital Electronics Unit V Chapter I Counters
FYBSC IT Digital Electronics Unit V Chapter I CountersFYBSC IT Digital Electronics Unit V Chapter I Counters
FYBSC IT Digital Electronics Unit V Chapter I Counters
Arti Parab Academics
 
unit 5.pptx
unit 5.pptxunit 5.pptx
unit 5.pptx
ssuser022fec
 
Presentation on Counters for (Digital Systems Design).pptx
Presentation on Counters for (Digital Systems Design).pptxPresentation on Counters for (Digital Systems Design).pptx
Presentation on Counters for (Digital Systems Design).pptx
Aniruddh70
 
Chapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdfChapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdf
TamiratDejene1
 
Unit_5 – Sequential Circuits.pptx
Unit_5 – Sequential Circuits.pptxUnit_5 – Sequential Circuits.pptx
Unit_5 – Sequential Circuits.pptx
DrashtiPatel275412
 
Digital Electronics – Unit III.pdf
Digital Electronics – Unit III.pdfDigital Electronics – Unit III.pdf
Digital Electronics – Unit III.pdf
Kannan Kanagaraj
 
digital Counter
digital Counterdigital Counter
digital Counter
shamshad alam
 
Unit4_DE.pptx
Unit4_DE.pptxUnit4_DE.pptx
Unit4_DE.pptx
PriyankaJain98423
 
Introduction to Counters
Introduction to CountersIntroduction to Counters
Introduction to Counters
ISMT College
 
EC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCET
EC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCETEC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCET
EC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCET
SeshaVidhyaS
 
Counters_pptx.pptx
Counters_pptx.pptxCounters_pptx.pptx
Counters_pptx.pptx
YeHtetAung35
 
Counters
CountersCounters
Counters
Ketaki_Pattani
 
Digital Fundamental Material for the student
Digital Fundamental Material for the studentDigital Fundamental Material for the student
Digital Fundamental Material for the student
jainyshah20
 
Registers and counters
Registers and countersRegisters and counters
Registers and counters
Heman Pathak
 
Counter - by Zakariya Hossain
Counter - by Zakariya HossainCounter - by Zakariya Hossain
Counter - by Zakariya Hossain
Zakariya Hossain
 
COUNTERS.pptx
COUNTERS.pptxCOUNTERS.pptx
COUNTERS.pptx
SaifURehmanSidhu
 
Introduction to flipflops basic of elctronics COA.pptx
Introduction to flipflops basic of elctronics COA.pptxIntroduction to flipflops basic of elctronics COA.pptx
Introduction to flipflops basic of elctronics COA.pptx
Saini71
 
Unit I_CDA-1 computer design and applications.
Unit I_CDA-1 computer design and applications.Unit I_CDA-1 computer design and applications.
Unit I_CDA-1 computer design and applications.
brijeshgolani77
 
Digital counter
Digital counter Digital counter
Digital counter
Bhaskar Kumar Jha
 
Digital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptxDigital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptx
Thapar Institute
 

Similar to Ade(unit 4) Counters (20)

FYBSC IT Digital Electronics Unit V Chapter I Counters
FYBSC IT Digital Electronics Unit V Chapter I CountersFYBSC IT Digital Electronics Unit V Chapter I Counters
FYBSC IT Digital Electronics Unit V Chapter I Counters
 
unit 5.pptx
unit 5.pptxunit 5.pptx
unit 5.pptx
 
Presentation on Counters for (Digital Systems Design).pptx
Presentation on Counters for (Digital Systems Design).pptxPresentation on Counters for (Digital Systems Design).pptx
Presentation on Counters for (Digital Systems Design).pptx
 
Chapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdfChapter 7_Counters (EEEg4302).pdf
Chapter 7_Counters (EEEg4302).pdf
 
Unit_5 – Sequential Circuits.pptx
Unit_5 – Sequential Circuits.pptxUnit_5 – Sequential Circuits.pptx
Unit_5 – Sequential Circuits.pptx
 
Digital Electronics – Unit III.pdf
Digital Electronics – Unit III.pdfDigital Electronics – Unit III.pdf
Digital Electronics – Unit III.pdf
 
digital Counter
digital Counterdigital Counter
digital Counter
 
Unit4_DE.pptx
Unit4_DE.pptxUnit4_DE.pptx
Unit4_DE.pptx
 
Introduction to Counters
Introduction to CountersIntroduction to Counters
Introduction to Counters
 
EC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCET
EC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCETEC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCET
EC8392 Digital Electronics- Unit-3 -S.Sesha Vidhya-ASP-ECE-RMKCET
 
Counters_pptx.pptx
Counters_pptx.pptxCounters_pptx.pptx
Counters_pptx.pptx
 
Counters
CountersCounters
Counters
 
Digital Fundamental Material for the student
Digital Fundamental Material for the studentDigital Fundamental Material for the student
Digital Fundamental Material for the student
 
Registers and counters
Registers and countersRegisters and counters
Registers and counters
 
Counter - by Zakariya Hossain
Counter - by Zakariya HossainCounter - by Zakariya Hossain
Counter - by Zakariya Hossain
 
COUNTERS.pptx
COUNTERS.pptxCOUNTERS.pptx
COUNTERS.pptx
 
Introduction to flipflops basic of elctronics COA.pptx
Introduction to flipflops basic of elctronics COA.pptxIntroduction to flipflops basic of elctronics COA.pptx
Introduction to flipflops basic of elctronics COA.pptx
 
Unit I_CDA-1 computer design and applications.
Unit I_CDA-1 computer design and applications.Unit I_CDA-1 computer design and applications.
Unit I_CDA-1 computer design and applications.
 
Digital counter
Digital counter Digital counter
Digital counter
 
Digital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptxDigital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptx
 

Recently uploaded

VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
PIMR BHOPAL
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
bjmsejournal
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
morris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdfmorris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdf
ycwu0509
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 

Recently uploaded (20)

VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
morris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdfmorris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdf
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 

Ade(unit 4) Counters

  • 1. Courtesy: R. P. Jain (Modern Digital Electronics) Analog and Digital Electronics (Second Year BTech Computer) (2019-20) (Faculty: Mr. Y. K. Sharma)
  • 2. Courtesy: R. P. Jain & J. S. Katre UNIT- 4 Counters
  • 3. Counters ➢Counters: Asynchronous counter. Synchronous counter, ring counters, Johnson Counter, Modulus of the counter (IC 7490). ➢Synchronous Sequential Circuit Design: Models – Moore and Mealy, State diagram and State Tables, Design Procedure, Sequence generator and detector. ➢Asynchronous Sequential Circuit Design: Difference with synchronous circuit design, design principles and procedure, applications.
  • 4. Counters ➢There are two types of counters Asynchronous (ripple) & Synchronous counters. ➢Asynchronous counter is easy to design & requires the least amount of homework. ➢Asynchronous counter is not triggered simultaneously & is also called as serial or series counter. ➢Design of Synchronous counter requires some amount of homework & each Flip-Flop is triggered simultaneously. ➢Each count of the counter is called as a state of the counter. ➢The number of states through which the counter passes before returning to the starting state is called the modulus of the counter. ➢E.g. A 2-bit counter has 4 states, it is called a mod-4 counter & as it divides the clock signal frequency by 4, it is called as divide-by-4 counter. ➢An n-bit counter will have n FF’s & 2n states, and divides the input frequency by 2n. Hence it is called as divide-by-2n counter. The LSB of ripple counters is the Q output of the FF to which the external clock is applied.
  • 5. Counters Classification of Sequential Circuits: ➢ Synchronous sequential circuits: Contents of memory elements can be changed only at the rising or falling edges of clock signal. ➢ Asynchronous sequential circuits: Contents of memory elements can be changed at any instant of time. Asynchronous Synchronous 1. Depends upon the sequence 1. Behaviour can be defined from the knowledge of its signal at in which the input signals discrete instants of time. change. 2. Commonly used memory 2. Memory elements used are Flip-Flops. elements are time delays. 3. Design is tedious. 3. Design is easy. 4. They are combinational circuit 4. Synchronization is achieved by system clock. with feedback. 5. Also called as clocked sequential circuit.
  • 6. ➢It is common for the FF types we have mentioned to also have additional so called ‘asynchronous’ inputs ➢They are called asynchronous since they take effect independently of any clock or enable inputs. ➢Reset/Clear – force Q to 0 ➢Preset/Set – force Q to 1 ➢Often used to force a synchronous circuit into a known state, say at start-up. Asynchronous Inputs
  • 7. Ripple Counters ➢It can be designed by using negative edge triggered T-type FF’s operating in toggle mode, i.e T=1. ➢Since FF’s are not clocked using the same clock therefore it is called as asynchronous or ripple counters.
  • 8. Ripple Counters ➢ Timing diagram for ripple counter. ➢ Outputs do not change synchronously, so hard to know when count output is actually valid. ➢Propagation delay builds up from stage to stage, limiting maximum clock speed before miscounting occurs.
  • 9. Synchronous Counters ➢All flip flop clock inputs are directly connected to the clock signal and so all FF outputs change at the same time, i.e. synchronously. ➢More complex combinational logic is now needed to generate the appropriate FF input signals(Which will be different depending upon the type of FF chosen.) ➢We can design synchronous counters using any type of Flip-Flops. ➢We will consider using D-type FFs to design 0-7 up counter. ➢ While designing counter we will make use of a modified state transition table. This table has additional columns that defines the required FF inputs(or excitation table values). ➢We make use of excitation table for a particular type of FF. ➢Firstly investigate the so called characteristic table and characteristic equation for a FF. ➢For D-FFs it is not necessary to write out the FF input columns, since we know they are identical to those for the next state. ➢To design the circuit we need to determine appropriate combinational logic circuits which will generate the required FF inputs from the current states. ➢This can be done using Boolean algebra or using K-maps.
  • 15.
  • 16.
  • 17.
  • 19. Ring Counter ➢If the serial output Q0 of the shift register is connected back to the serial input, then an injected pulse will keep circulating. This circuit is referred to as a ring counter. ➢The pulse is injected by entering 00001 in the parallel form after clearing the Flip-Flop’s. ➢When Clock pulses are applied, this 1 circulates around the circuit. ➢The outputs are sequential non-overlapping pulses which are useful for control-state counters, for stepper motor (which rotates in steps) which require sequential pulses to rotate it from one position to the next etc. ➢This circuit can also be used for counting the number of pulses. ➢The number of pulses counted is read by noting which FF is in state 1. ➢Since there is one pulse at the output for each of the N clock pulses, this circuit is referred to as a divide-by- N counter or an N:1 scalar. ➢If Q0 is connected to the serial output, the resulting circuit is referred to as a twisted ring, johnson, or moebius counter. ➢If the clock pulses are applied after clearing the FF’s, square waveform is obtained at the Q outputs. ➢It is useful for the generation of multiphase clock.
  • 20. Ring Counter ➢Ring counters are constructed by modifying the serial-in, serial-out, shift registers. There are two types of ring counters- basic ring counter & Johnson counter. ➢The basic ring counter can be obtained from a serial-in, serial-out, shift register by connecting Q output of the last FF to D input of first FF. ➢The ring counter is the decimal counter. It is divide-by-N counter, where N is the number of stages. The keyboard encoder is an application of a ring counter.
  • 21. Twisted Ring Counter (Johnson Counter) ➢It is obtained from a serial-in, serial-out shift register by providing a feedback from Q bar of last FF to the D input of first FF, called as twisted ring counter. ➢The output Q is connected to the D input of next stage. ➢It produces the unique sequence of states. ➢Initially all the FF’s are reset i.e. the state of counter is 0000. ➢After each clock pulse, the level of Q1 is shifted to Q2, the level of Q2 to Q3, Q3 to Q4 & finally Q4 bar to Q1. The sequence is repeated after every 8 clock pulse. ➢N Flip-Flop or n-bit Johnson counter can have 2n unique states and can count up to 2n states. So it is mod- 2n counter.
  • 22. Twisted Ring Counter (Johnson Counter) Advantages: 1. It is more economical than ring counter but less than ripple counter. Disadvantages: 1. It requires 2 input gates for decoding regardless of number of Flip-Flops. 2. Both the ring counters suffer from problem of lock out i.e. if the counter finds itself in an unused state, it will persist in moving from one unused state to another and will never find its way to a used state.
  • 23. Modulus of the counter (IC 7490) 7490 Asynchronous Counter IC: (Modulus of the counter) ➢ IC’s available are divided into 3 groups A,B,C depending on its features. It consists of four MS-FF. ➢ The load, set & reset (clear) operations are asynchronous. i.e. independent of clock pulse. ➢ It consists of four FF’s internally connected to provide mod-2 counter & a mod-5 counter. These counters can be used independently or in combination. ➢ FFA operates as a mod-2 counter whereas the combination of FFB, FFC & FFD form a mod-5 counter. ➢ The two reset inputs R1 & R2 both are connected to logic 1 level for clearing all FF’s. ➢ The two set inputs S1 & S2 when connected to logic 1 level, are used for setting the counter to 1001. ➢ E.g. In a 7490 if QA output is connected to B input and the pulses are applied at A input, find the count sequence. Ans. It is a decade counter.
  • 24. Generalized FSM model: Moore and Mealy ➢Combinational logic computes next state and outputs • Next state is a function of current state and inputs • Outputs are functions of • Current state (Moore machine) • Current state and inputs (Mealy machine) Inputs Outputs Next State Current State output logic Next-state logic
  • 25. Moore and Mealy Machines There are two types of finite state machine that can be built from sequential logic circuits: ➢Moore machine: The output depends only on the internal state. (Since the internal state only changes on a clock edge, the output only changes on a clock edge). ➢Mealy Machine: The output depends not only on the internal state, but also on the inputs. ➢A clocked sequential system is a kind of Moore machine.
  • 26. Moore versus Mealy machines outputs state feedback inputs reg combinational logic for next state logic for outputs Moore machine Outputs are a function of current state Outputs change synchronously with state changes Mealy machine Outputs depend on state and on inputs Input changes can cause immediate output changes (asynchronous) inputs outputs state feedback reg combinational logic for next state logic for outputs
  • 27. Impacts start of the FSM design procedure ➢Counter-design procedure 1. State diagram 2. State-transition table 3. Next-state logic minimization 4. Implement the design ➢FSM-design procedure 1. State diagram 2. State-transition table 3. State minimization 4. State encoding 5. Next-state logic minimization 6. Implement the design
  • 28. State Diagrams ➢ Moore machine • Each state is labeled by a pair: state-name/output or state-name [output] ➢ Mealy machine • Each transition arc is labeled by a pair: input-condition/output
  • 29. D Q Q D Q Q D Q Q D Q Q A B clock out D Q Q D Q Q A B clock out Example 10 → 01: Moore or Mealy? • Circuits recognize AB=10 followed by AB=01 • What kinds of machines are they? Moore Mealy
  • 30. Example “01 or 10” detector: a Moore machine • Output is a function of state only • Specify output in the state bubble D/1 E/1 B/0 A/0 C/0 1 0 0 0 0 1 1 1 1 0 reset current next current reset input state state output 1 – – A 0 0 0 A B 0 0 1 A C 0 0 0 B B 0 0 1 B D 0 0 0 C E 0 0 1 C C 0 0 0 D E 1 0 1 D C 1 0 0 E B 1 0 1 E D 1
  • 31. Example “01 or 10” detector: a Mealy machine • Output is a function of state and inputs • Specify outputs on transition arcs current next current reset input state state output B A C 0/1 0/0 0/0 1/1 1/0 1/0 reset/0 1 – – A 0 0 0 A B 0 0 1 A C 0 0 0 B B 0 0 1 B C 1 0 0 C B 1 0 1 C C 0
  • 32. Detect input sequence 1101 fsm din doutclk clr din dout 1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0
  • 33. Creating a State Diagram Detect input sequence 1101 S0 0 S1 0 S11 0 S110 0 S1101 1 1 1 0 1 0 1 0 0 1 0 CLR
  • 34. Mealy and Moore Machine In general, a sequential machine will have the following: 1. A set S containing a finite number, say p, of internal states, so that S={S1, S2,……Sp} 2. A set X having a finite number, say n, of inputs, so that X={X1, X2,……Xn} 3. A set Z containing a finite number, say m, of outputs, so that Z={Z1, Z2,……Zm} 4. A characterizing function f that uniquely defines the next state St+1 as a function of the present state St and the present input Xt , so that St+1 = f(St , Xt ) 5.A) Mealy machine A characterizing function g that uniquely defines the output Zt as a function of the present input Xt and the present internal state St , so that Zt = g(St , Xt ) 5.B) Moore machine A characterizing function g that uniquely defines the output Zt as a function of the present internal state St , so that Zt = g(St )
  • 35. Mealy and Moore Machine A sequential machine can therefore formally be defined as follows: Definition:A sequential machine is a quintuple, M=(X,Z,S,f,g), where X, Z and S are the finite and nonempty sets of inputs, outputs, and states respectively. f is the next-state function, such that St+1 = f(St , Xt ) and the g is the output function such that Zt = g(St , Xt ) for a Mealy machine Zt = g(St ) for a Moore machine To describe a sequential machine, either a state table or a state diagram is used.
  • 36. State table ➢Table1 is a state table describing an example sequential machine M1. It can be seen that machine M1 has a set of four internal states A,B,C and D, a set of two inputs I1 and I2 and a set of outputs O1 ,O2 ➢The characterizing functions f and g are depicted in tabular form, which is the state table.
  • 37. State table • State table of a Mealy machine M1 Present state Next state, output Input I1 I2 A A,O1 B,O2 B D,O2 A,O1 C B,O1 D,O2 D A,O1 C,O1
  • 38. State table ➢ For example, for the present state B when the input is I1, the next state is D and the output is O2. If the input is I2, the next state is A and the output is O1. ➢ Thus the table shows the next state and the output for each combination of the present state and the input. ➢ Since the output of the machine M1 depends on both the present state and the input, it is a Mealy machine. ➢ Table2 shows the state table of a Moore machine. Here the output is independent of the input and depends only on the present state of the machine. ➢ Therefore, this table has a separate column defining the outputs, and two input columns defining the next state without having any output associated with it.
  • 39. State table • State table of a Moore machine M2 Present state Next state Input I1 I2 Output A B C O1 B C D O2 C A C O1 D A C O2
  • 40. State table ➢Another interesting property of of the machines M1, M2 which we have depicted in the two state tables is that for all combinations of present state and input, the next state and the output are completely specified. Such machines are therefore called completely specified sequential machines (CSSMs). ➢There is another clas of sequential machines, where sometimes the next state or the output or both may remain unspecified. Such machines are known as incompetely specified sequential machines (ISSMs).
  • 41. State diagram ➢The information contained in the state table can also be shown in a graphical manner with the help of nodes conected by directed graphs. Such diagrams are called state diagrams. ➢Following figures show the state diagrams of machines M1 and M2 respectively. State diagram of the Mealy machine M1 State diagram of the Moore machine M2 B A C 0/1 0/0 0/0 1/1 1/0 1/0 reset/0 D/1 E/1 B/0 A/0 C/0 1 0 0 0 0 1 1 1 1 0 reset
  • 42. Comparing Moore and Mealy machines • Moore machines + Safer to use because outputs change at clock edge – May take additional logic to decode state into outputs • Mealy machines + Typically have fewer states + React faster to inputs — don't wait for clock – Asynchronous outputs can be dangerous
  • 43. Synchronous (registered) Mealy machine • Registered state and registered outputs • No glitches on outputs • No race conditions between communicating machines inputs outputs state feedback reg combinational logic for next state logic for outputs reg
  • 44. D Q Q B A clock out D Q Q D Q Q clock out A B Example “=01”: Moore or Mealy? ➢ Recognize AB = 01 ➢ Mealy or Moore? Registered Mealy (actually Moore) Moore
  • 45. Applications of Flip-Flops Counters ➢ A clocked sequential circuit that goes through a predetermined sequence of states. ➢ A commonly used counter is an n-bit binary counter. This has n FFs and 2n states which are passed through in the order 0, 1, 2, ….2n-1, 0, 1, . Uses include: ➢ Counting ➢ Producing delays of a particular duration. ➢ Sequencers for control logic in a processor. ➢ Divide by m counter (a divider), as used in a digital watch. Memories, e.g., ➢ Shift register ➢ Parallel loading shift register : can be used for parallel to serial conversion in serial data communication ➢ Serial in, parallel out shift register: can be used for serial to parallel conversion in a serial data communication system.