Digital Devices and System
Digital Devices and System
Introduction
In our previous sections, we learned about combinational circuit and their working.
The combinational circuits have set of outputs, which depends only on the present
combination of inputs. Below is the block diagram of the synchronous logic circuit.
The sequential circuit is a special type of circuit that has a series of inputs and
outputs. The outputs of the sequential circuits depend on both the combination of
present inputs and previous outputs. The previous output is treated as the present
state. So, the sequential circuit contains the combinational circuit and its memory
storage elements. A sequential circuit doesn't need to always contain a
combinational circuit. So, the sequential circuit can contain only the memory
element.
Difference between the combinational circuits and sequential circuits are given
below:
1 The outputs of the combinational circuit The outputs of the sequential circuits de
) depend only on the present inputs. both present inputs and present state(
output).
2 The feedback path is not present in the The feedback path is present in the se
) combinational circuit. circuits.
4 The clock signal is not required for The clock signal is required for sequential ci
) combinational circuits.
5 The combinational circuit is simple to It is not simple to design a sequential circui
) design.
A clock signal is considered as the square wave. Sometimes, the signal stays at logic,
either high 5V or low 0V, to an equal amount of time. It repeats with a certain time
period, which will be equal to twice the 'ON time' or 'OFF time'.
Types of Triggering
These are two types of triggering in sequential circuits:
Level triggering
The logic High and logic Low are the two levels in the clock signal. In level triggering,
when the clock pulse is at a particular level, only then the circuit is activated. There
are the following types of level triggering:
Edge triggering
In clock signal of edge triggering, two types of transitions occur, i.e., transition either
from Logic Low to Logic High or Logic High to Logic Low.
Based on the transitions of the clock signal, there are the following types of edge
triggering:
SR Flip Flop
The S-R flip flop is the most common flip flop used in the digital system. In SR flip
flop, when the set input "S" is true, the output Y will be high, and Y' will be low. It is
required that the wiring of the circuit is maintained when the outputs are
established. We maintain the wiring until set or reset input goes high, or power is
shutdown.
The S-R flip flop is the simplest and easiest circuit to understand.
Truth Table:
J-K Flip-flop
The JK flip flop is used to remove the drawback of the S-R flip flop, i.e., undefined
states. The JK flip flop is formed by doing modification in the SR flip flop. The S-R flip
flop is improved in order to construct the J-K flip flop. When S and R input is set to
true, the SR flip flop gives an inaccurate result. But in the case of JK flip flop, it gives
the correct output.
In J-K flip flop, if both of its inputs are different, the value of J at the next clock edge
is taken by the output Y. If both of its input is low, then no change occurs, and if high
at the clock edge, then from one state to the other, the output will be toggled. The JK
Flip Flop is a Set or Reset Flip flop in the digital system.
Truth Table:
D Flip Flop
D flip flop is a widely used flip flop in digital systems. The D flip flop is mostly used in
shift-registers, counters, and input synchronization.
Truth Table:
T Flip Flop
Just like JK flip-flop, T flip flop is used. Unlike JK flip flop, in T flip flop, there is only
single input with the clock input. The T flip flop is constructed by connecting both of
the inputs of JK flip flop together as a single input.
The T flip flop is also known as Toggle flip-flop. These T flip-flops are able to find
the complement of its state.
Truth Table:
SR Flip Flop
The SR flip flop is a 1-bit memory bistable device having two inputs, i.e., SET and
RESET. The SET input 'S' set the device or produce the output 1, and the RESET input
'R' reset the device or produce the output 0. The SET and RESET inputs are labeled
as S and R, respectively.
The SR flip flop stands for "Set-Reset" flip flop. The reset input is used to get back
the flip flop to its original state from the current state with an output 'Q'. This output
depends on the set and reset conditions, which is either at the logic level "0" or "1".
The NAND gate SR flip flop is a basic flip flop which provides feedback from both of
its outputs back to its opposing input. This circuit is used to store the single data bit
in the memory circuit. So, the SR flip flop has a total of three inputs, i.e., 'S' and 'R',
and current output 'Q'. This output 'Q' is related to the current history or state. The
term "flip-flop" relates to the actual operation of the device, as it can be "flipped" to
a logic set state or "flopped" back to the opposing logic reset state.
Block Diagram:
Circuit Diagram:
Now, if the input R is changed to 1 with 'S' remaining 1, the inputs of NAND gate 'Y' is
R=1 and B=0. Here, one of the inputs is also 0, so the output of Q' is 1. So, the flip
flop circuit is set or latched with Q=0 and Q'=1.
Reset State
The output Q' is 0, and output Q is 1 in the second stable state. It is given by R =1
and S = 0. One of the inputs of NAND gate 'X' is 0, and its output Q is 1. Output Q is
faded to NAND gate Y as input B. So, both the inputs to NAND gate Y are set to 1,
therefore, Q' = 0.
Now, if the input S is changed to 0 with 'R' remaining 1, the output Q' will be 0 and
there is no change in state. So, the reset state of the flip flop circuit has been
latched, and the set/reset actions are defined in the following truth table:
From the above truth table, we can see that when set 'S' and reset 'R' inputs are set
to 1, the outputs Q and Q' will be either 1 or 0. These outputs depend on the input
state S or R before the input condition exist. So, when the inputs are 1, the states of
the outputs remain unchanged.
The condition in which both the inputs states are set to 0 is treated as invalid and
must be avoided.
JK Flip Flop
The SR Flip Flop or Set-Reset flip flop has lots of advantages. But, it has the following
switching problems:
o When Set 'S' and Reset 'R' inputs are set to 0, this condition is always avoided.
o When the Set or Reset input changes their state while the enable input is 1,
the incorrect latching action occurs.
The JK flip flop is one of the most used flip flops in digital circuits. The JK flip flop is a
universal flip flop having two inputs 'J' and 'K'. In SR flip flop, the 'S' and 'R' are the
shortened abbreviated letters for Set and Reset, but J and K are not. The J and K are
themselves autonomous letters which are chosen to distinguish the flip flop design
from other types.
The JK flip flop work in the same way as the SR flip flop work. The JK flip flop has 'J'
and 'K' flip flop instead of 'S' and 'R'. The only difference between JK flip flop and SR
flip flop is that when both inputs of SR flip flop is set to 1, the circuit produces the
invalid states as outputs, but in case of JK flip flop, there are no invalid states even if
both 'J' and 'K' flip flops are set to 1.
The JK Flip Flop is a gated SR flip-flop having the addition of a clock input circuitry.
The invalid or illegal output condition occurs when both of the inputs are set to 1 and
are prevented by the addition of a clock input circuit. So, the JK flip-flop has four
possible input combinations, i.e., 1, 0, "no change" and "toggle". The symbol of JK flip
flop is the same as SR Bistable Latch except for the addition of a clock input.
Block Diagram:
Circuit Diagram:
In SR flip flop, both the inputs 'S' and 'R' are replaced by two inputs J and K. It means
the J and K input equates to S and R, respectively.
The two 2-input AND gates are replaced by two 3-input NAND gates. The third input
of each gate is connected to the outputs at Q and Q'. The cross-coupling of the SR
flip-flop permits the previous invalid condition of (S = "1", R = "1") to be used to
produce the "toggle action" as the two inputs are now interlocked.
If the circuit is "set", the J input is interrupted from the "0" position of Q' through the
lower NAND gate. If the circuit is "RESET", K input is interrupted from 0 positions of Q
through the upper NAND gate. Since Q and Q' are always different, we can use them
to control the input. When both inputs 'J' and 'K' are set to 1, the JK toggles the flip
flop as per the given truth table.
Truth Table:
When both of the inputs of JK flip flop are set to 1 and clock input is also pulse "High"
then from the SET state to a RESET state, the circuit will be toggled. The JK flip flop
work as a T-type toggle flip flop when both of its inputs are set to 1.
The JK flip flop is an improved clocked SR flip flop. But it still suffers from
the "race" problem. This problem occurs when the state of the output Q is changed
before the clock input's timing pulse has time to go "Off". We have to keep short
timing plus period (T) for avoiding this period.
D Flip Flop
In SR NAND Gate Bistable circuit, the undefined input condition of SET = "0" and
RESET = "0" is forbidden. It is the drawback of the SR flip flop. This state:
The D flip flop is the most important flip flop from other clocked types. It ensures that
at the same time, both the inputs, i.e., S and R, are never equal to 1. The Delay flip-
flop is designed using a gated SR flip-flop with an inverter connected between the
inputs allowing for a single input D(Data).
This single data input, which is labeled as "D" used in place of the "Set" input and for
the complementary "Reset" input, the inverter is used. Thus, the level-sensitive D-
type or D flip flop is constructed from a level-sensitive SR flip flop.
Block Diagram
Circuit Diagram
We know that the SR flip-flop requires two inputs, i.e., one to "SET" the output and
another to "RESET" the output. By using an inverter, we can set and reset the
outputs with only one input as now the two input signals complement each other. In
SR flip flop, when both the inputs are 0, that state is no longer possible. It is an
ambiguity that is removed by the complement in D-flip flop.
In D flip flop, the single input "D" is referred to as the "Data" input. When the data
input is set to 1, the flip flop would be set, and when it is set to 0, the flip flop would
change and become reset. However, this would be pointless since the output of the
flip flop would always change on every pulse applied to this data input.
The "CLOCK" or "ENABLE" input is used to avoid this for isolating the data input from
the flip flop's latching circuitry. When the clock input is set to true, the D input
condition is only copied to the output Q. This forms the basis of another sequential
device referred to as D Flip Flop.
When the clock input is set to 1, the "set" and "reset" inputs of the flip-flop are both
set to 1. So it will not change the state and store the data present on its output
before the clock transition occurred. In simple words, the output is "latched" at either
0 or 1.
Symbols ↓ and ↑ indicates the direction of the clock pulse. D-type flip flop assumed
these symbols as edge-triggers.
T Flip Flop
In T flip flop, "T" defines the term "Toggle". In SR Flip Flop, we provide only a single
input called "Toggle" or "Trigger" input to avoid an intermediate state occurrence.
Now, this flip-flop work as a Toggle switch. The next output state is changed with the
complement of the present state output. This process is known as "Toggling"'.
We can construct the "T Flip Flop" by making changes in the "JK Flip Flop". The "T Flip
Flop" has only one input, which is constructed by connecting the input of JK flip flop.
This single input is called T. In simple words, we can construct the "T Flip Flop" by
converting a "JK Flip Flop". Sometimes the "T Flip Flop" is referred to as single input
"JK Flip Flop".
Block diagram of the "T-Flip Flop" is given where T defines the "Toggle input", and
CLK defines the clock signal input.
T Flip Flop Circuit
There are the following two methods which are used to form the "T Flip Flop":
Construction
The "T Flip Flop" is designed by passing the AND gate's output as input to the NOR
gate of the "SR Flip Flop". The inputs of the "AND" gates, the present output state Q,
and its complement Q' are sent back to each AND gate. The toggle input is passed to
the AND gates as input. These gates are connected to the Clock (CLK) signal. In the
"T Flip Flop", a pulse train of narrow triggers are passed as the toggle input, which
changes the flip flop's output state. The circuit diagram of the "T Flip Flop" using "SR
Flip Flop" is given below:
The "T Flip Flop" is formed using the "D Flip Flop". In D flip - flop, the output after
performing the XOR operation of the T input with the output "Q PREV" is passed as the
D input. The logical circuit of the "T-Flip Flop" using the "D Flip Flop" is given below:
The simplest construction of a D Flip Flop is with JK Flip Flop. Both the inputs of the
"JK Flip Flop" are connected as a single input T. Below is the logical circuit of the T
Flip Flop" which is formed from the "JK Flip Flop":
The upper NAND gate is enabled, and the lower NAND gate is disabled when the
output Q To is set to 0. make the flip flop in "set state(Q=1)", the trigger passes the
S input in the flip flop.
The upper NAND gate is disabled, and the lower NAND gate is enabled when the
output Q is set to 1. The trigger passes the R input in the flip flop to make the flip
flop in the reset state(Q=0).
The next sate of the T flip flop is similar to the current state when the T input is set
to false or 0.
o If toggle input is set to 0 and the present state is also 0, the next state will be
0.
o If toggle input is set to 0 and the present state is 1, the next state will be 1.
The next state of the flip flop is opposite to the current state when the toggle input is
set to 1.
o If toggle input is set to 1 and the present state is 0, the next state will be 1.
o If toggle input is set to 1 and the present state is 1, the next state will be 0.
The "T Flip Flop" is toggled when the set and reset inputs alternatively changed by
the incoming trigger. The "T Flip Flop" requires two triggers to complete a full cycle
of the output waveform. The frequency of the output produced by the "T Flip Flop" is
half of the input frequency. The "T Flip Flop" works as the "Frequency Divider
Circuit."
In "T Flip Flop", the state at an applied trigger pulse is defined only when the
previous state is defined. It is the main drawback of the "T Flip Flop".
The "T flip flop" can be designed from "JK Flip Flop", "SR Flip Flop", and "D Flip Flop"
because the "T Flip Flop" is not available as ICs. The block diagram of "T Flip Flop"
using "JK Flip Flop" is given below:
Explanation
The master-slave flip flop is constructed by combining two JK flip flops. These flip
flops are connected in a series configuration. In these two flip flops, the 1st flip flop
work as "master", called the master flip flop, and the 2nd work as a "slave", called
slave flip flop. The master-slave flip flop is designed in such a way that the output of
the "master" flip flop is passed to both the inputs of the "slave" flip flop. The output
of the "slave" flip flop is passed to inputs of the master flip flop.
In "master-slave flip flop", apart from these two flip flops, an inverter or NOT gate is
also used. For passing the inverted clock pulse to the "slave" flip flop, the inverter is
connected to the clock's pulse. In simple words, when CP set to false for "master",
then CP is set to true for "slave", and when CP set to true for "master", then CP is set
to false for "slave".
Registers
A Register is a collection of flip flops. A flip flop is used to store single bit digital
data. For storing a large number of bits, the storage capacity is increased by
grouping more than one flip flops. If we want to store an n-bit word, we have to use
an n-bit register containing n number of flip flops.
The register is used to perform different types of operations. For performing the
operations, the CPU use these registers. The faded inputs to the system will store
into the registers. The result returned by the system will store in the registers. There
are the following operations which are performed by the registers:
Fetch:
It is used
Decode:
The decode operation is used to interpret the instructions. In decode, the operation
performed on the instructions is identified by the CPU. In simple words, the decode
operation is used to decode the instructions.
Execute:
The execution operation is used to store the result produced by the CPU into the
memory. After storing this result, it is displayed on the user screen.
Types of Registers
There are various types of registers which are as follows:
Program Counter
The program counter is also called an instruction address register or instruction
pointer. The next memory address of the instruction, which is going to be executed
after completing the execution of current instruction is contained in the program
counter. In simple words, the program counter contains the memory address of the
location of the next instruction.
Accumulator Register
The CPU mostly uses an accumulator register. The accumulator register is used to
store the system result. All the results will be stored in the accumulator register
when the CPU produces some results after processing.
The data which is to be read out or written into the address location is contained in
the Memory Data Register.
The data is written in one direction when it is fetched from memory and placed into
the MDR. In write instruction, the data place into the MDR from another CPU register.
This CPU register writes the data into the memory. Half of the minimal interface
between the computer storage and the microprogram is the memory data address
register, and the other half is the memory data register.
Index Register
The Index Register is the hardware element that holds the number. The number
adds to the computer instruction's address to create an effective address. In CPU,
the index register is a processor register used to modify the operand address during
the running program.
Data Register
The data register is used to temporarily store the data. This data transmits to or from
a peripheral device.
Working:
o When the clock pulse is true, the slave flip flop will be in the isolated state, and
the system's state may be affected by the J and K inputs. The "slave" remains
isolated until the CP is 1. When the CP set to 0, the master flip-flop passes the
information to the slave flip flop to obtain the output.
o The master flip flop responds first from the slave because the master flip flop is
the positive level trigger, and the slave flip flop is the negative level trigger.
o The output Q'=1 of the master flip flop is passed to the slave flip flop as an
input K when the input J set to 0 and K set to 1. The clock forces the slave flip
flop to work as reset, and then the slave copies the master flip flop.
o When J=1, and K=0, the output Q=1 is passed to the J input of the slave. The
clock's negative transition sets the slave and copies the master.
o The master flip flop toggles on the clock's positive transition when the inputs J
and K set to 1. At that time, the slave flip flop toggles on the clock's negative
transition.
o The flip flop will be disabled, and Q remains unchanged when both the inputs
of the JK flip flop set to 0.
o When the clock pulse set to 1, the output of the master flip flop will be one
until the clock input remains 0.
o When the clock pulse becomes high again, then the master's output is 0, which
will be set to 1 when the clock becomes one again.
o The master flip flop is operational when the clock pulse is 1. The slave's output
remains 0 until the clock is not set to 0 because the slave flip flop is not
operational.
o The slave flip flop is operational when the clock pulse is 0. The output of the
master remains one until the clock is not set to 0 again.
o Toggling occurs during the entire process because the output changes once in
the cycle.
Shift Register
A group of flip flops which is used to store multiple bits of data and the data is
moved from one flip flop to another is known as Shift Register. The bits stored in
registers shifted when the clock pulse is applied within and inside or outside the
registers. To form an n-bit shift register, we have to connect n number of flip flops.
So, the number of bits of the binary number is directly proportional to the number of
flip flops. The flip flops are connected in such a way that the first flip flop's output
becomes the input of the other flip flop.
A Shift Register can shift the bits either to the left or to the right. A Shift Register,
which shifts the bit to the left, is known as "Shift left register", and it shifts the bit
to the right, known as "Right left register".
Block Diagram:
Operation
When the clock signal application is disabled, the outputs Y 3 Y2 Y1 Y0 = 0000. The LSB
bit of the number is passed to the data input D in, i.e., D3. We will apply the clock, and
this time the value of D3 is 1. The first flip flop, i.e., FF-3, is set, and the word is
stored in the register at the first falling edge of the clock. Now, the stored word is
1000.
The next bit of the binary number, i.e., 1, is passed to the data input D 2. The second
flip flop, i.e., FF-2, is set, and the word is stored when the next negative edge of the
clock hits. The stored word is changed to 1100.
The next bit of the binary number, i.e., 1, is passed to the data input D 1, and the
clock is applied. The third flip flop, i.e., FF-1, is set, and the word is stored when the
negative edge of the clock hits again. The stored word is changed to 1110.
Similarly, the last bit of the binary number, i.e., 1, is passed to the data input D 0, and
the clock is applied. The last flip flop, i.e., FF-0, is set, and the word is stored when
the clock's negative edge arrives. The stored word is changed to 1111.
Truth Table
Waveforms
Below is the block diagram of the 4-bit serial in the parallel-out shift register. The
circuit having four D flip-flops contains a clear and clock signal to reset these four flip
flops. In SIPO, the input of the second flip flop is the output of the first flip flop, and
so on. The same clock signal is applied to each flip flop since the flip flops
synchronize each other. The parallel outputs are used for communication.
Block Diagram
Parallel IN Serial OUT
In the "Parallel IN Serial OUT" register, the data is entered in a parallel way, and
the outcome comes serially. A four-bit "Parallel IN Serial OUT" register is designed
below. The input of the flip flop is the output of the previous Flip Flop. The input and
outputs are connected through the combinational circuit. Through this combinational
circuit, the binary input B 0, B1, B2, B3 are passed. The shift mode and the load
mode are the two modes in which the "PISO" circuit works.
Load mode
The bits B0, B1, B2, and B3 are passed to the corresponding flip flops when the second,
fourth, and sixth "AND" gates are active. These gates are active when the shift or
load bar line set to 0. The binary inputs B0, B1, B2, and B3 will be loaded into the
respective flip-flops when the edge of the clock is low. Thus, parallel loading occurs.
Shift mode
The second, fourth, and sixth gates are inactive when the load and shift line set to 0.
So, we are not able to load data in a parallel way. At this time, the first, third, and
fifth gates will be activated, and the shifting of the data will be left to the right bit. In
this way, the "Parallel IN Serial OUT" operation occurs.
Block Diagram
Parallel IN Parallel OUT
In "Parallel IN Parallel OUT", the inputs and the outputs come in a parallel way in
the register. The inputs A0, A1, A2, and A3, are directly passed to the data inputs D 0,
D1, D2, and D3 of the respective flip flop. The bits of the binary input is loaded to the
flip flops when the negative clock edge is applied. The clock pulse is required for
loading all the bits. At the output side, the loaded bits appear.
Block Diagram
For performing the multiplication and division operation using the shift register, it is
required that the data should be moved in both the direction, i.e., left or right in the
register. Such registers are called the "Bidirectional" shift register.
Below is the diagram of 4-bit "bidirectional" shift register where DR is the "serial
right shift data input", DL is the "left shift data input", and M is the "mode
select input".
Block Diagram
Operations
1) Shift right operation(M=1)
o The first, third, fifth, and seventh AND gates will be enabled, but the second,
fourth, sixth, and eighth AND gates will be disabled.
o The data present on the data input DR is shifted bit by bit from the fourth flip
flop to the first flip flop when the clock pulse is applied. In this way, the shift
right operation occurs.
o The second, fourth, sixth and eighth AND gates will be enabled, but the AND
gates first, third, fifth, and seventh will be disabled.
o The data present on the data input DR is shifted bit by bit from the first flip flop
to the fourth flip flop when the clock pulse is applied. In this way, the shift right
operation occurs.
The input M, i.e., the mode control input, is set to 1 to perform the parallel loading
operation. If this input set to 0, then the serial shifting operation is performed. If we
connect the mode control input with the ground, then the circuit will work as a "bi-
directional" register. The diagram of the universal shift register is given below.
When the input is passed to the serial input, the register performs the "serial left"
operation. When the input is passed to the input D, the register performs the serial
right operation.
Block Diagram
Counters
A special type of sequential circuit used to count the pulse is known as a counter, or
a collection of flip flops where the clock signal is applied is known as counters.
The counter is one of the widest applications of the flip flop. Based on the clock
pulse, the output of the counter contains a predefined state. The number of the pulse
can be counted using the output of the counter.
Truth Table
o Asynchronous Counters
o Synchronous Counters
Signal Diagram
Operation
Synchronous counters
In the Asynchronous counter, the present counter's output passes to the input of
the next counter. So, the counters are connected like a chain. The drawback of this
system is that it creates the counting delay, and the propagation delay also occurs
during the counting stage. The synchronous counter is designed to remove this
drawback.
In the synchronous counter, the same clock pulse is passed to the clock input of
all the flip flops. The clock signals produced by all the flip flops are the same as each
other. Below is the diagram of a 2-bit synchronous counter in which the inputs of the
first flip flop, i.e., FF-A, are set to 1. So, the first flip flop will work as a toggle flip-flop.
The output of the first flip flop is passed to both the inputs of the next JK flip flop.
Logical Diagram
Signal Diagram
Operation
Ripple Counter
Ripple counter is a special type of Asynchronous counter in which the clock pulse
ripples through the circuit. The n-MOD ripple counter forms by combining n number
of flip-flops. The n-MOD ripple counter can count 2n states, and then the counter
resets to its initial value.
o Different types of flip flops with different clock pulse are used.
o It is an example of an asynchronous counter.
o The flip flops are used in toggle mode.
o The external clock pulse is applied to only one flip flop. The output of this flip
flop is treated as a clock pulse for the next flip flop.
o In counting sequence, the flip flop in which external clock pulse is passed, act
as LSB.
Based on their circuitry design, the counters are classified into the following types:
Up Counter
Down Counter
Up-Down Counter
The up and down counter is a special type of bi-directional counter which counts the
states either in the forward direction or reverse direction. It also refers to a reversible
counter.
In the circuit design of the binary ripple counter, two JK flip flops are used. The high
voltage signal is passed to the inputs of both flip flops. This high voltage input
maintains the flip flops at a state 1. In JK flip flops, the negative triggered clock pulse
use.
The outputs Q0 and Q1 are the LSB and MSB bits, respectively. The truth table of JK
flip flop helps us to understand the functioning of the counter.
When the high voltage to the inputs of the flip flops, the fourth condition is of the JK
flip flop occurs. The flip flops will be at the state 1 when we apply high voltage to the
input of the flip-flop. So, the states of the flip flops passes are toggled at the
negative going end of the clock pulse. In simple words, the flip flop toggle when the
clock pulse transition takes place from 1 to 0.
The state of the output Q0 change when the negative clock edge passes to the flip
flop. Initially, all the flip flops are set to 0. These flip flop changes their states when
the passed clock goes from 1 to 0. The JK flip flop toggles when the inputs of the flip
flops are one, and then the flip flop changes its state from 0 to 1. For all the clock
pulse, the process remains the same.
The output of the first flip flop passes to the second flip flop as a clock pulse. From
the above timing diagram, it is clear that the state of the second flip flop is changed
when the output Q0 goes transition from 1 to 0. The outputs Q 0 and Q1 treat as LSB
and MSB. The counter counts the values 00, 01, 10, 11. After counting these values,
the counter resets itself and starts counting again from 00, 01, 10, and 1. The count
values until the clock pulses are passed to J 0K0 flip flop.
Ring Counter
A ring counter is a special type of application of the Serial IN Serial OUT Shift
register. The only difference between the shift register and the ring counter is that
the last flip flop outcome is taken as the output in the shift register. But in the ring
counter, this outcome is passed to the first flip flop as an input. All of the remaining
things in the ring counter are the same as the shift register.
Below is the block diagram of the 4-bit ring counter. Here, we use 4 D flip flops. The
same clock pulse is passed to the clock input of all the flip flops as a synchronous
counter. The Overriding input(ORI) is used to design this circuit.
The output is 1 when the pre-set set to 0. The output is 0 when the clear set to 0.
Both PR and CLR always work in value 0 because they are active low signals.
1. PR = 0, Q = 1
2. CLR = 0, Q = 0
These two values(always fixed) are independent with the input D and the Clock pulse
(CLK).
Working
The ORI input is passed to the PR input of the first flip flop, i.e., FF-0, and it is also
passed to the clear input of the remaining three flip flops, i.e., FF-1, FF-2, and FF-3.
The pre-set input set to 0 for the first flip flop. So, the output of the first flip flop is
one, and the outputs of the remaining flip flops are 0. The output of the first flip flop
is used to form the ring in the ring counter and referred to as Pre-set 1.
In the above table, the highlighted 1's are pre-set 1.
o ORI input set to low, and that time the Clk doesn't care.
o
o When the ORI input set to high, and the low clock pulse signal is passed as the
negative clock edge triggered.
A ring forms when the pre-set 1 is shifted to the next flip-flop at each clock pulse.
1. 1 0 0 0
2. 0100
3. 0 0 1 0
4. 0001
Note: The straight ring counter circulates the single 1 (or 0) bit around the ring.
Logic Diagram
Truth Table
Signal Diagram
Twisted Ring Counter
The Twisted Ring Counter refers to as a switch-tail ring Counter. Like
the straight ring counter, the outcome of the last flip-flop is passed to the first flip-
flop as an input. In the twisted ring counter, the ORI input is passed to all the flip
flops as clear input.
Note: The twisted ring counter circulates a stream of 1's followed by 0 around the ring.
Logic Diagram
Truth Table
Signal Diagram
johnson Counter
The Johnson counter is similar to the Ring counter. The only difference between
the Johnson counter and the ring counter is that the outcome of the last flip flop
is passed to the first flip flop as an input. But in Johnson counter, the inverted
outcome Q' of the last flip flop is passed as an input. The remaining work of
the Johnson counter is the same as a ring counter. The Johnson counter is also
referred to as the Creeping counter.
In Johnson counter
Below is the diagram of the 4-bit Johnson counter. Like Ring counter, four D flip flops
are used in the 4-bit Johnson counter, and the same clock pulse is passed to all the
input of the flip flops.
Truth Table
CP Q1 Q2 Q3 Q4
0 0 0 0 0
1 1 0 0 0
2 1 1 0 0
3 1 1 1 0
4 1 1 1 1
5 0 1 1 1
6 0 0 1 1
7 0 1 1 1
o The counter produces the output 0000 when there is no clock input passed(0).
o The counter produces the output 1000 when the 1 st clock pulse is passed to the
flip flops.
o The counter produces the output 1100 when the 2 nd clock pulse is passed to
the flip flops.
o The counter produces the output 1110 when the 3 rd clock pulse is passed to
the flip flops.
o The counter produces the output 1111 when the 4 th clock pulse is passed to
the flip flops.
o The counter produces the output 0111 when the 5 th clock pulse is passed to
the flip flops.
o The counter produces the output 0011 when the 6 th clock pulse is passed to
the flip flops.
o The counter produces the output 0001 when the 7 th clock pulse is passed to
the flip flops.
Timing diagram
Advantages
o The number of flip flops in the Johnson counter is equal to the number of flip
flops in the ring counter, and the Johnson counter counts twice the number of
states the ring counter can count.
o The Johnson counter can also be designed by using D or JK flip flop.
o The data is count in a continuous loop in the Johnson ring counter.
o The circuit of the Johnson counter is self-decoding.
Disadvantages
o The Johnson counter is not able to count the states in a binary sequence.
o In the Johnson counter, the unutilized states are greater than the states being
utilized.
o The number of flip flops is equal to one half of the number of timing signals.
o It is possible to design the Johnson counter for any number of timing
sequences.
Computer Memory
A computer is an electronic device that takes raw data as input and, processes it,
then provides the desired result. It has the potential to execute programmed
computations quickly and with great accuracy. Put in another way, the computer
receives input such as data and stores it together with instructions in memory (use
them when required). The data is then processed and converted into valuable
information. After that, it provides the result according to the inputs. Here, input
means the unprocessed data that we want the machine to handle and then give us a
response, and output refers to the outcome of the machine's processing of the
unprocessed data, which may include data analysis, searching, distributing, storing,
and more. Consequently, a computer is also referred to as a data processing system.
What is Memory?
The computer memory holds the data and instructions needed to process raw data
and produce output. It is the same as a human mind, where data, information, and
instructions are stored. It is a data storage device or a data storage component
where instructions for processing data are kept along with the data that has to be
processed. Both the input and the output can be held here.
The computer memory is divided into large number of small parts known as cells.
Each cell has a unique address which varies from 0 to memory size minus
one. Computer memory is of two types: Volatile (RAM) and Non-volatile (ROM). The
secondary memory (hard disk) is referred as storage not memory.
o Register memory
o Cache memory
o Primary memory
o Secondary memory
How does computer memory work?
A program is loaded from secondary memory to primary memory when it is opened.
There are several types of memory and storage, for example, a program being
moved from a solid-state drive (SSD) to RAM (Random Access Memory). The opened
software will be able to communicate with the computer's processor at a faster rate
because primary storage is accessed more quickly. The main or primary memory can
be accessed quickly from storage locations such as temporary memory slots.
Data in memory is only saved temporarily since memory is volatile. Data saved in
volatile memory will be erased immediately whenever a computer is turned off. A file
is transported to secondary memory for permanently storage when it is saved.
o Cache memory: The cache, also known as a temporary storage area, is more
readily available to the processor as compared to the main memory source of
the computer system. It is mounted on a different chip that connects to the
CPU via a bus or is frequently built directly into the CPU chip; hence, it is also
known as CPU memory.
o RAM: The term refers to the fact that the processor can directly access any
storage location. Random Access Memory, or RAM, is a piece of hardware that
serves as the internal memory of the CPU. It is often found on a on the
motherboard of a computer. When the computer is turned on, it enables the
CPU to store programs, information, and result of the program. Also, it is a
computer's read-write memory, which means data can be added to it as well as
read from it.
o Dynamic RAM: A type of random-access memory that is used in computing
systems (primarily PCs) is called dynamic random-access memory (DRAM). The
data or program code required for a computer processor to operate is often
stored in DRAM, which is a kind of semiconductor memory. Each piece of data
is stored in DRAM in its own passive electrical component, which is located
inside an integrated circuit board. Each electrical component has two value
states, known as 0 and 1, in one bit.
o Static RAM: As long as SRAM receives power, it keeps data bits in its memory.
It does not need to be refreshed on a regular basis, in contrast to DRAM, which
stores bits in cells made up of a capacitor and a transistor.
o Double Data Rate SDRAM: Theoretically, DDR SRAM can increase the
memory clock speed to at least 200 MHz. It is an SDRAM.
o Double Data Rate 4 Synchronous Dynamic RAM: DDR4 RAM is the
successor to its preceding DDR2 and DDR3 iterations. It is a kind of DRAM that
contains a high-bandwidth interface. Higher module density and lower voltage
requirements are both possible with DDR4 RAM. It enables dual in-line memory
modules (DIMMS) up to 64 GB; Also, higher data rate transfer speeds are
paired with it.
o Rambus Dynamic RAM: A memory component called DRDRAM made a
guarantee to transport up to 1.6 billion bytes per second. The RAM controller
subsystem consists of RAM, a bus connecting RAM to the microprocessor, and
computer-using devices that make up the subsystem.
o Read-only memory: ROM is often only read from and not written to, which is
a type of computer storage. It is nonvolatile in nature, which means it stores
data permanently. The programming code is stored in the ROM that enables a
computer system to boot up or regenerate every time when it is turned on.
o Programmable ROM: PROM is ROM that a user can modify only once. Using a
unique device known as a PROM programmer enables a user to customize a
microcode program.
o Erasable PROM: EPROM is a type of computer memory that can be erased
and re-used. It is programmable read-only memory PROM.
o Electrically erasable PROM: A user-modifiable ROM called an EEPROM can
be repeatedly wiped and reprogrammed with the help of an using electrical
voltage that is higher than usual. Unlike EPROM chips, EEPROMs can be
changed without being taken out of the computer. However, an EEPROM chip
must be completely deleted and reprogrammed, not just some parts of it.
o Virtual memory: A memory management method that enables the use of
secondary memory just like it was a component of main memory. In order to
compensate for physical memory shortages, virtual memory uses hardware
and software to temporarily shift data from RAM to disk storage.
The amount of storage and memory space that is accessible differs as well. As
compared to memory, a computer will often have greater storage capacity. For
instance, a laptop may have 250 GB of storage space and 8 GB of RAM. The reason
for the difference in space is that a computer will not need to quickly access all the
data stored on it at once; therefore, assigning about 8 GB of space will be plenty to
run programs.
RAM is both a read and writes type of memory. The information that has to be
currently processed is stored in RAM, which the CPU may immediately access. It is a
volatile memory that loses data when the electricity is turned off. RAM may be static
or dynamic in nature.
Question 13
Determine what input conditions are necessary to set, reset, and
toggle these two J-K flip-flops:
Question 17
Flip-flops often come equipped with asynchronous input lines as well
as synchronous input lines. This J-K flip-flop, for example, has both
“preset” and “clear” asynchronous inputs:
Question 22
The flip-flop circuit shown here is classified as synchronous because
both flip-flops receive clock pulses at the exact same time:
Question 24
Although the toggle function of the J-K flip-flop is one of its most
popular uses, this is not the only type of flip-flop capable of
performing a toggle function. Behold the surprisingly versatile D-type
flip-flop configured to do the same thing:
Question 16
Determine the output states for this J-K flip-flop, given the pulse
inputs shown:
Hide Answer
Notes:
Ask students to identify those regions on the timing diagram where the flip-flop is
being set, reset, and toggled.
Question 4
Determine the final output states over time for the following circuit,
built from D-type gated latches:
At what specific times in the pulse diagram does the final output
assume the input’s state? How does this behavior differ from the
normal response of a D-type latch?
Hide Answer
The final output assumes the same logic state as the input only when
the enable input signal (B) transitions from “high” to “low”.
Notes:
Note that by adding another latch, the overall behavior only slightly resembles the
behavior of a D-type latch. With the addition of the second latch, we’ve changed
this circuit into a flip-flop, specifically of the master-slave variety.