FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab...

19
Copyright (C) Computer Engineering Universität Duisburg-Essen PRACTICAL TRAINING TO THE LECTURE Experiment 3 Flip-flops, Design of a counter FCE 1 Name: Matriculation-Number: First Name: Group-Number: Tutor: Date: Prof. Dr.Ing. Axel Hunger Dipl.Ing. Joachim Zumbrägel Universität Duisburg-Essen Faculty of Engineering, Department Electrical Engineering and Information Technology Computer Engineering All questions marked with Q1 to Qn must be answered before the lab begins. All tasks marked with T1 till Tn must be completed to finish the lab.

Transcript of FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab...

Page 1: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

Copyright (C) Computer Engineering

Universität Duisburg-Essen

PRACTICAL TRAINING TO THE LECTURE

Experiment 3

Flip-flops, Design of a counter

FCE 1

Name: Matriculation-Number:

First Name: Group-Number:

Tutor: Date:

Prof. Dr.Ing. Axel Hunger Dipl.Ing. Joachim Zumbrägel Universität Duisburg-Essen

Faculty of Engineering, Department Electrical Engineering and Information Technology Computer Engineering

All questions marked with Q1 to Qn must be answered before the lab begins. All tasks marked with T1 till Tn must be completed to finish the lab.

Page 2: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

2/19

Introduction In the preceding experiments you learned how to simulate and analyze simple logical circuits. The most important functions of OrCAD Capture were introduced and applied. The acquired knowledge should now be used to understand the basics of flip-flops, digital counting and combinatorial circuits. All the logic circuits we have worked on so far are purely "combinatorial" circuits, also called switching networks. These kinds of circuits consist only of pure logic gates without feedback, what means the output signals of switching networks are always only dependent on the current input signals.

In contrast, "sequential" circuits are circuits whose output signals are no longer exclusively dependent on the input signals of the circuit, but also on the internal states of the circuit. These, in turn, depend on the "sequence" of the preceding input signals. But if we want to keep inner states, this means that we have to be able to "store" states. Memory devices fulfill this requirement.

Memory devices can be divided into the asynchronous and synchronous elements. The main difference is that asynchronous memory devices can change their state at any time, while synchronous memory devices can only change their state at specific time intervals or at specific times. Synchronous memory devices therefore have a clock line (CLK).

1. Flip-flops (FFs) Flip-flops are the most common and basic memory devices used for information storage in sequential circuits. A flip-flop can stay in one of two logical states. To change its state we need a new input signal. This makes the flip-flop a 1 bit memory device.

In case of clocked FFs, a distinction is made between the clock-state-controlled FF and the clock-edge-controlled FF. Clock-controlled FFs are also called latches and are distinguished by the fact that during the active clock phase (eg. high signal), any change in the input immediately switches to the output. On the other hand, in the case of the clock-edge-controlled FF, the output is only changed during a clock edge (ie, when switching from 0-> 1 and / or from 1-> 0).You can find all flip-flops in the 74LS.OLB and 7400.OLB libraries.

1.1 Reset Set (RS) Flip-flop Before explaining the different types of flip-flops, we will briefly discuss the RS flip-flop and explain the meaning of state control and the signals preset and clear.

A simple memory flip-flop is the RS FF (a.k.a SR FF). This device has two inputs - S for setting and R for resetting the flip-flop (hence its name). The RS flip-flop preserves its states as long as the inputs S and R are 0. If it receives a set signal, it turns to 1, regardless of its former state. A reset signal enforces a 0 state. This behavior is illustrated by the truth table below (Qn is the preceding state of Qn+1).

Page 3: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

3/19

S R Qn Qn+1 Functionality

0 0 0 Both inputs are 0, the state is preserved 0 0 1 1

0 1 0 0 The reset input is 1, the FF is set to 0 0 1 1 0

1 0 0 1 The set input is 1, the FF is set to 1 1 0 1 1

1 1 0 X Both inputs are 1, the FF’s behavior cannot be predicted 1 1 1 X

Table 1.1.1: Truth table for RS flip-flop

The most common realizations of RS FFs are based on NOR or NAND gates. Fig. 1.1.1 shows a typical NOR-gate core circuit of an RS FF and Fig. 1.1.2 shows its gate symbol. Take notice that flip-flops usually provide the complement of their state as a second output nQ .

Fig. 1.1.3 and Fig. 1.1.4 respectively, illustrate the gate circuit and gate symbol of a NAND type RS FF with clock state control.

The signals at S and R only affect the circuit when a positive level is present at the CLK input (CLK = 1). In order in order to set the FF output in a well defined state the low active inputs signal CLR (Clear) und PRE (Preset) can be used asynchronous (what means regardless of the clock signal state).

