מבנה מחשב תרגול 2 מונים. counters תירגול 2 - מבנה מחשב3 edge...

Post on 23-Dec-2015

219 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

מבנה מחשב

2תרגול מונים

Counters

תירגול 2 - מבנה מחשב 3

Edge Triggering Important Issue:

The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable since they are “toggle” operations.

From now all FFs are assumed down edge-triggered: Values are changed not when the clock is up, but at the exact moment the clock goes down – notice the circle notation

Edge Triggering mechanism can be seen in the lecture.

תירגול 2 - מבנה מחשב 4

New Approach To Flip-Flops (1) Formerly, we presented each flip-flop’s

Truth Table, i.e. the output as a function of former state (former output) and the inputs.

000

011

101

110

T 1tQtQ

Former State Input Output

T Flip-FlopExample

תירגול 2 - מבנה מחשב 5

New Approach To Flip-Flops (2) A new Approach: For each former output

and desired output combination, what inputs do we need to transform from current to desired?

This approach is more useful when creating counters.

תירגול 2 - מבנה מחשב 6

New Approach To Flip-Flops (3)

תירגול 2 - מבנה מחשב 7

Flip-Flop Concatenation T Flip-Flop has an interesting Attribute:

T Q T Q1 1

CP

10

10

10

(In red, is the clock down-edge)

תירגול 2 - מבנה מחשב 8

Flip-Flop Concatenation (2) But doesn’t that resemble counting in

binary?000

001

010

011

100

101

110

111

0A1A2A

תירגול 2 - מבנה מחשב 9

Asynchronic Counter So we can use this attribute to create a

simple n-digit binary counter. (shown here with the equivalent 1-1 state JK

Flip-Flop)

תירגול 2 - מבנה מחשב 10

BCD Counter Can we count in a radix which is not ? Yes, we can even create a binary-coded

decimal (BCD) Counter:

n2

תירגול 2 - מבנה מחשב 11

BCD Counter (2) To create it we used the diagram:

תירגול 2 - מבנה מחשב 12

BCD Counter Concatenation If we can count to 10 (exclusive) we can

count to 100, 1000 and so on…

תירגול 2 - מבנה מחשב 13

BCD Counter Two problems:

Developing a custom-made, efficient, asynchronic counter, such as the BCD counter is difficult!

What if we want to create a non-consecutive counter easily?

תירגול 2 - מבנה מחשב 14

Counting Sequence A cyclic sequence of binary numbers. For instance: 0,1,2,4,5,6,0,1,2,4,…

תירגול 2 - מבנה מחשב 15

Synchronic Counter We want to implement a mechanism for

counting in a given counting sequence. We’ll focus independently on each digit

and the changes it undergoes.

תירגול 2 - מבנה מחשב 16

Building A Sync. Counter Algorithm:

Choose a Flip-Flop type to use. To each digit (column), allocate a Flip-flop. For each digit (column) create a truth table in the

following manner: For each state (line) do:

Mark state in current line as Mark state in next line as Determine the desired FF’s inputs by the tables. Those inputs

are actually function results in the truth table. Simplify the truth table and implement the function

)(tQ

)1( tQ

תירגול 2 - מבנה מחשב 17

3-Bit Sync. Counter using T Flip-Flops (2)

תירגול 2 - מבנה מחשב 18

3-Bit Sync. Counter using T Flip-Flops (1)

תירגול 2 - מבנה מחשב 19

3-Bit Sync. Counter using T Flip-Flops (3)

תירגול 2 - מבנה מחשב 20

3-Bit Sync. Counter using T Flip-Flops (3)

תירגול 2 - מבנה מחשב 21

3-Bit Sync. Counter using T Flip-Flops (4)

תירגול 2 - מבנה מחשב 22

Example using JK Flip-Flops (2) Shown for the 0,1,2,4,5,6,0,1,2,4,5,6,… example

We’ll do C as an example.

תירגול 2 - מבנה מחשב 23

Example using JK Flip-Flops (1)

תירגול 2 - מבנה מחשב 24

Example using JK Flip-Flops (3) JC:

KC:

1XX0

1XX0

0

1

00 01 11 10ABC

X1XX

X1XX

0

1

00 01 11 10ABC

BJC

1KC

תירגול 2 - מבנה מחשב 25

Example using JK Flip-Flops (4)

top related