Dengan menambahkan sepasang gerbang NAND pada input rangkaian dari RS latch,
kita mempunyai 2 tujuan yaitu : normal daripada input-inputnya diinverter, dan
sebuah input yang ketiga pada kedua gerbang dimana kita dapat mensinkronkan
rangkaian.
RS NAND latch yang diclock digambarkan dibawah.
Rangkaian RS latch yang diclock
sangat mirip dengan operasi latch
dasar yang anda lihat pada
halaman sebelumnya. Input S dan
R umumnya berlogika 0,dan harus
dirubah ke logika 1 untuk
mengubah kondisi dari latch.
Bagaimanapun, dengan input
ketiga, faktor baru telah
ditambahkan. Inputnya
dilambangkan C atau CLK,
karena dikontrol oleh sebuah
rangkaian clock, yang digunakan
untuk mensinkronkan beberapa
dari rangkaian latch satu sama
lain. Outputnya hanya dapat
berubah ketika input CLK
berlogika 1. Ketika CLK berlogika
0, input S dan input R tidak
mempunyai efek pada outputnya.
Untuk operasi yang benar, input R
dan input S seharusnya berlogika
1, kemudian input CLK
seharusnya berlogika 1 dan
berlogika 0 kembali. Pada
akhirnya , input yang telah dipilih
seharusnya kembali berlogika 0.
RS latch yang diclock memecahkan beberapa masalah pada rangkaian RS latch, dan
kontrol yang lebih tepat pada proses latch. Bagaimanapun juga, RS latch yang diklok
ini tidak memberikan solusi yang sempurna. Sebuah masalah yang penting pada
rangkaian latch ini dapat dengan mudah berubah pada input S dan input R ketika
masih pada input CLK berlogika 1. Ini mengakibatkan rangkaian untuk sering
berubah state sebelum input CLK yang berubah ke logika 0.
Salah satu cara untuk mengurangi masalah ini adalah menjaga CLK berlogika 0
hampir disemua waktu, dan membolehkan hanya satu perubahan menjadi logika 1.
Bagaimanapun juga, cara ini belum dapat menjamin bahwa latch akan hanya berubah
state saat sinyal clock pada logika 1. Sinyalnya harus mempunyai durasi waktu yang
tepat untuk memastikan semua latchnya mempunyai waktu untuk meresponnya, pada
waktu itu, semua latch dapat merespon semua perubahan.
Jalan yang terbaik adalah memastikan latchnya hanya dapat mengubah outputnya
pada satu siklus clock. Halaman berikutnya akan ditunjukkan sebuah rangkaian yang
memecahkan masalah ini dengan mudah, dengan berubah state hanya pada sebuah
transisi tertentu, ujung dari clock.
Edge-Triggered RS Flip-Flop
Untuk mengatur clocked RS latch untuk edge triggering, kita sebenarnya harus
menggabungkan dua rangkaian clocked latch yang identik, tetapi harus
mengoperasikannya berlawanan untuk setengah sinyal clock. Rangkaian yang
dihasilkan disebut sebuah flip-flop, karena outputnya dapat flip dan kemudian flop
kembali. clocked RS latch juga sering disebut sebagai flip-flop, meskipun lebih tepat
sebagai sebuah rangkaian latch.
Kedua bagian flip-flop juga dikenal sebagai master-slave flip-flop, karena input latch
beroperasi sebagai tuan/master, sedangkan bagian output tunduk kepada master
selama setengah setiap satu siklus waktu/clock cycle.
Edge-triggered RS NAND flip-flop dapat ditunjukkan dibawah ini.
Jika kita memulai dengan input CLK berlogika 0, input S dan input R diputuskan dari
input(master) latch. Bagaiamanpun juga, perubahan apapun tidak dapat
mempengaruhi kondisi terakhir dari output.
Ketika sinyal CLK berlogika 1, input S dan input R tidak dapat mengontrol keadaan
dari input-input latch, seperti satu buah rangkaian RS latch telah dipelajari.
Bagaimanapun juga, pada waktu yang sama sinyal CLK yang dimasukkan output
(slave) latch mencegah kondisi input latch terpengaruh. Maka, tidak ada perubahan
pada sinyal input R dan input S yang berjalan bila CLK berlogika 1, tidak terbut are
not reflected at the Q and Q' outputs.
Ketika CLK jatuh kembali ke logika 0, input S dan input R akan diisolasi dari input
latch. Pada waktu yang sama, sinyal CLK yang diinverter sekarang membolehkan
keadaan sekarang dari input latch untuk mencapai output latch. Maka, output Q dan
output Q' hanya dapat berganti keadaan ketika sinyal CLK jatuh dari logika 1 ke
logika 0. Ini dikenal sebagai falling edge dari sinyal CLK l; maka disebut edgetriggered flip-flop.
Dengan mempunyai master-slave dan flip-flop edge-triggered, kita sudah dapat
memastikan bahwa kita mempunyai kontrol momen yang tepat ketika semua flip-flop
akan berubah keadaan. Kita juga mempunyai banyak waktu agar master latch untuk
merespon sinyal input, dan agar sinyal input berubah dan mengatur sesuai keadaan
sebelumnya.
Masih ada satu problem yang belum diselesaikan: kemungkinan keadaan race: yang
mungkin terjadi jika kedua input S dan input R berlogika 1 ketika CLK jatuh dari
logika 1 ke logika 0.
Solusinya dengan menambahkan feedback dari slave latch menuju master latch.
Rangkaian yang dihasilkan disebut JK flip-flop.
FLIP-FLOP JK
Untuk mencegah kemungkinan keadaan "race" yang terjadi jika kedua input S dan
input R berlogika 1 dan input CLK turun dari logika 1 ke logika 0, kita harus
mencegah salah satu dari input mempengaruhi master latch pada rangkaian. Pada
waktu yang sama, kita juga ingin flip-flop tersebut berganti kondisi pada setiap saat
input CLK " falling edge". Maka dari itu, input S atau R perlu dimatikan tergantung
pada keadaan sekarang dari slave latch output.
Jika output Q berlogika 1 (flip-flopnya dalam keadaan "Set"), input S tidak dapat
merubah kondisi itu. Maka dari itu, kita dapat mematikan input S tanpa perlu
mematikan flip-flop. Di samping itu, jika output Q berlogika 0 (flip-flop dalam
keadaan Reset), input R dapat dimatikan tanpa menimbulkan kerusakan. Jika dapat
menyelesaikan tanpa ada kerusakan, sudah dapat memecahkan masalah keadaan
"race".
Pada umumnya, JK flip-flop mirip dengan RS flip-flop. Output Q and output Q' akan
berubah state pada saat sinyal CLK jatuh , dan input J & K akan mengontrol output
yang akan datang. Tetapi terdapat beberapa perbedaan penting.
Karena satu dari dua input yang selalu didisabled sesuai dengan keadaan output yang
telah dicapai oleh flip-flop, master latch tidak dapat berganti keadaan sebelumnya dan
maju jika input CLK berlogika 1. Meskipun begitu, input yang dienabled inputnya
dapat mengubah keadaan dari master latch sekali, setelah itu latch tidak dapat berubah
lagi. Ini yang tidak benar dari flip-flop RS.
Jika kedua input J dan input K berlogika 1 dan sinyal CLK berjalan terus, output Q
dan output Q' akan berubah keadaan untuk setiap falling edge dari sinyal CLK.
( rangkaian master latch circuit akan berubah keadaan untuk setiap rising edge dari
CLK.) Kita dapat menggunakan karakteristik ini untuk memanfaatkannya dalam
beberapa cara. Sebuah flip-flop yang dibuat khusus untuk beroperasi dengan cara ini
disebut (Toggle) flip-flop.
Flip-flop JK harus diedge triggered untuk bekerja.
Karena perilaku dari Flip-flop JK dapat seluruhnya diduga dalam segala kondisi,
maka Flip-flop tipe inilah yang paling banyak digunakan dalam desain rangkaian
logika. RS flip-flop hanya digunakan pada aplikasi dimana dapat dipastikan bahwa R
dan S tidak berlogika 1 pada waktu yang sama.
Pada halaman berikutnya, kita akan melihat konfigurasi penting. Kita akan melihat
banyak flip-flop atau latch dapat disatukan untuk mengasilkan fungsi atau operasi
yang berguna
D Latch
Satu variasi rangkaian RS latch yang berguna adalah Data latch, atau D latch. Seperti
yang ditunjukkan pada diagram logika dibawah ini, D latch dibangun dengan
menggunakan input S yang diinverter S sebagai sinyal input R. Input disimbolkan "D"
untuk membedakan operasi ini dengan tipe latch yang lain. Hal ini tidak berbeda
bahwa sinyal input R diclock dua kali, sejak sinyal CLK akan membolehkan sinyalsinyal untuk lewat melalui kedua gerbang itu atau tidak lewat.
Sebagai perbandingan, kita dapat mereview RS NAND latch .
in the set state (or 1-state). When Q=0 and Q'=1, it is in the clear state (or 0-state).
The outputs Q and Q' are complements of each other and are referred to as the normal
and complement outputs, respectively. The binary state of the flip-flop is taken to be
the value of the normal output.
When a 1 is applied to both the set and reset inputs of the flip-flop in Figure 2, both Q
and Q' outputs go to 0. This condition violates the fact that both outputs are
complements of each other. In normal operation this condition must be avoided by
making sure that 1's are not applied to both inputs simultaneously.
input causes Q to go to 1 and Q' to go to 0, putting the flip-flop in the set state. When
both inputs go to 0, both outputs go to 1. This condition should be avoided in normal
operation.
Back to Contents
Introduction - D Flip-Flop
The D flip-flop shown in Figure 5 is a modification of the clocked SR flip-flop. The D
input goes directly into the S input and the complement of the D input goes to the R
input. The D input is sampled during the occurrence of a clock pulse. If it is 1, the
flip-flop is switched to the set state (unless it was already set). If it is 0, the flip-flop
switches to the clear state.
Introduction - JK Flip-Flop
A JK flip-flop is a refinement of the SR flip-flop in that the indeterminate state of the
SR type is defined in the JK type. Inputs J and K behave like inputs S and R to set and
clear the flip-flop (note that in a JK flip-flop, the letter J is for set and the letter K is
for clear). When logic 1 inputs are applied to both J and K simultaneously, the flipflop switches to its complement state, ie., if Q=1, it switches to Q=0 and vice versa.
A clocked JK flip-flop is shown in Figure 6. Output Q is ANDed with K and CP
inputs so that the flip-flop is cleared during a clock pulse only if Q was previously 1.
Similarly, ouput Q' is ANDed with J and CP inputs so that the flip-flop is set with a
clock pulse only if Q' was previously 1.
Note that because of the feedback connection in the JK flip-flop, a CP signal which
remains a 1 (while J=K=1) after the outputs have been complemented once will cause
repeated and continuous transitions of the outputs. To avoid this, the clock pulses
must have a time duration less than the propagation delay through the flip-flop. The
restriction on the pulse width can be eliminated with a master-slave or edge-triggered
construction. The same reasoning also applies to the T flip-flop presented next.
Introduction - T Flip-Flop
The T flip-flop is a single input version of the JK flip-flop. As shown in Figure 7, the
T flip-flop is obtained from the JK type if both inputs are tied together. The output of
the T flip-flop "toggles" with each clock pulse.
Preparation
Prepare the following in your prac book:
Basic Flip-Flop
i.
ii.
Draw the logic circuit implemented with gates for the SR master-slave flipflop in Figure 9. Use NOR gate flip-flops.
Enter the expected timing diagram for the signals Y, Y', Q, and Q' in Figure
15.
i.
ii.
Draw the logic circuit for the D-type positive-edge triggered flip-flop in
Figure 11.
Enter the expected timing diagram for the signals S, R, Q, and Q' in Figure 16.
The master-slave flip-flop is essentially two back-to-back JKFFs, note however, that
feedback from this device is fed back both to the master FF and the slave FF.
Any input to the master-slave flip-flop at J and K is first seen by the master FF part of
the circuit while CLK is High (=1). This behaviour effectively "locks" the input into
the master FF. An important feature here is that the complement of the CLK pulse is
fed to the slave FF. Therefore the outputs from the master FF are only "seen" by the
slave FF when CLK is Low (=0). Therefore on the High-to-Low CLK transition the
outputs of the master are fed through the slave FF. This means that the at most one
change of state can occur when J=K=1 and so oscillation between the states Q=0 and
Q=1 at successive CLK pulses does not occur.
The truth tables for the above pulse-triggered flip-flops are all the same as that
for the edge-triggered flip-flops, except for the way they are clocked. These flipflops are also called Master-Slave flip-flops simply because their internal
construction are divided into two sections. The slave section is basically the same
as the master section except that it is clocked on the inverted clock pulse and is
controlled by the outputs of the master section rather than by the external
inputs. The logic diagram for a basic master-slave S-R flip-flop is shown below.
Again, the above data lock-out flip-flops have same the truth tables as that for
the edge-triggered flip-flops, except for the way they are clocked.
Flip-flop (electronics)
History
The first electronic flip-flop was invented in 1919 by William Eccles and F. W. Jordan
[1]
. It was initially called the Eccles-Jordan trigger circuit and consisted of two
active elements (radio-tubes). The name flip-flop was later derived from the sound
produced on a speaker connected with one of the backcoupled amplifiers output
during the trigger process within the circuit.
Flip-flops can be further divided into types that have found common applicability in
both asynchronous and clocked sequential systems: the SR ("set-reset"), D ("delay"),
T ("toggle"), and JK types are the common ones; all of which may be synthetisized
from (most) other types by a few logic gates. The behavior of a particular type can be
described by what is termed the characteristic equation, which derives the "next" (i.e.,
after the next clock pulse) output, Qnext, in terms of the input signal(s) and/or the
current output, Q.
* Early master-slave devices actually remained (half) open between the first and
second edge of a clocking pulse; today most flip-flops are designed so they may be
clocked by a single edge as this gives large benefits regarding noise immunity,
without any significant downsides.
A circuit symbol for a T-type flip-flop, where > is the clock input, T is the toggle input
and Q is the stored data output.
If the T input is high, the T flip-flop changes state ("toggles") whenever the clock
input is strobed. If the T input is low, the flip-flop holds the previous value. This
behavior is described by the characteristic equation:
(or, without benefit of the XOR operator, the equivalent:
)
and can be described in a truth table:
T Q Qnext Comment
0 0 0 hold state
0 1 1 hold state
1 0 1
toggle
1 1 0
toggle
A toggle flip-flop composed of a single RS flip-flop becomes an oscillator, when it is
clocked. To achieve toggling, the clock pulse must have exactly the length of half a
cycle. While such a pulse generator can be built, a toggle flip-flop composed of two
RS flip-flops is the easy solution. Thus the toggle flip-flop divides the clock
frequency by 2 ie. if clock frequency is 4 MHz, the output frequency obtained from
the flip-flop will be 2 MHz. This 'divide by' feature has application in various types of
digital counters.
[edit] JK flip-flop
A circuit symbol for a JK flip-flop, where > is the clock input, J and K are data inputs,
Q is the stored data output, and Q' is the inverse of Q.
The characteristic equation of the JK flip-flop is:
the system that he was working on, Dr. Nelson realized that he was going to run out of
letters, so he decided to use J and K as the set and reset input of each flip-flop in his
system (using subscripts or somesuch to distinguish the flip-flops), since J and K were
"nice, innocuous letters."
Dr. Montgomery Phister, Jr., an engineer under Dr. Nelson at Hughes, in his book
"Logical Design of Digital Computers" (Wiley,1958) picked up the idea that J and K
were the set and reset input for a "Hughes type" of flip-flop, which he then termed "JK flip-flops." He also defined R-S, T, D, and R-S-T flip-flops, and showed how one
could use Boolean Algebra to specify their interconnections so as to carry out
complex functions.
[edit] D flip-flop
The D flip-flop can be interpreted as a primitive delay line or zero-order hold, since
the data is posted at the output one clock cycle after it arrives at the input. It is called
delay flip flop since the output takes the value in the Data-in.
The characteristic equation of the D flip-flop is:
A master slave D flip flop. It responds on the negative edge of the enable input
(usually a clock).
For a positive-edge triggered master-slave D flip-flop, when the clock signal is low
(logical 0) the enable seen by the first or master D latch (the inverted clock
signal) is high (logical 1). This allows the master latch to store the input value when
the clock signal transitions from low to high. As the clock signal goes high (0 to 1) the
inverted enable of the first latch goes low (1 to 0) and the value seen at the input to
the master latch is locked. Nearly simultaneously, the twice inverted enable of the
second or slave D latch transitions from low to high (0 to 1) with the clock signal.
This allows the signal captured at the rising edge of the clock by the now locked
master latch to pass through the slave latch. When the clock signal returns to low (1
to 0), the output of the "slave" latch is "locked", and the value seen at the last rising
edge of the clock is held while the master latch begins to accept new values in
preparation for the next rising clock edge.
clock, its components are each triggered by clock levels. The "edge-triggered D flip
flop" does not have the master slave properties.
A positive-edge-triggered D flip-flop.
[edit] Uses
A single flip-flop can be used to store one bit, or binary digit, of data.
Static RAM, which is the primary type of memory used in registers to store
numbers in computers and in many caches, is built out of flip-flops.
Any one of the flip-flop types can be used to build any of the others.
The data contained in several flip-flops may represent the state of a sequencer,
the value of a counter, an ASCII character in a computer's memory or any
other piece of information.
One use is to build finite state machines from electronic logic. The flip-flops
remember the machine's previous state, and digital logic uses that state to
calculate the next state.
The T flip-flop is useful for constructing various types of counters. Repeated
signals to the clock input will cause the flip-flop to change state once per highto-low transition of the clock input, if its T input is "1". The output from one
flip-flop can be fed to the clock input of a second and so on. The final output
of the circuit, considered as the array of outputs of all the individual flip-flops,
is a count, in binary, of the number of cycles of the first clock input, up to a
maximum of 2n-1, where n is the number of flip-flops used. See: Counters
One of the problems with such a counter (called a ripple counter) is that the
output is briefly invalid as the changes ripple through the logic. There are two
solutions to this problem. The first is to sample the output only when it is
known to be valid. The second, more widely used, is to use a different type of
circuit called a synchronous counter. This uses more complex logic to ensure
that the outputs of the counter all change at the same, predictable time. See:
Counters
flip-flop will not receive the data reliably. The relationship between tCO and tH is
normally guaranteed if both flip-flops are of the same type.