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

25
בבבב בבבב בבבבב2 בבבבב

Transcript of מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge...

Page 1: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

מבנה מחשב

2תרגול מונים

Page 2: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

Counters

Page 3: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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.

Page 4: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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

Page 5: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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.

Page 6: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

New Approach To Flip-Flops (3)

Page 7: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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)

Page 8: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

binary?000

001

010

011

100

101

110

111

0A1A2A

Page 9: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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)

Page 10: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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

Page 11: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

Page 12: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

count to 100, 1000 and so on…

Page 13: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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?

Page 14: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

Page 15: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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.

Page 16: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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

Page 17: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

Page 18: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

Page 19: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

Page 20: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

Page 21: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

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

Page 22: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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.

Page 23: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

Example using JK Flip-Flops (1)

Page 24: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

תירגול 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

Page 25: מבנה מחשב תרגול 2 מונים. Counters תירגול 2 - מבנה מחשב3 Edge Triggering Important Issue: The T Flip-Flop and the JK Flip-Flop 1-1 option are not stable.

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

Example using JK Flip-Flops (4)