Chapterبەش 10 · Lectureوانە 10.3
Registers and Countersتۆمارگەکان و ژمێرەرە دیجیتاڵەکان
Flip-flops working together: registers with a LOAD input, shift registers (SISO, SIPO, PISO, PIPO, bidirectional) and shifting as multiplying or dividing by 2, the 3-bit ripple counter of the simulator lab and why it is slow, synchronous counters designed with excitation tables, mod-n, decade, ring and Johnson counters, state tables and diagrams (Moore and Mealy), and how these blocks form a CPU.
ئەو پێکەوە کار دەکەن: بە LOAD، جووڵاندن (SISO، SIPO، PISO، PIPO، دوو-ئاڕاستە) و جووڵاندن وەک لێکدان و دابەشکردن بە 2، ناهاوکاتی سێ لە تاقیگەی و بۆچی هێواشە، هاوکات کە بە دیزاین دەکرێن، mod-n، دەیی، ئەڵقەیی و Johnson، و (Moore و Mealy) و چۆن ئەم بلۆکانە پێک دەهێنن.
What you will learnچی فێر دەبیت
- Explain how a register with LOAD and a shift register are built from D flip-flops, and use shifts to multiply and divide by 2.
- Trace a ripple counter pulse by pulse and explain why it is slow.
- Design a synchronous counter with an excitation table and Karnaugh maps.
- Use mod-n, ring and Johnson counters, and read state tables and state diagrams.
- Name the sequential and combinational blocks inside a CPU.
- ڕوون بکەیتەوە بە LOAD و جووڵاندن چۆن لە D دروست دەکرێن و جووڵاندن بۆ لێکدان و دابەشکردن بە 2 بەکار بهێنیت.
- ناهاوکات بە بپشکنیت و ڕوون بکەیتەوە بۆچی هێواشە.
- هاوکات بە و دیزاین بکەیت.
- mod-n، ئەڵقەیی و Johnson بەکار بهێنیت و و بخوێنیتەوە.
- ناوی بلۆکە زنجیرەیی و تێکەڵەییەکانی ناو بزانیت.
Registers: a row of flip-flopsتۆمارگەکان: ڕیزێک فلیپ-فلۆپ
A group of flip-flops that stores one binary word, for example 8, 32 or 64 bits. A processor keeps the numbers it is working on in registers.
کۆمەڵێک کە یەک هەڵدەگرێت، بۆ نموونە 8، 32 یان 64 بیت. ئەو ژمارانەی کاریان لەسەر دەکات لە تۆمارگەکاندا هەڵیان دەگرێت.
A register is a group of n D flip-flops that share one clock. Together they hold an n-bit word, and at the clock edge all n bits are stored at the same moment — a parallel load. What the CPU's registers are used for (the program counter, the accumulator…) is explained in Registers and buses; this lesson shows how registers and counters are built.
کۆمەڵەیەک لە n Dـیە کە یەک بەکار دەهێنن. پێکەوە n هەڵدەگرن و لە لێواری هەموو n لە هەمان ساتدا هەڵدەگیرێن — بارکردنی تەریب (parallel load). ئەوەی بۆ چی بەکار دێن (، کۆکەرەوە…) لە تۆمارگەکان و تێپەڕگەکان ڕوون کراوەتەوە؛ ئەم وانەیە پیشان دەدات و چۆن دروست دەکرێن.
Usually a register should not take a new value at every clock edge. A LOAD input decides: each flip-flop gets a 2-to-1 multiplexer in front of its D input. With the multiplexer feeds the flip-flop's own Q back, so the edge stores the same bit again; with it passes the new input.
زۆرجار نابێت لە هەموو لێوارێکی بەهایەکی نوێ وەربگرێت. LOAD بڕیار دەدات: هەر مەڵتیپلێکسەرێکی دوو بۆ یەک لە پێش Dـەکەیدا هەیە. بە ، Qـی خودی دەگەڕێنێتەوە، بۆیە لێوارەکە هەمان دیسان هەڵدەگرێت؛ بە ، نوێیەکە تێدەپەڕێنێت.
Registers: a row of flip-flopsتۆمارگەکان: ڕیزێک فلیپ-فلۆپ
A register's short tableخشتە کورتکراوەکەی تۆمارگەیەک
Like a multiplexer, a register is described with an abbreviated table. An 8-bit register with LOAD has 8 data inputs, LOAD and 8 stored bits on the left of its table — 17 columns, so a full table would have rows. Two rows say everything:
وەک ، بە خشتەیەکی کورتکراوە وەسف دەکرێت. هەشت بە LOAD لە لای چەپی خشتەکەی 8 ، LOAD و 8 هەڵگیراوی هەیە — 17 ستوون، بۆیە خشتەیەکی تەواو ڕیزی دەبوو. دوو ڕیز هەموو شتێک دەڵێن:
| LOAD | D₇ … D₀ | Q₇ … Q₀ after the edgeQ₇ … Q₀ دوای لێوار |
|---|---|---|
| 0 | X … X | the same as beforeوەک پێشوو |
| 1 | d₇ … d₀ | d₇ … d₀ |
Shift registers: bits on the moveتۆمارگەکانی جووڵاندن: بیتەکان لە جووڵەدا
Connect the flip-flops of a register in a chain: the Q of each one feeds the D of the next. Now every clock edge moves every bit one place along, and a new bit enters the first flip-flop from the serial input. Watch the bits 1, 0, 1, 1 march into a cleared 4-bit shift register:
بە زنجیر ببەستە: Qـی هەر یەکێک Dـی دواتر پڕ دەکاتەوە. ئێستا هەر لێوارێکی هەموو یەک خانە بەرەو پێش دەبات و نوێ لە زنجیرییەوە دەچێتە ناو یەکەم . سەیر بکە 1، 0، 1، 1 چۆن دەچنە ناو جووڵاندنی چوار سفرکراوەوە:


| Clock pulses | Q₀ Q₁ Q₂ Q₃ |
|---|---|
| 0 | 0 0 0 0 |
| 1 | 1 0 0 0 |
| 2 | 0 1 0 0 |
| 3 | 1 0 1 0 |
| 4 | 1 1 0 1 |
After four pulses the first bit that entered is in the last flip-flop. Keep clocking and the bits leave Q₃ one by one, in the same order they came in — 1, 0, 1, 1. A serial-in, serial-out shift register is a queue: first in, first out, like the line at a bakery.
دوای چوار ، یەکەم کە هاتە ژوورەوە لە دوایین . لێدانی بەردەوام بکە و یەک یەک لە Q₃ دەردەچن، بە هەمان ڕیزبەندیی هاتنەژوورەوەیان — 1، 0، 1، 1. جووڵاندنی زنجیری بۆ زنجیری ڕیزێکە: هەرکەس یەکەم بێت یەکەم دەڕوات، وەک ڕیزی بەردەم نانەواخانە.
How flip-flops chained in a shift register move the bits one place per clock pulse, and the serial and parallel modes.
چۆن لە جووڵاندندا بە زنجیر دەبەسترێن و لە هەر یەک خانە دەجووڵێنن، هەروەها شێوازی زنجیری و تەریب.
Plays 0:00–7:17: what a shift register is, how bits move one stage per clock, serial and parallel data, and the shift-register modes.
لە 0:00 تا 7:17 پەخش دەبێت: جووڵاندن چییە، چۆن لە هەر یەک قۆناغ دەجووڵێن، زنجیری و تەریب و شێوازەکانی جووڵاندن.
Shift registers: bits on the moveتۆمارگەکانی جووڵاندن: بیتەکان لە جووڵەدا
Four ways in and outچوار ڕێگای چوونە ژوورەوە و دەرچوون
Data can enter a shift register one bit at a time (serial) or all bits at once (parallel), and it can leave in either way too. The four combinations have names:
دەتوانێت یەک یەک (زنجیری) یان هەموو پێکەوە (تەریب) بچێتە ناو جووڵاندن و بە هەر دوو ڕێگاکەش دەربچێت. چوار تێکەڵەکە ناویان هەیە:
| Typeجۆر | In → outژوورەوە ← دەرەوە | Typical useبەکارهێنانی ئاسایی | Example chipنموونەی |
|---|---|---|---|
| SISO | serial → serialزنجیری ← زنجیری | a delay line, a queue of bitsدواخستنی ، ڕیزێک | — |
| SIPO | serial → parallelزنجیری ← تەریب | receive bits from a serial link; drive 8 LEDs from 3 pinsوەرگرتنی لە پەیوەندییەکی زنجیرییەوە؛ جووڵاندنی 8 بە 3 پین | 74HC595 |
| PISO | parallel → serialتەریب ← زنجیری | send a word over one wire; read 8 buttons with 3 pinsناردنی بە یەک وایەر؛ خوێندنەوەی 8 دوگمە بە 3 پین | 74HC165 |
| PIPO | parallel → parallelتەریب ← تەریب | an ordinary register (no shifting needed) ئاسایی (جووڵاندنی پێویست نییە) | 74HC173 |
| bidirectional / universalدوو-ئاڕاستە / گشتی | left or right; serial or parallelچەپ یان ڕاست؛ زنجیری یان تەریب | shifting numbers both waysجووڵاندنی ژمارە بە هەردوو ئاڕاستەدا | 74HC194 |
This is how serial links work. USB, SATA and Ethernet send the bits of a word one after another over a few wires, while the CPU handles whole words: a shift register at each end converts parallel to serial and back. A serial output can also be wired back to the serial input, so the data recirculates while it is read and is not lost.
پەیوەندییە زنجیرییەکان بەم شێوەیە کار دەکەن. ، SATA و Ethernet یەک لە دوای یەک بە چەند وایەرێکدا دەنێرن، لە کاتێکدا تەواوەکان بەکار دەهێنێت: جووڵاندن لە هەر لایەک تەریب دەکات بە زنجیری و بە پێچەوانەوە. زنجیری دەتوانرێت بگەڕێنرێتەوە بۆ زنجیری، تاکو لە کاتی خوێندنەوەدا بخولێتەوە و ون نەبێت.
Shift registers: bits on the moveتۆمارگەکانی جووڵاندن: بیتەکان لە جووڵەدا
Shifting is multiplying and dividing by 2جووڵاندن واتە لێکدان و دابەشکردن بە 2
Shift a binary number one place to the left (a 0 enters on the right) and it doubles; shift it to the right and it halves, and the bit that falls out is the remainder — exactly as in Shifting left doubles a number. A bidirectional shift register can do both:
ژمارەیەکی یەک خانە بەرەو چەپ بجووڵێنە (0ـێک لە لای ڕاستەوە دێتە ژوورەوە) و دوو هێندە دەبێت؛ بەرەو ڕاست بیجووڵێنە و دەبێتە نیوە و ئەو دەکەوێتە دەرەوە پاشماوەکەیە — ڕێک وەک جووڵاندن بۆ چەپ ژمارە دوو هێندە دەکات. جووڵاندنی دوو-ئاڕاستە دەتوانێت هەردووکیان بکات:
| Operationکار | Bits | Valueبەها |
|---|---|---|
| startسەرەتا | 00110 | 6 |
| shift leftجووڵاندن بۆ چەپ | 01100 | 12 |
| shift right (from the start)جووڵاندن بۆ ڕاست (لە سەرەتاوە) | 00011 | 3 |
| shift right 1011جووڵاندنی 1011 بۆ ڕاست | 0101 | 5, remainder 15، پاشماوە 1 |
In a rotate, the bit that falls out on one side comes back in on the other side, so nothing is lost: rotating 1011 right gives 1101. Processors have shift and rotate instructions, and they use shifts for fast multiplication and division by powers of 2.
لە سووڕاندندا (rotate)، ئەو لە لایەکەوە دەکەوێتە دەرەوە لە لایەکەی ترەوە دەگەڕێتەوە ژوورەوە، بۆیە هیچ شتێک ون نابێت: سووڕاندنی 1011 بۆ ڕاست 1101 دەدات. پرۆسێسەرەکان جووڵاندن و سووڕاندنیان هەیە و جووڵاندن بۆ لێکدان و دابەشکردنی خێرا بە توانەکانی 2 بەکار دەهێنن.
Countersژمێرەرە دیجیتاڵەکان
A sequential circuit made of flip-flops that counts clock pulses in binary: 000, 001, 010 and so on.
کە لە دروست کراوە و بە دەژمێرێت: 000، 001، 010 و هتد.
A counter is a sequential circuit that steps through a fixed sequence of states, one step per clock pulse. With n flip-flops it can have at most states: 3 flip-flops count 000 to 111 (0 to 7) and then roll over to 000. Write binary counting in a column and a pattern appears:
کە بە زنجیرەیەکی دیاریکراوی دۆخەکاندا دەڕوات، لە هەر هەنگاوێک. بە n زۆرترین دۆخی دەبێت: 3 لە 000ـەوە تا 111 (0 تا 7) دەژمێرن و پاشان دەگەڕێنەوە بۆ 000. ژماردنی دووانی لە ستوونێکدا بنووسە و نەخشەیەک دەردەکەوێت:
| Countژمارە | Q₂ Q₁ Q₀ |
|---|---|
| 0 | 0 0 0 |
| 1 | 0 0 1 |
| 2 | 0 1 0 |
| 3 | 0 1 1 |
| 4 | 1 0 0 |
| 5 | 1 0 1 |
| 6 | 1 1 0 |
| 7 | 1 1 1 |
| 8 | 0 0 0 |
Read each column downwards: Q₀ changes at every count, Q₁ every second count, Q₂ every fourth count. A bit changes exactly when all the bits to its right are 1 — the moment a carry arrives. Changing at every pulse is what a T flip-flop with does.
هەر ستوونێک بەرەو خوار بخوێنەوە: Q₀ لە هەموو ژماردنێکدا دەگۆڕێت، Q₁ لە هەر دوو ژماردن جارێک، Q₂ لە هەر چوار ژماردن جارێک. ڕێک کاتێک دەگۆڕێت کە هەموو لای ڕاستی 1 بن — ساتی گەیشتنی . گۆڕان لە هەموو ئەوەیە کە T بە دەیکات.
Countersژمێرەرە دیجیتاڵەکان
The ripple counter: each flip-flop clocks the nextژمێرەری دیجیتاڵی ناهاوکات: هەر فلیپ-فلۆپێک سیگناڵی کاتژمێری دواتر دەدات
The simplest counter uses that pattern directly. Take three JK flip-flops with , so each one toggles at every active clock edge. The clock drives only the first one; the Q of each flip-flop is the clock of the next. These flip-flops change on the falling edge (like the 7476 of the lab), so a flip-flop toggles exactly when the one before it falls from 1 to 0 — which is when binary counting carries.
سادەترین ڕاستەوخۆ ئەو نەخشەیە بەکار دەهێنێت. سێ JK بە وەربگرە، بۆیە هەر یەکێکیان لە هەموو لێوارێکی چالاکی هەڵدەگەڕێتەوە. تەنها یەکەمیان دەجووڵێنێت؛ Qـی هەر دواترە. ئەم لە دەگۆڕێن (وەک 7476ـی تاقیگەکە)، بۆیە ڕێک کاتێک هەڵدەگەڕێتەوە کە ئەوەی پێشی لە 1ـەوە دەبێتە 0 — کە ڕێک ساتی ژماردنی .


