Download presentation
Presentation is loading. Please wait.
2
مدار منطقی Logic Circuits
Registers and Counters
3
Registers and Counters
Circuits that include flip‐flops are usually classified by the function they perform rather than by the name of the sequential circuit. A register is a group of flip‐flops, each one of which shares a common clock and is capable of storing one bit of information. An n ‐bit register consists of a group of n flip‐flops capable of storing n bits of binary information. In addition to the flip‐flops, a register may have combinational gates that control its functionality. A counter is essentially a register that goes through a predetermined sequence of binary states. The gates in the counter are connected in such a way as to produce the prescribed sequence of states.
4
Simplest register 4 bit register
The common clock input triggers all flip‐flops on the positive edge of each pulse Asynchronous Reset No control of input data during normal operation Data must be available on every clock pulse
5
Registers with parallel load control
?? Mux 2-1 Clock control The master clock should be supplied to all system Constant inputs System bus is always busy A control signal is needed در واقع مدار باید به گونه ای طراحی شود که از دید مدار خارجی هر پایه دارای فقط یک Fan out باشد(علت گیت not اضافه). برای ماندن اطلاعات در رجیستر میتوان ورودیهای آن را ثابت نگه داشت و یا اینکه Clock انرا قطع کرد. برای قطع کردن کلاک نیاز به یک گیت در مسیر کلاک است که کار درستی نیست و سیستم را از حالت سنکرون خارج میکند با اضافه کردن یک تاخیر اضافی. در راه حل دوم اگر سیستم بخواهد ورودیها را ثابت نگه دارد باس آن برای کارهای دیگر ازاد نمیشود پس بهترین کار اضافه کردن یک ورودی کنترل است.
6
Register with parallel load and synchronous clear
Load Clear D Operation A No change Clear to 0 X I Load input
7
Simplest shift register
Shift Registers A register capable of shifting the binary information held in each cell to its neighboring cell, in a selected direction, is called a shift register. ورودی Reset نیز لازم است و در مدارات عملی وجود دارد. Simplest shift register Left to Right shift
8
Timing diagram طراحی یک شیفت رجیستر با ورودی فعال ساز شیفت. اگر این ورودی فعال باشد عمل شیفت به طور معمول انجام میشود. وگرنه داده شیفت پیدا نمیکند. باید مثل حالت قبل از یک Mux 2 به یک در ورودیهای هر FF استفاده کرد.
9
Serial transfer To prevent data loss Control signal(Not practical)
10
Example Register A Register B (b) (a) Initial Value 1 0 1 1 0 0 1 0
After T After T After T After T A=B
11
Serial V.s. Parallel Serial Parallel
One bit at a time Slower Cheaper Parallel All bits at a time Faster Expensive Data communication Serial, Economical Data manipulation in the system Parallel, Faster
12
Serial Addition
13
Comparison Parallel Serial Combinational Sequential N-Full Adder
Fast Serial Sequential 1-Full Adder Slow
14
Serial Adder Design
15
Serial Adder Design
16
Universal Shift register
1. A clear control to clear the register to 0. 2. A clock input to synchronize the operations. 3. A shift‐right control to enable the shift‐right operation and the serial input and output lines associated with the shift right. 4. A shift‐left control to enable the shift‐left operation and the serial input and output lines associated with the shift left. 5. A parallel‐load control to enable a parallel transfer and the n input lines associated with the parallel transfer. 6. n parallel output lines. 7. A control state that leaves the information in the register unchanged in response to the clock.
17
Universal Shift register
18
Universal Shift register
19
Universal Shift register
20
Counters A register that goes through a prescribed sequence of states upon the application of input pulses is called a counter. The input pulses Clock pulses fixed interval of time Timer Random pulses determining an event Counter A counter that follows the binary number sequence is called a binary counter . An n ‐bit binary counter consists of n flip‐flops and can count in binary from 0 through 2n - 1. Counters Ripple Counter Synchronous Counter شمارنده یک نوع رجیستر است که از ترتیب مشخصی از حالتها پیروی می کند. چرا ما به شمارنده نیازمندیم: زمانبندی: ساختن یک کلاک دقیق در فرکانسهای پایین (مثل 10 hz) توسط کریستالها امکان پذیر نیست. ترتیب: در پرتاب یک موشک: پر کردن مخزنهای سوخت، آتش کردن موتور و ... باید مطابق یک توالی دقیق باشد. شمارش: چراغهای راهنمایی، شمارش ماشینها در ترافیک، ساعت و ...
21
Ripple V.s. Synchronous Counter
Ripple counter A flip‐flop output transition serves as a source for triggering other flip‐flops. In other words, the Clock input of some or all flip‐flops are triggered, not by the common clock pulses, but rather by the transition that occurs in other flip‐flop outputs. Synchronous counter the Clock inputs of all flip‐flops receive the common clock. شمارنده های موج گونه: خروجی فلیپ فلاپها باعث کلاک خوردن دیگر فلیپ فلاپها می گردد. شمارنده های همزمان: یک کلاک مشترک به همه وصل است و فلیپ فلاپها را همزمان تریگر می کند.
22
Binary Ripple Counters
Consists of a series connection of complementing flip‐flops, with the output of each flip‐flop connected to the Clock input of the next higher order flip‐flop. Complementing flip‐flops: T-FF T = 1 JK-FF Both J and K inputs are tie together and equal to 1 D-FF Q’ feedback to D input
23
اگر مثل شکل در لبة پایین رونده بشمارند یک شمارندة بالا شمار خواهد بود
اگر مثل شکل در لبة پایین رونده بشمارند یک شمارندة بالا شمار خواهد بود. اگر FF ها در لبة بالا رونده کار کنند آنگاه Counter به یک پایین شمار تبدیل میشود.
24
BCD Ripple Counter نحوة طراحی
با آمدن هر پالسی Q1 تاگل میشود. JK برابر با یک با هر تغییر از یک به صفر Q1 ، Q2 تاگل میشود به غیر از شمارش نهایی از 1001 به 0000 پالس ساعت از Q1 و شرط تاگل شدن یک نبودن Q8 و یا یک بودن Q8’ با هز تغییر Q2 از یک به صفر Q4 تاگل میشود JK برابر با یک و پالس ساعت از Q2 با تغییر Q1 از یک به صفر به شرط یک بودن Q2 و Q4، Q8 تاگل شده و در غیر این صورت Reset میماند.
25
Counter Extension
26
Synchronous Counters Synchronous counters are different from ripple counters in that clock pulses are applied to the inputs of all flip‐flops. The decision whether a flip‐flop is to be complemented is determined from the values of the data inputs, such as T or J and K at the time of the clock edge. مشکل شمارندة موج گونه(Ripple counter) چون خروجی یک فلیپ فلاپها باعث کلاک خوردن فلیپ فلاپ بعدی می گردد، خروجی فلیپ فلاپ بعدی با کمی تاخیر نسبت به کلاک اصلی معکوس می گردد. این مساله وقتی حادتر می شود که تعداد زیادی از این فلیپ فلاپها را به هم ببندیم. ممکن است خروجی آخرین فلیپ فلاپ نسبت به کلاک یک پالس ساعت تاخیر داشته باشد که قابل قبول نیست. راه حل: استفاده از شمارنده های همزمان
27
Binary Counter The flip‐flop in the least significant position is complemented with every pulse. A flip‐flop in any other position is complemented when all the bits in the lower significant positions are equal to 1.
28
Down Counter The bit in the least significant position is complemented with each pulse. A bit in any other position is complemented if all lower significant bits are equal to 0.
29
Up-Down Counter
30
BCD Counter A BCD counter counts in binary‐coded decimal from 0000 to 1001 and back to 0000.
31
Binary Counter with Parallel Load
32
Binary Counter with Parallel Load
33
Designing BCD Counter with counter with parallel load
در قسمت b چون Clear آسنکرون است مدار را تشخیص میدهد و در نتیجه در لحظة بسیار کوچکی خروجی این مقدار خواهد شد. بسته به تاخیر گیت ها این خروجی ناخواسته در بعضی از کاربردها مطلوب نیست و باید دقت کرد. اگر مدار دارای Clear سنکرون بود مشکلی نبود و باید 1001 را تشخیص میداد.
34
Counter with Unused States
A circuit with n flip‐flops has 2n binary states. There are occasions when a sequential circuit uses fewer than this maximum possible number of states. Unused states Don’t care If circuits enter to the unused states, it is necessary to ensure that the circuit eventually goes into one of the valid states so that it can resume normal operation. The next state from an unused state can be determined from the analysis of the circuit after it is designed.
35
Example
36
111?? 011?? در این مدار شمارنده Self Correcting است. یعنی با وارد شدن به هر حالت غیر معتبری خودش را اصلاح میکند. برای مدارات دیگر نیز میتوان مدارات اضافی در نظر گرفت تا مدار را از حالت غیر معتبر به حالت معتبری منتقل کند.
37
Ring Counter Time sequence control of operations in a digital system
38
Ring Counter A ring counter is a circular shift register with only one flip‐flop being set at any particular time; all others are cleared. Initial value Using Pre-Clear and Pre-Set
39
Ring Counter Counter + Decoder
To generate 2n timing signals, we need either a shift register with 2n flip‐flops or an n ‐bit binary counter together with an n ‐to‐2n ‐line decoder.
40
Johnson Counter A k ‐bit ring counter circulates a single bit among the flip‐flops to provide k distinguishable states. The number of states can be doubled if the shift register is connected as a switch‐tail ring counter. A Johnson counter is a k ‐bit switch‐tail ring counter with 2k decoding gates to provide outputs for 2 k timing signals.
41
Johnson Counter
42
Johnson Counter Decoding gates
The all‐0’s state is decoded by taking the complement of the two extreme flip‐flop outputs. The all‐1’s state is decoded by taking the normal outputs of the two extreme flip‐flops. All other states are decoded from an adjacent 1, 0 or 0, 1 pattern in the sequence.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.