When CLR = 0, PRE = 1, so Q = 0, when CLR = 1, PRE = 0 so Q = 1. CLR and PRE = 0 has to be avoided because it leads to Q = = 1 , which is, on the one hand, illogical with regard to the names of the outputs, but can also lead to unpredictable subsequent states. With CLR = 1 and PRE = 1, the circuit operates as a clock state-controlled RS-FF.

S

R

Q

Q

Fig. 1.1.1: Core of a NOR-gate RS FF

__ Q

Q

Fig. 1.1.2

Page 4: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

4/19

S

R

Q

Q

CLK

___ CLR

____PRE

Fig. 1.1.4

1.2 Delay (D) Flip-flop The RS FF presented in the previous section has a serious disadvantage. For an RS FF one input combination is not allowed. The JK FF is a modified RS FF (J corresponds to the set and K to the reset input), which inverts its state when the input J = 1 and K = 1 occurs. Since it has no forbidden input combinations, the JK FF can be easily used to generate other types of flip-flops. Table 1.2.1 compares the four most common types of flip-flops. The CLR X in the truth table means that you have to prevent input states for J and K, which lead to an indeterminate state of Qn+1.

Inputs Qn Qn+1

J K JK-FF RS-FF D-FF T-FF

0 0 0 0 0 X 0

0 0 1 1 1 X 1

0 1 0 0 0 0 X

0 1 1 0 0 0 X

1 0 0 1 1 1 X

1 0 1 1 1 1 X

1 1 0 1 X X 1

1 1 1 0 X X 0

Table 1.2.1

Fig. 1.1.3: clock-state-controlled RS FF with pre-set and clear

___ PRE

___ CLR

__ Q

Q

Page 5: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

5/19

The characteristic equations for the JK FF is nQJnQKnQ ⋅+⋅=+1 . We can derive from the

truth table (Table 1.2.1) the equations and inputs of other flip-flop types, which can be construct from JK FF.

1.3 Delay (D) Flip-flop As the name implies the purpose of a D FF is to temporary store (or delay) a single bit. A signal of 0 or 1 present at the input D is transferred to the output Q whenever the clock CLK is set to 1. Fig. 1.3.1 shows the gate symbol of a D flip-flop. If we look closely at the truth table (Table 1.2.1) again we will see that it is quite simple to construct a D FF out of a JK FF. A delay flip-flop uses only the situations where the J and K inputs are different. This would make a D FF truth table only 2 lines. So how can we get rid of the other two lines in a JK FF truth table? We make sure they do not occur by connecting a NOT gate between the inputs J and K, as shown in Fig. 1.3.2. This way J and K will always be different.

As the construct in Fig. 1.3.2 implies, the equation for a D FF built from JK FF would be:

KJD == 1.4 Trigger (T) Flip-flop If we take a look at our truth table (Table 1.2.1) again, we will see that a trigger flip-flop is just a JK FF in disguise. Fig. 1.4.1 shows the gate symbol of a T FF built from a JK FF merely by connecting its J and K terminals together.

J Q

Q

CLK

K

D

Fig. 1.3.2

D Q

Q

CLK

Fig. 1.3.1

Page 6: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

6/19

The characteristic equations for the T FF can be

obtained form the truth table: QTn

Qn

⊕=+1

. For a T FF to be built from a JK FF: T = J = K, if T = 1 the output Q

nQ

n=

+1 , meaning that it will toggle between 0 and 1 with every clock impulse. One of the T FF properties is that its output signal runs at half the frequency of the input.

Q1: Fig. 1.1 illustrates two flip-flops. Which flip-flop functions as a D FF and why?

Fig. 1.1

Q2: Which state is forbidden for RS FF?

Q3: Which input signals would reset and set an RS FF?

J Q

Q

CLK

K

T

Fig. 1.4.1

Page 7: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

7/19

Q4: Some flip-flops have additional inputs, such as clear and pre-set. What function do these inputs serve?

Q5: What is the characteristic equation of a D flip-flop?

2. Registers A register is a circuit that can store whole data words. It is constructed by connecting several flip-flops; hence an n-bit register consists of at least n flip-flops. The following example shown in Fig. 2.1 illustrates a 4-bit shift register built with D flip-flops.

Fig. 2.1

Q6: Define a series of input impulses “D” to store the pattern (D3 D2 D1 D0) = (1010) into the 4-bit register illustrated in Fig. 2.1.

Page 8: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

8/19

Q7: Give two examples of where a register can be applied.