Each stage also halves the frequency: with a 1 kHz clock, Q₀ is a 500 Hz square wave, Q₁ 250 Hz and Q₂ 125 Hz. A counter is a frequency divider too.
هەر قۆناغێک دەکاتە نیوە: بە 1 kHz، Q₀ بە 500 Hzـە، Q₁ بە 250 Hz و Q₂ بە 125 Hz. دابەشکەری .
Chains JK flip-flops in toggle mode, each one clocking the next, and shows that their outputs count in binary.
JK لە دۆخی هەڵگەڕانەوەدا بە زنجیر دەبەستێت، هەر یەکێکیان دەبێتە دواتر، پاشان پیشان دەدات کە بە دەژمێرن.
Ben Eater: toggling JK flip-flops make a binary (ripple) counter.
Ben Eater: JK کە هەڵدەگەڕێنەوە () دروست دەکەن.
Countersژمێرەرە دیجیتاڵەکان
Why ripple counters are slowبۆچی ژمێرەرە دیجیتاڵەکانی ناهاوکات هێواشن
In a ripple counter the flip-flops do not change together. Each one waits for the one before it, and each adds its own propagation delay (a few nanoseconds). Going from 011 to 100, the counter really passes through two wrong values:
لە ناهاوکاتدا پێکەوە ناگۆڕێن. هەر یەکێکیان چاوەڕێی ئەوەی پێشی دەکات و هەر یەکەیان خۆی زیاد دەکات (چەند نانۆچرکەیەک). لە چوون لە 011ـەوە بۆ 100، لە ڕاستیدا بە دوو بەهای هەڵەدا تێدەپەڕێت:
Q0 falls first, then Q1, then Q2 rises. For a moment the outputs show 2 and 0. A circuit that watches for 000 would see a false "zero" between 3 and 4 — a glitch.
سەرەتا Q0 دادەبەزێت، پاشان Q1، پاشان Q2 بەرز دەبێتەوە. بۆ ساتێک 2 و 0 پیشان دەدەن. کە چاوەڕێی 000 بێت لە نێوان 3 و 4دا «سفر»ێکی درۆ دەبینێت — گلیچ (glitch).
The worst case is when every bit changes, as in 111 → 000: the last flip-flop settles only after n delays. With 4 flip-flops of 10 ns each, the count is right only 40 ns after the clock edge, so the clock must stay slower than about 25 MHz. Ripple counters are fine for slow jobs such as dividing a clock, but fast circuits use synchronous counters.
خراپترین حاڵەت ئەوەیە کە هەموو دەگۆڕێت، وەک 111 ← 000: دوایین تەنها دوای n دواکەوتن جێگیر دەبێت. بە 4 کە هەر یەکەیان 10 ns بێت، ژمارەکە تەنها 40 ns دوای لێواری دروستە، بۆیە دەبێت لە نزیکەی 25 MHz هێواشتر بێت. ناهاوکات بۆ کاری هێواش وەک دابەشکردنی باشن، بەڵام خێرا هاوکات بەکار دەهێنن.
Countersژمێرەرە دیجیتاڵەکان
Which edge? Counting up or downکام لێوار؟ ژماردن بەرەو سەرەوە یان خوارەوە
Which edge clocks the next flip-flop decides the direction. When counting up, a bit must change exactly when the bit before it falls from 1 to 0 — the moment of the carry. Falling-edge flip-flops clocked from Q do exactly that. rises at the same moment as Q falls, so rising-edge flip-flops clocked from count up too.
ئەوەی کام لێوار دواتر لێدەدات ئاڕاستەکە دیاری دەکات. لە ژماردن بەرەو سەرەوەدا، دەبێت ڕێک کاتێک بگۆڕێت کە پێش خۆی لە 1ـەوە دەبێتە 0 — ساتی . کە لە Qـەوە لێیان بدرێت ڕێک ئەوە دەکەن. لە هەمان ساتدا بەرز دەبێتەوە کە Q دادەبەزێت، بۆیە کە لە ـەوە لێیان بدرێت هەروەها بەرەو سەرەوە دەژمێرن.
Countersژمێرەرە دیجیتاڵەکان
Lab: build the 3-bit counter in a simulatorتاقیگە: ژمێرەری دیجیتاڵی سێ بیتی لە هاوشێوەسازدا دروست بکە
The course's simulator lab builds exactly this counter with two 7476 chips (each holds two JK flip-flops with preset and clear). Build it in Multisim, as in the lab, or in the free browser simulator CircuitVerse; how to place parts and run a simulation is in Simulating and Testing Logic Circuits.
تاقیگەی کۆرسەکە ڕێک ئەم بە دوو 7476 دروست دەکات (هەر یەکەیان دوو JKـی بە preset و clear تێدایە). لە Multisimـدا دروستی بکە، وەک تاقیگەکە، یان لە CircuitVerse کە بێبەرانبەری ناو ؛ چۆنیەتیی دانانی پارچەکان و کارپێکردنی هاوشێوەکردن لە وانەی هاوشێوەکردن و تاقیکردنەوەی سووڕە لۆجیکییەکاندایە.
Place a 5 V DC source and a ground, and a clock source set to a slow rate (1 Hz) so that you can watch the LEDs.
سەرچاوەیەکی DCـی 5 V و GND دابنێ، لەگەڵ سەرچاوەیەکی کە لەسەر ڕێژەیەکی هێواش (1 Hz) ڕێکخراوە تاکو بتوانیت سەیری LEDـەکان بکەیت.
Place three JK flip-flops (two 7476 chips). Tie every J, every K and every preset and clear pin to 5 V (logic 1).
سێ JK دابنێ (دوو 7476). هەموو J، هەموو K و هەموو پینێکی preset و clear بە 5 V ببەستە (1ـی لۆجیکی).
Wire the clock to the clock input of FF0, Q0 to the clock of FF1 and Q1 to the clock of FF2.
ببەستە بە FF0، Q0 بە FF1 و Q1 بە FF2.
Put a probe or an LED on Q0, Q1 and Q2. (The lab also adds a push-button switch so you can give single pulses by hand.)
پرۆبێک یان لەسەر Q0، Q1 و Q2 دابنێ. (تاقیگەکە دوگمەیی زیاد دەکات تاکو بتوانیت بە دەست یەک یەک بدەیت.)
Run the simulation and write the table: after 0, 1, 2 … 8 pulses the probes C B A (Q2 Q1 Q0) show 000, 001, 010 … 111 and then 000 again.
تاقیکردنەوەکە کار پێ بکە و خشتەکە بنووسە: دوای 0، 1، 2 … 8 ، پرۆبەکانی C B A (Q2 Q1 Q0) 000، 001، 010 … 111 و پاشان دیسان 000 پیشان دەدەن.
| Pulses | C B A (Q₂ Q₁ Q₀) |
|---|---|
| 0 | 0 0 0 |
| 1 | 0 0 1 |
| 2 | 0 1 0 |
| 3 | 0 1 1 |
| 4 | 1 0 0 |
| 5 | 1 0 1 |
| 6 | 1 1 0 |
| 7 | 1 1 1 |
| 8 | 0 0 0 |
Synchronous counters: one clock for allژمێرەرە دیجیتاڵەکانی هاوکات: یەک سیگناڵی کاتژمێر بۆ هەموویان
A synchronous counter connects the same clock to every flip-flop, so they all change at the same edge, and the count is correct one flip-flop delay after the edge, however many bits there are. Gates decide which flip-flops toggle. From the counting pattern: flip-flop i must toggle exactly when all lower bits are 1. With JK flip-flops ():
هاوکات هەمان بە هەموو دەبەستێت، بۆیە هەموویان لە هەمان لێواردا دەگۆڕێن و ژمارەکە یەک دواکەوتنی دوای لێوارەکە دروستە، هەرچەند بن. بڕیار دەدەن کام هەڵبگەڕێتەوە. لە نەخشەی ژماردنەوە: i دەبێت ڕێک کاتێک هەڵبگەڕێتەوە کە هەموو نزمتر 1 بن. بە JK ():
The same rule as adding 1 in binary: a bit flips when a carry reaches it.
هەمان یاسای زیادکردنی 1 بە : کاتێک هەڵدەگەڕێتەوە کە پێی دەگات.
Synchronous counters: one clock for allژمێرەرە دیجیتاڵەکانی هاوکات: یەک سیگناڵی کاتژمێر بۆ هەموویان
The excitation table: which inputs cause a change?خشتەی ورووژاندن: کام نێوخستە گۆڕانێک دروست دەکات؟
The reverse of a : for each change of a (, , , ) it lists the inputs that cause it. It is used to design counters and other .
پێچەوانەی : بۆ هەر گۆڕانێکی (، ، ، ) ئەو دەنووسێت کە دروستی دەکەن. بۆ دیزاینکردنی و تر بەکار دێت.
To design a counter we ask the opposite question to the characteristic table: the flip-flop must go from Q to — which inputs make it do that? For a JK flip-flop, going from 0 to 1 needs , and K does not matter (with , sets and toggles — both give 1). That "does not matter" is a don't-care, X:
بۆ دیزاینکردنی پرسیارە پێچەوانەکەی دەکەین: دەبێت لە Qـەوە بچێت بۆ — کام وای لێ دەکات؟ بۆ JK، چوون لە 0ـەوە بۆ 1 پێویستی بە ـە و K گرنگ نییە (بە ، دادەنێت و هەڵدەگەڕێنێتەوە — هەردووکیان 1 دەدەن). ئەو «گرنگ نییە»یە ، X:
| J K | T | D | S R | |
|---|---|---|---|---|
| 0 X | 0 | 0 | 0 X | |
| 1 X | 1 | 1 | 1 0 | |
| X 1 | 1 | 0 | 0 1 | |
| X 0 | 0 | 1 | X 0 |
Synchronous counters: one clock for allژمێرەرە دیجیتاڵەکانی هاوکات: یەک سیگناڵی کاتژمێر بۆ هەموویان
Designing the 3-bit counter step by stepدیزاینکردنی ژمێرەری دیجیتاڵی سێ بیتی هەنگاو بە هەنگاو
State table. List each present state Q₂Q₁Q₀ and the next state: 000 → 001 → … → 111 → 000.
. هەر دۆخێکی ئێستای Q₂Q₁Q₀ و دۆخی داهاتووی بنووسە: 000 ← 001 ← … ← 111 ← 000.
Excitation columns. For every flip-flop and every row, look up the J K that cause its change in the excitation table.
ستوونەکانی ورووژاندن. بۆ هەر و هەر ڕیزێک، ئەو J K بدۆزەرەوە کە گۆڕانەکەی دروست دەکەن لە .
Excitation table of the 3-bit counter سێ Q₂Q₁Q₀ nextداهاتوو J₂ K₂ J₁ K₁ J₀ K₀ 0 0 0 0 0 1 0 X 0 X 1 X 0 0 1 0 1 0 0 X 1 X X 1 0 1 0 0 1 1 0 X X 0 1 X 0 1 1 1 0 0 1 X X 1 X 1 1 0 0 1 0 1 X 0 0 X 1 X 1 0 1 1 1 0 X 0 1 X X 1 1 1 0 1 1 1 X 0 X 0 1 X 1 1 1 0 0 0 X 1 X 1 X 1 Simplify. Put each column on a Karnaugh map and use the Xs as don't-cares. J₀ and K₀ are 1 or X everywhere, so they are 1. J₁ and K₁ are 1 exactly where . J₂ and K₂ are 1 only where .
کورتکردنەوە. هەر ستوونێک بخەرە سەر و Xـەکان وەک دۆخە بێبایەخەکان بەکار بهێنە. J₀ و K₀ لە هەموو شوێنێک 1 یان Xـن، بۆیە 1ـن. J₁ و K₁ ڕێک لەو شوێنانەدا 1ـن کە ـە. J₂ و K₂ تەنها لەو شوێنەدا 1ـن کە ـە.
Draw. One AND gate is all the extra logic. With T flip-flops the same reasoning gives , , ; with D flip-flops, , , .
کێشان. یەک هەموو لۆجیکی زیادەیە. بە T هەمان بیرکردنەوە ، ، دەدات؛ بە D، ، ، .
Counters that stop early: mod-nژمێرەرە دیجیتاڵەکانی mod-n: گەڕانەوە پێش کۆتایی
The number of states a counter goes through is its modulus. A 3-bit binary counter is mod-8. Often we need another number: a mod-6 counter (0 to 5) still needs 3 flip-flops, and 2 of the 8 patterns are never used. The decade counter is mod-10: it counts 0000 to 1001 — the BCD digits — and then returns to 0000.
ژمارەی ئەو دۆخانەی پێیاندا تێدەپەڕێت مۆدیولـەکەیەتی (modulus). سێ mod-8ـە. زۆرجار ژمارەیەکی ترمان پێویستە: mod-6 (0 تا 5) هێشتا 3 پێویستە و 2 نەخشە لە 8 هەرگیز بەکار نایەن. دەیی mod-10ـە: لە 0000ـەوە تا 1001 دەژمێرێت — کۆدی دەیی دووانی — و پاشان دەگەڕێتەوە بۆ 0000.
Counters that stop early: mod-nژمێرەرە دیجیتاڵەکانی mod-n: گەڕانەوە پێش کۆتایی
The decade counterژمێرەری دیجیتاڵی دەیی
A quick way to make a ripple decade counter is to watch for the first unwanted state, 1010: a NAND gate on Q₃ and Q₁ pulls the clear inputs low the moment 1010 appears, and the counter jumps back to 0000. The wrong state lasts only a few nanoseconds, but it is a glitch, so careful designs use a synchronous decade counter such as the 74HC160 (or the binary 74HC161, which can also be loaded with a start value). Chained, a mod-10 and a mod-6 counter make the mod-60 seconds counter of a digital clock.
ڕێگایەکی خێرا بۆ دروستکردنی ناهاوکاتی دەیی چاودێریکردنی یەکەم دۆخی نەویستراوە، 1010: لەسەر Q₃ و Q₁ clear لەو ساتەدا کە 1010 دەردەکەوێت دەکات بە 0 و باز دەداتەوە بۆ 0000. دۆخە هەڵەکە تەنها چەند نانۆچرکەیەک دەمێنێت، بەڵام گلیچێکە، بۆیە دیزاینە ورددەکان هاوکاتی دەیی وەک 74HC160 بەکار دەهێنن (یان 74HC161، کە و دەتوانرێت بە بەهایەکی سەرەتاش بار بکرێت). mod-10 و یەکێکی mod-6 بە زنجیر mod-60ـی چرکەکانی کاتژمێرێکی دروست دەکەن.
Counters that stop early: mod-nژمێرەرە دیجیتاڵەکانی mod-n: گەڕانەوە پێش کۆتایی
Ring and Johnson countersژمێرەرە دیجیتاڵەکانی ئەڵقەیی و Johnson
A shift register whose last output is fed back to its first input becomes a counter. In a ring counter Q₃ goes back to D₀ and the register starts as 1000: the single 1 travels round, 1000 → 0100 → 0010 → 0001 → 1000. With n flip-flops it has n states (mod-n) and only one output is 1 at a time, so it needs no decoder — but it uses only 4 of the 16 possible patterns.
جووڵاندن کە دوایین بگەڕێنرێتەوە بۆ یەکەم دەبێتە . لە ئەڵقەییدا Q₃ دەگەڕێتەوە بۆ D₀ و بە 1000 دەست پێ دەکات: تاکە 1ـەکە دەخولێتەوە، 1000 ← 0100 ← 0010 ← 0001 ← 1000. بە n n دۆخی هەیە (mod-n) و لە هەر کاتێکدا تەنها یەک 1ـە، بۆیە پێویستی بە نییە — بەڵام تەنها 4 نەخشە لە 16 نەخشە دەکرێیەکە بەکار دەهێنێت.
A Johnson counter (twisted ring) feeds back the complement instead. Starting from 0000 it fills with 1s and then empties: 8 states with 4 flip-flops (mod-2n), and only one bit changes per step, as in the Gray code.
Johnson (ئەڵقەی بادراو) لە جیاتی ئەوە ، ، دەگەڕێنێتەوە. لە 0000ـەوە بە 1 پڕ دەبێت و پاشان بەتاڵ دەبێتەوە: 8 دۆخ بە 4 (mod-2n) و لە هەر هەنگاوێکدا تەنها یەک دەگۆڕێت، وەک .
| Stepهەنگاو | Ring: Q₀Q₁Q₂Q₃ئەڵقەیی: Q₀Q₁Q₂Q₃ | Johnson: Q₀Q₁Q₂Q₃ |
|---|---|---|
| 0 | 1000 | 0000 |
| 1 | 0100 | 1000 |
| 2 | 0010 | 1100 |
| 3 | 0001 | 1110 |
| 4 | 1000 (again)1000 (دووبارە) | 1111 |
| 5 | 0111 | |
| 6 | 0011 | |
| 7 | 0001 | |
| 8 | 0000 (again)0000 (دووبارە) |
The CMOS 4017 chip is a Johnson counter with a small decoder: ten outputs light one after another, a favourite for LED chasers.
CMOS 4017 Johnsonـە لەگەڵ بچووک: دە یەک لە دوای یەک ڕووناک دەبنەوە، کە بۆ ڕیزە ڕاکردوو بەناوبانگە.
State tables and state diagramsخشتەکانی دۆخ و هێڵکارییەکانی دۆخ
A counter is a small machine with states. Its behaviour is written in a state table — present state, input, next state — or drawn as a state diagram, with one circle per state and one arrow per transition. A circuit like this, where flip-flops on one clock change only at its edges, is a synchronous sequential circuit. A circuit whose gates feed back with no clock (like the basic SR latch) is asynchronous: it reacts at any moment and can be unstable, so it is used only in small, careful places.
ئامێرێکی بچووکی خاوەن دۆخـە. ڕەفتارەکەی لە ـدا دەنووسرێت — دۆخی ئێستا، ، دۆخی داهاتوو — یان وەک دەکێشرێت، بە یەک بازنە بۆ هەر دۆخێک و یەک تیر بۆ هەر گۆڕانێک. وەها، کە لەسەر یەک تەنها لە لێوارەکانیدا دەگۆڕێن، و پێی دەوترێت هاوکات. بەڵام کە بێ بکەن (وەک SRـی سادە) ناهاوکاتـە: لە هەر ساتێکدا وەڵام دەداتەوە و دەتوانێت ناجێگیر بێت، بۆیە تەنها لە شوێنی بچووک و ورددا بەکار دێت.
| Present state Q₁Q₀دۆخی ئێستا Q₁Q₀ | Next state, دۆخی داهاتوو، | Next state, دۆخی داهاتوو، |
|---|---|---|
| 00 | 11 | 01 |
| 01 | 00 | 10 |
| 10 | 01 | 11 |
| 11 | 10 | 00 |
State tables and state diagramsخشتەکانی دۆخ و هێڵکارییەکانی دۆخ
Moore and Mealy, and fewer statesMoore، Mealy و دۆخی کەمتر
Sequential circuits with outputs come in two models. In a Moore machine the outputs depend only on the present state, so they are written inside the circles (a lamp that is on in state 11). In a Mealy machine the outputs depend on the state and the present input, so they are written on the arrows as input/output, such as 1/0. Hardware designers often prefer Moore machines because their outputs change only with the clock.
، کاتێک هەبێت، دوو مۆدێلیان هەیە. لە ئامێری Mooreدا تەنها بەندن بە دۆخی ئێستا، بۆیە لەناو بازنەکاندا دەنووسرێن (چرایەک کە لە دۆخی 11دا هەڵکراوە). لە ئامێری Mealyدا بەندن بە دۆخ و ئێستا، بۆیە لەسەر تیرەکان وەک / دەنووسرێن، وەک 1/0. دیزاینەرەکانی زۆرجار ئامێری Moore بە باشتر دەزانن چونکە تەنها لەگەڵ دەگۆڕێن.
State reduction. If two states give the same outputs and go to the same next states for every input, they can never be told apart, so one of them can be removed. Fewer states can mean fewer flip-flops and fewer gates.
کەمکردنەوەی دۆخەکان. ئەگەر دوو دۆخ بۆ هەموو هەمان بدەن و بچن بۆ هەمان دۆخی داهاتوو، هەرگیز جیا ناکرێنەوە، بۆیە دەتوانرێت یەکێکیان لاببرێت. دۆخی کەمتر دەتوانێت واتای و کەمتر بێت.
Where counters and registers workژمێرەرە دیجیتاڵەکان و تۆمارگەکان لە کوێ کار دەکەن
- The program counter. The CPU's program counter is a register that counts: after each instruction it moves on to the next address, and a jump loads a new value — a counter with parallel load, like the 74HC161. How the CPU knows what comes next shows it at work.
- Clocks and timers. A digital clock divides a crystal frequency down to 1 Hz, then counts seconds (mod-60), minutes (mod-60) and hours (mod-24). Microcontrollers have counter–timers for delays and for measuring time.
- Counting things. Turnstiles at a stadium, products on a factory belt, the floor number of a lift (an up/down counter).
- Serial links. Shift registers turn words into bit streams and back in USB, network and display links.
- . ژمێرەری بەرنامەـی کە دەژمێرێت: دوای هەر دەچێت بۆ ناونیشانی داهاتوو و بازدانێک (jump) بەهایەکی نوێی تێدا بار دەکات — بە بارکردنی تەریب، وەک 74HC161. CPU چۆن دەزانێت دواتر چی دێت لە کاتی کارکردندا پیشانی دەدات.
- کاتژمێر و کاتپێوەکان. کاتژمێرێکی کریستاڵێک دابەش دەکات تا دەگاتە 1 Hz، پاشان چرکەکان (mod-60)، خولەکەکان (mod-60) و کاتژمێرەکان (mod-24) دەژمێرێت. مایکرۆکۆنترۆڵەرەکان و کاتپێوی ناوەکییان هەیە بۆ دواخستن و پێوانی کات.
- ژماردنی شتەکان. دەروازە سووڕاوەکانی یاریگا، بەرهەمەکان لەسەر شریتی کارگە، ژمارەی نهۆمی ئاسانسۆر ( سەرەوە/خوارەوە).
- پەیوەندییە زنجیرییەکان. جووڵاندن دەکەن بە ڕیزی و بە پێچەوانەوە لە پەیوەندییەکانی ، ڕایەڵە و شاشەدا.
Designs the program counter of a simple 8-bit computer: a counter chip that steps through addresses, with enable and output controls.
دیزاینی سادەی 8 : کە یەک بە یەک بە ناو دەڕوات، لەگەڵ کۆنترۆڵی چالاککردن و .
Ben Eater: the program counter as a real counter chip.
Ben Eater: وەک ڕاستەقینەی .
From building blocks to a CPUلە بلۆکە بنیاتنەرەکانەوە بۆ CPU
You can now name every part of a simple processor. The ALU is adders plus logic gates, with multiplexers choosing its inputs; the registers are rows of flip-flops; the program counter is a counter; the instruction decoder is a decoder; and the control unit is a small sequential circuit that steps through fetch, decode and execute on every clock tick.
ئێستا دەتوانیت ناوی هەموو بەشێکی پرۆسێسەرێکی سادە بزانیت. ALU لە و پێک دێت، کە هەڵدەبژێرن؛ ڕیزی ؛ ؛ ؛ و کە بچووکە و لە هەر لێدانێکی بە fetch، decode و executeـدا هەنگاو دەنێت.
This is where Logic Design hands over to computer architecture. The Information Technology course continues with the CPU and its parts and how a computer runs a program, where you can watch these blocks fetch, decode and execute real instructions.
ئێرە ئەو شوێنەیە کە دیزاینی دەستاودەست بە تەلارسازیی دەدات. کۆرسی بەردەوام دەبێت بە CPU و بەشەکانی و کۆمپیوتەر چۆن بەرنامەیەک جێبەجێ دەکات، کە تێیدا دەتوانیت سەیری ئەم بلۆکانە بکەیت کە ڕاستەقینە fetch، decode و execute دەکەن.
Common mistakesهەڵە باوەکان
- One flip-flop per state. A counter needs one flip-flop per bit: mod-60 needs 6 flip-flops (), not 60.
- Forgetting in a ripple counter. With J or K at 0 the flip-flops do not toggle and the counter stops.
- The wrong edge. Rising-edge flip-flops clocked from Q make a ripple counter count down.
- Reading a ripple counter too early. Right after an edge it may show wrong values for a few nanoseconds.
- Mixing up the shift direction. Shifting toward the least significant bit (right) halves the number; toward the most significant bit (left) doubles it.
- Starting a ring counter at 0000. A ring counter needs exactly one 1 to circulate; it must be preset to 1000.
- بۆ هەر دۆخێک یەک . بۆ هەر یەک پێویستە: mod-60 پێویستی بە 6 ()، نەک 60.
- لەبیرکردنی لە ناهاوکاتدا. ئەگەر J یان K 0 بێت هەڵناگەڕێنەوە و دەوەستێت.
- لێواری هەڵە. کە لە Qـەوە لێیان بدرێت، ناهاوکات بەرەو خوارەوە دەژمێرن.
- خوێندنەوەی ناهاوکات زۆر زوو. ڕێک دوای لێوارێک لەوانەیە بۆ چەند نانۆچرکەیەک بەهای هەڵە پیشان بدات.
- تێکەڵکردنی ئاڕاستەی جووڵاندن. جووڵاندن بەرەو (ڕاست) ژمارەکە دەکاتە نیوە؛ بەرەو (چەپ) دوو هێندەی دەکات.
- دەستپێکردنی ئەڵقەیی بە 0000. ئەڵقەیی پێویستی بە ڕێک یەک 1ـە بۆ خولانەوە؛ دەبێت بە 1000 ئامادە بکرێت (preset).
Exercisesڕاهێنانەکان
Original exercises in the style of the course's sequential-circuit exercises: shift-register contents, counter design and circuit analysis.
ڕاهێنانی تازە لەسەر شێوەی ڕاهێنانەکانی کۆرسەکە: ناوەڕۆکی جووڵاندن، دیزاینی و شیکردنەوەی .
A 6-bit shift register with rotation holds 101100. It rotates right three times (the bit leaving on the right enters on the left). Write its contents after each rotation.
جووڵاندنی شەش بە سووڕاندن 101100 هەڵدەگرێت. سێ جار بەرەو ڕاست دەسووڕێتەوە (ئەو لە لای ڕاستەوە دەردەچێت لە لای چەپەوە دێتە ژوورەوە). ناوەڕۆکەکەی دوای هەر سووڕانەوەیەک بنووسە.
Show answerوەڵامەکە پیشان بدە
010110, 001011, 100101. Nothing is lost: three more rotations give 101100 back after six in total.
010110، 001011، 100101. هیچ شتێک ون نابێت: سێ سووڕانەوەی تر دوای شەش سووڕانەوە 101100 دەگەڕێننەوە.
A 6-bit register holds 110101 (53). It shifts right three times, with 0 entering on the left. Write each result and its decimal value.
شەش 110101 (53) هەڵدەگرێت. سێ جار بەرەو ڕاست دەجووڵێت و 0 لە لای چەپەوە دێتە ژوورەوە. هەر ئەنجامێک و بەها بنووسە.
Show answerوەڵامەکە پیشان بدە
, , . Each shift divides by 2 and drops the remainder (53 → 26 r 1 → 13 r 0 → 6 r 1).
، ، . هەر جووڵاندنێک بەسەر 2دا دابەش دەکات و پاشماوەکە فڕێ دەدات (53 ← 26، پاشماوە 1؛ 26 ← 13، پاشماوە 0؛ 13 ← 6، پاشماوە 1).
Design a synchronous counter with JK flip-flops that counts 000, 001, 010, 011, 100, 101 and back to 000. Use the unused states 110 and 111 as don't-cares. Then check where the counter goes if it ever wakes up in 110 or 111.
هاوکات بە JK دیزاین بکە کە 000، 001، 010، 011، 100، 101 دەژمێرێت و دەگەڕێتەوە بۆ 000. دۆخە بەکارنەهاتووەکانی 110 و 111 وەک بەکار بهێنە. پاشان بپشکنە ئەگەر هەرگیز لە 110 یان 111دا هەڵبستێت، بۆ کوێ دەچێت.
Hintئاماژە
Fill the excitation columns row by row, then group the 1s with the Xs.
ستوونەکانی ورووژاندن ڕیز بە ڕیز پڕ بکەرەوە، پاشان 1ـەکان لەگەڵ Xـەکان گرووپ بکە.
Show answerوەڵامەکە پیشان بدە
| Q₂Q₁Q₀ | nextداهاتوو | J₂ K₂ | J₁ K₁ | J₀ K₀ |
|---|---|---|---|---|
| 0 0 0 | 0 0 1 | 0 X | 0 X | 1 X |
| 0 0 1 | 0 1 0 | 0 X | 1 X | X 1 |
| 0 1 0 | 0 1 1 | 0 X | X 0 | 1 X |
| 0 1 1 | 1 0 0 | 1 X | X 1 | X 1 |
| 1 0 0 | 1 0 1 | X 0 | 0 X | 1 X |
| 1 0 1 | 0 0 0 | X 1 | 0 X | X 1 |
With 110 and 111 as don't-cares on the K-maps. Check: 110 → 111 → 000 and 111 → 000, so the counter always returns to its loop (it is self-starting).
بە 110 و 111 وەک لەسەر . پشکنین: 110 ← 111 ← 000 و 111 ← 000، بۆیە هەمیشە دەگەڕێتەوە بۆ ئەڵقەکەی خۆی (خۆی دەست پێ دەکاتەوە).
A 1 MHz clock drives a 4-bit ripple counter. What frequency appears at each output Q₀ to Q₃?
1 MHz ناهاوکاتی چوار دەجووڵێنێت. لە هەر Q₀ تا Q₃ چ دەردەکەوێت؟
Show answerوەڵامەکە پیشان بدە
Each stage halves the frequency: 500 kHz, 250 kHz, 125 kHz and 62.5 kHz, which is 1 MHz divided by .
هەر قۆناغێک دەکاتە نیوە: 500 kHz، 250 kHz، 125 kHz و 62.5 kHz، کە 1 MHzـە دابەشکراو بەسەر دا.
How many flip-flops do binary counters with these moduli need, and how many patterns stay unused: mod-12, mod-24, mod-60?
بەم مۆدیولانە چەند پێویستە و چەند نەخشە بەکار نایەن: mod-12، mod-24، mod-60؟
Show answerوەڵامەکە پیشان بدە
mod-12: 4 flip-flops, 4 unused. mod-24: 5 flip-flops (), 8 unused. mod-60: 6 flip-flops (), 4 unused.
mod-12: 4 ، 4 بەکارنەهاتوو. mod-24: 5 ()، 8 بەکارنەهاتوو. mod-60: 6 ()، 4 بەکارنەهاتوو.
Two D flip-flops share a clock, with and . Write the state table starting from 00. What does the circuit do?
دوو D یەک بەکار دەهێنن، بە و . لە 00ـەوە بنووسە. چی دەکات؟
Show answerوەڵامەکە پیشان بدە
| Q₁Q₀ | Next state دۆخی داهاتوو |
|---|---|
| 00 | 01 |
| 01 | 10 |
| 10 | 11 |
| 11 | 00 |
It is a 2-bit synchronous up counter (mod-4): 00 → 01 → 10 → 11 → 00. For a D flip-flop the next state is simply D.
ئەمە هاوکاتی سەرەوەی دوو (mod-4): 00 ← 01 ← 10 ← 11 ← 00. بۆ D دۆخی داهاتوو تەنها Dـیە.
Now and . Write the state table from 00. Which code does this counter produce?
ئێستا و . لە 00ـەوە بنووسە. ئەم کام کۆد دروست دەکات؟
Write the sequence of a 3-bit Johnson counter starting from 000 (Q₀Q₁Q₂, with fed back to D₀). What is its modulus?
زنجیرەی Johnsonـی سێ بنووسە کە لە 000ـەوە دەست پێ دەکات (Q₀Q₁Q₂، بە گەڕاندنەوەی بۆ D₀). مۆدیولەکەی چەندە؟
Show answerوەڵامەکە پیشان بدە
000, 100, 110, 111, 011, 001, then 000 again: 6 states, so mod-6 ( with ).
000، 100، 110، 111، 011، 001، پاشان دیسان 000: 6 دۆخ، بۆیە mod-6 (، کە ).
A sequential circuit with input x and output Z has the state table below. Find the equivalent states and reduce the table. How many flip-flops does the reduced circuit need?
بە x و Z ئەم خوارەوەی هەیە. دۆخە هاوتاکان بدۆزەرەوە و خشتەکە کورت بکەرەوە. پاش کورتکردنەوە، پێویستی بە چەند هەیە؟
| Present stateدۆخی ئێستا | Next, داهاتوو، | Next, داهاتوو، | Z, Z، | Z, Z، |
|---|---|---|---|---|
| A | B | C | 0 | 1 |
| B | D | E | 1 | 0 |
| C | B | E | 0 | 0 |
| D | D | A | 1 | 0 |
| E | B | C | 0 | 1 |
Hintئاماژە
Two states are equivalent when their rows are identical: same next states and same outputs for every input. After you merge one pair, look again.
دوو دۆخ هاوتان کاتێک ڕیزەکانیان وەک یەکن: بۆ هەموو هەمان دۆخی داهاتوو و هەمان . دوای یەکخستنی جووتێک، دیسان سەیر بکە.
Show answerوەڵامەکە پیشان بدە
Rows A and E are identical, so E is the same as A: delete row E and write A wherever E appeared. Now row B is D, A, 1, 0 — exactly row D — so B and D are equivalent too: delete D and write B for it. Three states remain:
ڕیزەکانی A و E وەک یەکن، بۆیە E هەمان Aـیە: ڕیزی E بسڕەوە و لە هەر شوێنێکدا E هەبوو A بنووسە. ئێستا ڕیزی B دەبێتە D، A، 1، 0 — ڕێک وەک ڕیزی D — بۆیە B و Dـیش هاوتان: D بسڕەوە و لە جیاتی B بنووسە. سێ دۆخ دەمێننەوە:
| Present stateدۆخی ئێستا | Next, داهاتوو، | Next, داهاتوو، | Z, Z، | Z, Z، |
|---|---|---|---|---|
| A | B | C | 0 | 1 |
| B | B | A | 1 | 0 |
| C | B | A | 0 | 0 |
Five states needed 3 flip-flops; three states need only 2 (). B and C go to the same next states but give different outputs, so they stay apart. Checked by state partitioning in SP/ld/run/RLDDW2/check_seq.py.
پێنج دۆخ پێویستیان بە 3 بوو؛ سێ دۆخ تەنها 2یان پێویستە (). B و C دەچن بۆ هەمان دۆخی داهاتوو بەڵام جیاواز دەدەن، بۆیە جیا دەمێننەوە.
Two D flip-flops share a clock. The circuit has one input x and one output Z: , and . (a) Write the state table with the next state and Z for and . (b) Is it a Moore or a Mealy machine? (c) Starting in 00, the inputs 1, 0, 1, 0, 1 arrive one per clock. What is Z at each step?
دوو D یەک بەکار دەهێنن. یەک x و یەک Zـی هەیە: ، و . (أ) بنووسە بە دۆخی داهاتوو و Z بۆ و . (ب) ئامێرێکی Mooreـە یان Mealy؟ (ج) بە دەستپێکردن لە 00، 1، 0، 1، 0، 1 لە هەر لێدانێکی یەکێک دێن. Z لە هەر هەنگاوێکدا چەندە؟
Show answerوەڵامەکە پیشان بدە
| Q₁Q₀ | Next, داهاتوو، | Next, داهاتوو، | Z, Z، | Z, Z، |
|---|---|---|---|---|
| 00 | 00 | 01 | 0 | 0 |
| 01 | 10 | 11 | 0 | 0 |
| 10 | 00 | 01 | 0 | 1 |
| 11 | 10 | 11 | 0 | 0 |
(b) Z depends on the input x as well as on the state, so it is a Mealy machine: on its state diagram Z is written on the arrows, for example 1/1 on the arrow from 10 to 01. (c) . The flip-flops remember the last two inputs ( the older one, the newer one), and Z is 1 exactly when they were 1, 0 and the new input is 1 — the circuit detects the pattern 101, even when two patterns overlap.
(ب) Z بەندە بە x و بە دۆخ، بۆیە ئامێرێکی Mealyـیە: لەسەر Z لەسەر تیرەکان دەنووسرێت، بۆ نموونە 1/1 لەسەر تیری 10 بۆ 01. (ج) Z بەم شێوەیە: 0، 0، 1، 0، 1. دوو کۆتایی لەبیر دەگرن ( کۆنترەکە، نوێترەکە) و Z ڕێک کاتێک 1ـە کە ئەوان 1، 0 بوون و نوێیەکە 1ـە — نەخشەی 101 دەدۆزێتەوە، تەنانەت کاتێک دوو نەخشە بەسەر یەکدا دەکەون.
Summaryپوختە
- A register is n flip-flops on one clock; a LOAD input (a multiplexer per bit) decides whether the edge stores new data.
- A shift register chains Q to D: SISO, SIPO, PISO, PIPO, bidirectional. Shifting left doubles, right halves; serial links depend on it.
- A ripple counter (, each Q clocks the next) is simple but slow and shows short wrong values.
- A synchronous counter clocks every flip-flop together: , , , designed with the excitation table.
- mod-n counters stop early (decade = mod-10); ring (mod-n) and Johnson (mod-2n) counters are circulating shift registers.
- State tables and state diagrams describe sequential circuits; Moore outputs depend on the state, Mealy outputs also on the input.
- The program counter, registers, decoders, multiplexers and the ALU together make a CPU.
- n لەسەر یەک ؛ LOAD (بۆ هەر ) بڕیار دەدات ئایا لێوارەکە نوێ هەڵدەگرێت.
- جووڵاندن Q بە Dـەوە زنجیر دەکات: SISO، SIPO، PISO، PIPO، دوو-ئاڕاستە. جووڵاندن بۆ چەپ دوو هێندە دەکات و بۆ ڕاست نیوە؛ پەیوەندییە زنجیرییەکان پشتی پێ دەبەستن.
- ناهاوکات (، هەر Qـێک دواتر لێدەدات) سادەیە بەڵام هێواشە و بەهای هەڵەی کورت پیشان دەدات.
- هاوکات هەموو پێکەوە لێدەدات: ، ، ، کە بە دیزاین دەکرێت.
- mod-n زوو دەگەڕێنەوە (دەیی = mod-10)؛ ئەڵقەیی (mod-n) و Johnson (mod-2n) جووڵاندنی خولاوەن.
- و وەسف دەکەن؛ Moore بەندن بە دۆخ و Mealy بە .
- ، ، ، و ALU پێکەوە پێک دەهێنن.
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Related lecturesوانە پەیوەندیدارەکان
- Number Systems and Place Valueسیستەمە ژمارەییەکان و بەهای خانەیی
- Binary Multiplication and Divisionلێکدانی دووانی و دابەشکردنی دووانی
- Binary Coded Decimal (BCD)کۆدی دەیی دووانی
- The Gray Codeکۆدی گرەی
- Registers and Busesتۆمارگەکان و تێپەڕگەکان
- How a Computer Runs a Programکۆمپیوتەر چۆن بەرنامەیەک جێبەجێ دەکات
- The CPU: Control Unit, ALU and CoresCPU: یەکەی جڵەوکردن، ALU و ناوکەکانی پرۆسێسەر
- Simulating and Testing Logic Circuitsهاوشێوەکردن و تاقیکردنەوەی سووڕە لۆجیکییەکان
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.