Q8: How would you modify the circuit in Fig. 2.1 in order to turn it into a ring-register? Explain your answer and add your modifications to the figure.

3. Designing a counter Before we knew flip-flops we could only design combinatorial circuits. The output of a combinational circuit depends on the current input signal only. If nX are the inputs of such circuit at cycle n, the characteristic equation is of the type:

)( nn XfQ =

The output of a circuit containing flip-flops depends not only on the current input, but on the previous inputs as well, making it a sequential circuit. Therefore, the according characteristic equation must match:

),( 1−= nnn QXfQ

One of the most typical applications for sequential circuits is counters. In this part of the experiment we want to design a counter that has no inputs apart from the clock pulse. Therefore, the circuit’s state will depend only on the preceding state:

)( 1−= nn QfQ

3.1 5-3-2-1 code counter We want to design a counter that counts the sequence 0,1…,9 (decimal) automatically, thus it has to be:

• Counting up - The value of the current input cycle is higher than the preceding one. If the actual output is 9 the counter should restart to 0

• Auto-run - The counter starts automatically when powered on

• Synchronous - All FFs in the counter are triggered by the same clock pulse

The numbers are to be coded in a 5-3-2-1 binary code. We use four JK flip-flops, each one representing one digit of the binary code according to the truth table below (Table 3.1.1).

Page 9: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

9/19

Decimal Value of the Bit 5 3 2 1

Decimal numbers (Counter state)

Q4 Q3 Q2 Q1

0 0 0 0 0

1 0 0 0 1

2 0 0 1 0

3 0 1 0 0

4 0 1 0 1

5 1 0 0 0

6 1 0 0 1

7 1 0 1 0

8 1 1 0 0

9 1 1 0 1

Table 3.1.1

A 5-3-2-1 code is just another 4-bit binary code, but with different decimal values assigned to each bit.

Example:

Decimal number: 7

4-bit binary code: 0111 = 0·23 + 1·22 + 1·21 + 1·20 = 7

4-bit 5-3-2-1 code: 1010 = 1·5 + 0·3 + 1·2 + 0·1 = 7

3.2 Designing the counter circuit To design a counter out of 4 flip-flops we have to find out how we should connect them to one

another, so that they match the truth table (Table 3.1.1). Therefore, for the output 1+naQ of a

flip-flop we search the equation:

),,,(1 ndQn

cQnbQn

aQfnaQ =+

Page 10: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

10/19

As the JK flip-flop’s behavior is described by

naQJ

naQK

naQ ⋅+⋅=+ 1

we have to find by comparison the equations for the inputs J and K for every flip-flop:

),,( dcba QQQfJ = ),,( dcba QQQfK =

For this task we set up a KV-diagram representing the formerly given truth table (Table 3.1.1).

Q9: Complete the KV-diagram of the 5-3-2-1 code:

Fig. 3.2.1: KV-diagram of a 5-3-2-1 code

For every flip-flop we follow the steps:

1. List all counter states nZ for which the following state 1nZ + contains 11 =+naQ for the

corresponding flip-flop.

2. Read the simplified functions 1 ( , , , )na

n n n nQ f Q Q Q Qa cb d+ = from the KV-Diagram in Q9.

3. Deduce the equations for Ja and Ka by comparing the function of 1+naQ with the flip-

flop’s characteristic equation.

Q2

Q4

Q3

Q1 X

8 3

2 7

Page 11: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

11/19

As an example we will derive the equations for J3 and K3:

1. 31nQ +

= 1 occurs for the counter states ( 1nZ + ) 3, 4, 8 and 9. Thus, 31nQ +

must be set, for the preceding counter states ( nZ ) 2, 3, 7 and 8.

2. From the truth table we can read the disjunctive normal form expression of 13+nQ for

the counter states 2, 3, 7 and 8 or we could directly deduce the simplified expression for 1

3+nQ from the KV-diagram in question Q9 as:

nnnnnnn QQQQQQQ 3213211

3 ⋅⋅+⋅⋅=+

3. Comparing the equation from step 2 with the characteristic equation of a JK-FF for 1

333nn nQ K Q J Q+ = + ⋅ , we find the equations for J3 and K3:

3 1 2 3 1 2 3 1 2 and , thus n n n n n nJ Q Q K Q Q K Q Q= ⋅ = ⋅ = +

Be aware that when looking for a simplified expression for 1+naQ we have to find one that

contains naQ to be able to compare coefficients!

Following this principle the equations for J1, K1 and J2, K2 are:

Q10: Find the functions for the inputs J4, K4 of the fourth flip-flop. Do not make use of the “Don’t care” states!

Q11: Is it possible to simplify the expressions for J and K even further? If yes, how?

12+nQ = 321 QQQ ⋅⋅ (follows if we consider the previous states 1,6)

J2 = 31 QQ ⋅

K2 = 10 22 =⇒= KK

211

1 QQQ n ⋅=+ (follows if we consider the previous states 0,3,5,8)

J1 = 2Q

K1 = 10 11 =⇒= KK

14+nQ =

J4 =

K4 =

Page 12: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

12/19

Q12: Complete the circuit in Fig. 3.2.2 using the equations for K3 , J4 und K4.

Fig. 3.2.2: 5-3-2-1 Counter

Q13: What is the difference between a synchronous and asynchronous counter? Which type of counter is the circuit in Fig. 3.2.2? Explain your answer.

Page 13: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

13/19

4. Controlling a 7-segment display To see whether our 5-3-2-1 counter is working correctly we connect it to a 7-segment display. This display is composed of an array of 7 LEDs (Light Emitting Diodes) as illustrated in Fig. 4.1. Now we should design a controller that connects the outputs of the counter to the 7-segment display in such a way that the actual numbers are displayed. A segment is on when it is triggered with a logical 0. An unrecognized input (a signal representing none of the numbers from 0 to 9) should cause the controller to turn all segments on.

Q14: Complete the truth table shown below:

Number Q4 Q3 Q2 Q1 S7 S6 S5 S4 S3 S2 S1

0 0 0 0 0 0 0 0 1 0 0 0

1 0 0 0 1 1 0 1 1 0 1

2 0 0 1 0 0 1 0 1 0 0

3 0 1 0 0 1 0 0 1 0 0

4 0 1 0 1 1 0 0 0 0 1

5 1 0 0 0 1 0 0 0 1 0

6 1 0 0 1 0 0 0 0 1 1

7 1 0 1 0 1 0 1 1 0 0

8 1 1 0 0 0 0 0 0 0 0

9 1 1 0 1 1 0 0 0 0 0 Table 4.1: Truth table for the 7-segment-display controller

S1

S4

S7

S2 S5 S6

S3

S1

S4

S7

S2

S5 S

6 S

3 S1

S4

S7

S2

S5 S

6 S

3

S1

S4

S7

S2

S5 S

6 S

3

S1

S4

S7

S2

S5 S

6 S

3

S1

S4

S7

S2

S5 S

6 S

3

S1

S4

S7

S2

S5 S6

S

3

S1

S4

S7

S2

S5 S6

S

3

S1

S4

S7

S2

S5 S6

S

3

S1

S4

S7

S2

S5 S6

S

3

S1

S4

S7

S2

S5 S6

S

3

Fig. 4.1

Page 14: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

14/19

From the truth table we get the equations for S1,...,S6 in disjunctive normal form:

S1= )()()( 432143214321 QQQQQQQQQQQQ ++ S2= )()( 43214321 QQQQQQQQ + S3= 1 2 3 2 42 3 4 1 3 4 1 2 4 1 3( ) ( ) ( ) ( )Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q+ + + S4= )()()( 432143214321 QQQQQQQQQQQQ ++ S5= )( 4321 QQQQ S6= )()()()()()( 432143214321432143214321 QQQQQQQQQQQQQQQQQQQQQQQQ +++++

Q15: Write down the disjunctive normal form for S7. S7=_________________________________________________________________

Simplifying the functions for S1,...,S6 (with KV-Diagramms and boolean Algebra) leads to:

S1= )()()( 4321321421 QQQQQQQQQQ +=+ S2= )( 432 QQQ S3= 1 3 2 1 3 22 3 4 1 2 4 1 3 2 4 1 3( ) ( )Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q+ + = ⊕ + S4= 2 42 3 4 1 3( ) ( )Q Q Q Q Q Q Q+ S5= )( 4321 QQQQ S6= 1 3 1 3 4 1 3 1 3 42 4 2 4 2 1 3 2 4 2 1 3( )Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q+ + + = + + +

Q16: Simplify the functions for S7 from Q15 with the help of KV-diagrams and write down the simplified equation. S7=_________________________________________________________________

Q17: Complete the circuit for the display controller (see next page)!

Page 15: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

15/19

Fig. 4.2

Fig. 4.2

Page 16: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

16/19

5. Introduction to hierarchical blocks When we design more complex circuits with lots of elements we often come across the same problems: keeping track of the circuit connections becomes impossible; we often have to keep re-making the same sections of circuits which are used several times.

To aid us in our work, OrCAD offers the generation of hierarchical circuit blocks. Hierarchical blocks refer to circuits grouped together, which are defined as a part to place in the Schematic Page Window. These hierarchical blocks can carry different circuit designs between schematic folders as long as they are in the same design.

5.1 Placing hierarchical ports You place hierarchical ports on the schematic page where the circuit you plan on grouping as a hierarchical block is. Then you name the ports so that they connect to like-named hierarchical pins inside the hierarchical block. Ports are usually setup for the inputs and outputs of a particular circuit.

To place a hierarchical port, navigate to Place → Hierarchical Port, after which the Place Hierarchical Port dialog box should appear.

Select the Capsym.olb library. In the list of parts select the type of the hierarchical port you require and type in the name for the port. The name is added to the attached net, and is used to determine which like-named hierarchical pins the port connects to. When you have specified the characteristics of the hierarchical port, click OK. You can now place and connect the hierarchical port anywhere on the schematic page like an ordinary part.

5.2 Placing Hierarchical blocks Hierarchical blocks represent child schematic folders and when you create a hierarchical block, you specify the name of the child schematic page that the hierarchical block represents.

To place a hierarchical block, after you have designed your circuit and placed the ports, choose Place → Hierarchical Block from the editor’s menu or choose the hierarchical block tool from the tool palette. The Place Hierarchical Block dialog box should appear as illustrated in Fig. 5.2.1.

In the Reference text box, type the name of the schematic page you want your hierarchical block to refer to. Accept the Primitive setting as Default and specify the type of implementation, pointing out what exactly you want to implement with this hierarchical block. In our practice we will deal with schematics, so for Implementation Type choose Schematic View.

The Implementation name field is now active. In it write the name of the schematic folder, which contains the schematic page you specified in the Reference field.

Fig. 5.2.1: Place Hierarchical Block

Page 17: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

17/19

Click OK to close the Place Hierarchical Block dialog box. Now you can draw the hierarchical block using the mouse by pressing the left button and dragging the mouse to draw a rectangle. If you have entered the names of the schematic page and folder correctly then your block should appear with already set-up pins and pin names.

6. Design and simulation of the counter and display controller

6.1 Implementing the sequential circuit

T1: Create a new Analog or Mixed A/D project named Lab2. Rename SCEMATIC1 to Lab2 and PAGE1 to Lab2Circuit. This will be your complete circuit schematic page and folder.

T2: Create a new schematic folder and name it Counter. In it create a new schematic page named CounterCircuit. Create the circuit you drew in question Q12 (Fig. 3.2.2) in the CounterCircuit schematic page and place, and name ports at the inputs and outputs.

T3: Create a hierarchical block in the Lab2Circuit schematic page, which refers to your counter circuit.

T4: Create and run a simulation of the hierarchical block counter with an appropriate input to test its functionality.

6.2 Implementing the combinatory circuit

T5: Create a new schematic folder named Controller and a new schematic page in it, named ControllerCircuit.

T6: Design the 7-segment-display controller from Q17 (Fig. 4.2) in the ControllerCircuit schematic page and place, and name ports at the inputs and outputs.

T7: Create a hierarchical block in the Lab2Circuit schematic page, which refers to your controller circuit. Connect the controller hierarchical block to the counter one.

Page 18: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

18/19

6.3 Simulating the complete circuit Fig. 6.3.1 shows how individual components are connected to realize the complete circuit.

Fig. 6.3.1: Complete circuit

T8: Create and run a simulation with an appropriate input to test the functionality of both blocks.

Page 19: FCE 1 - ti.uni-due.deti.uni-due.de/ti/en/education/teaching/ws1617/fce1/lab/LAB3_En.pdfFCE1 Lab Experiment 3: Flip-flops, Design of a counter 2/19 Introduction In the preceding experiments

FCE1 Lab Experiment 3: Flip-flops, Design of a counter

19/19

Digital Components

Symbol-Name Type-Number Library

NOT 7404 7400

AND 2-Input 7408 7400

AND 3-Input 7411 7400

NAND 2-Input 7400 7400

NAND 3-Input 7410 7400

NAND 4-Input 7420 7400

OR 2-Input 7432 7400

NOR 2-Input 7402 7400

NOR 3-Input 7427 7400

XOR 7486 7400

JK-FF with CLR 7473 7400

JK-FF with PRE/CLR 7476 7400

JK-FF with CLR 74107 7400

JK-FF with PRE/CLR 74109 7400

D-FF with PRE/CLR 7474 7400

D-FF 7474 7400

D-TYPE REGISTER 74LS173A 74ls

REGISTER FILE O.C. 74170 7400

PRESETTABLE BINARY COUNTER 74LS197 74ls

BINARY COUNTER

7493A 74293 74177

7400