You are on page 1of 40

14/02/2023

ITC
Introduction to Computers (II)
ICE Group
Lesson 6: Memorization elements
Couse 2022-2023

Engineering Introduction to Computers Lesson 6 Pag. 1

Introduction

Engineering Introduction to Computers Lesson 6 Pag. 2

1
14/02/2023

Lesson 6: Memorization elements


Introduction Output variables only depend on the 
values of the different input variables 
Combinational
system all of the time  they do not have 
memory.

Combinational Systems
(Semester 1)
Digital
systems
SYNCHRONOUS
Sequential Systems
(Semester 2)
ASINCHRONOUS

the outputs are dependent on not only 
Sequential their current inputs (as in combinational 
system circuits), but also on all their past inputs 
they contain memory elements.
Engineering Introduction to Computers Lesson 6 Pag. 3

Lesson 6: Memorization elements


Introduction
The memorization is done by connecting the output of a logic gate back to the input of 
that same gate  feedback loop circuit.

Feedback loop

Combinational Sequential
Systems  Systems 

How can we build a circuit capable of memorizing one bit of information? 

IDEA: Using two inverters connected so the 
output of the first inverter is the input of the 
second one.

Engineering Introduction to Computers Lesson 6 Pag. 4

2
14/02/2023

Classification of
sequential systems

Engineering Introduction to Computers Lesson 6 Pag. 5

Lesson 6: Classification of sequential systems


Basic concepts
SÍNCRONOS

The output depends on a 
synchronization signal.

ASÍNCRONOS

The output is not dependent on a 
synchronization signal.

In the case of synchronous digital systems, the signal that time (or synchronize) its 
evolution is called clock. 

‘1’ logic
‘0’ logic
Oscillators
SÍNCRONOS
CLOCK signal

Engineering Introduction to Computers Lesson 6 Pag. 6

3
14/02/2023

Lesson 6: Classification of sequential systems


Basic concepts
The clock signals have two differentiated levels:
High: 5 volts = “1” logic.
Low: 0 volts = “0” logic. 

The synchronism is often named clock (T). It is only a periodic signal that toggles its value, 
so its frequency determines the frequency of the digital system :
Rising edge (positive edge): low‐to‐high transition.
Falling edge (negative edge): high‐to‐low transition. 

Memory elements in digital systems:
A one bit of memory  BISTABLES
A group of bistables (group of bits) REGISTERS
A group of registers (data)  MEMORIES

Engineering Introduction to Computers Lesson 6 Pag. 7

Lesson 6: Classification of sequential systems System

Basic concepts
Example 1‐ ASINCHRONOUS: Let us assume a non‐synchronous sequential system with 
two inputs A and B, and a single output Z. All these variables are initially equal to zero. 
Let us suppose the following operation:
The variable Z is set to one when A and B are set to one. 
The variable Z is set to zero when A and B are set to zero.
For both cases, if only one variable change, Z keeps whatever value it had. 
Assuming the following inputs A and B and since the sequential system is asynchronous, 
the timing diagram of Z would be : 

Engineering Introduction to Computers Lesson 6 Pag. 8

4
14/02/2023

Lesson 6: Classification of sequential systems System

Basic concepts
Example 1‐ ASINCHRONOUS: Let us assume a non‐synchronous sequential system with 
two inputs A and B, and a single output Z. All these variables are initially equal to zero. 
Let us suppose the following operation:
The variable Z is set to one when A and B are set to one. 
The variable Z is set to zero when A and B are set to zero.
For both cases, if only one variable change, Z keeps whatever value it had. 
Assuming the following inputs A and B and since the sequential system is asynchronous, 
the timing diagram of Z would be : 

Engineering Introduction to Computers Lesson 6 Pag. 9

Lesson 6: Classification of sequential systems System

Basic concepts
Example 2‐ SINCHRONOUS: Let us assume a synchronous sequential system with two 
inputs A and B, and a single output Z. All these variables are initially equal to zero. 
Let us suppose the following operation:
The variable Z is set to one when A and B are set to one. 
The variable Z is set to zero when A and B are set to zero.
For both cases, if only one variable change, Z keeps whatever value it had. 
Assuming the following inputs A and B and since the sequential system is synchronous, 
the timing diagram of Z would be : 

Engineering Introduction to Computers Lesson 6 Pag. 10

5
14/02/2023

Lesson 6: Classification of sequential systems System

Basic concepts
Example 2‐ SINCHRONOUS: Let us assume a synchronous sequential system with two 
inputs A and B, and a single output Z. All these variables are initially equal to zero. 
Let us suppose the following operation:
The variable Z is set to one when A and B are set to one. 
The variable Z is set to zero when A and B are set to zero.
For both cases, if only one variable change, Z keeps whatever value it had. 
Assuming the following inputs A and B and since the sequential system is synchronous, 
the timing diagram of Z would be : 

Engineering Introduction to Computers Lesson 6 Pag. 11

Lesson 6: Classification of sequential systems System

Basic concepts
Example 2‐ SINCHRONOUS: Let us assume a synchronous sequential system with two 
inputs A and B, and a single output Z. All these variables are initially equal to zero. 
Let us suppose the following operation:
The variable Z is set to one when A and B are set to one. 
The variable Z is set to zero when A and B are set to zero.
For both cases, if only one variable change, Z keeps whatever value it had. 
Assuming the following inputs A and B and since the sequential system is synchronous, 
the timing diagram of Z would be : 

Engineering Introduction to Computers Lesson 6 Pag. 12

6
14/02/2023

Lesson 6: Memorization elements


BISTABLES

Memory  elements in digital systems:
A one bit of memory  BISTABLES
A group of bistables (group of bits) REGISTERS
A group of registers (data)  MEMORIES

Within the group of bistables, there are different classes:
SR bistable (bistable asynchronous  latch).
D flip‐flop (bistable synchronous  flip‐flop).
JK bistable (bistable synchronous). (Not covered)
D‐SR bistable (synchronous with asynchronous combination).

Engineering Introduction to Computers Lesson 6 Pag. 13

Lesson 6: Memorization elements


BISTABLES
D‐SR bistable
SR bistable D bistable (Synchronous /
(Asynchronous) (Synchronous) Asynchronous)

SR D D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 14

7
14/02/2023

SR bistable

Engineering Introduction to Computers Lesson 6 Pag. 15

Lesson 6: SR Bistable
SR bistable (Asynchronous)
Inputs:
 It has two inputs that allow you to control the value 
to be memorized. These inputs are called Set (S) 
and Reset (R). 
 It  works by level.
Outputs:
 It has two outputs Q y     in which a binary value is 
Q
memorized according to the asynchronous inputs S
y R (level sensitive). 

If RESET/SET is NOT activated  the previous value is maintained


If RESET is activated  Q = 0 (if SET = 0)
If SET is activated  Q =1 (if RESET = 0)
If RESET/SET are activated (forbidden) undetermined

Engineering Introduction to Computers Lesson 6 Pag. 16

8
14/02/2023

Lesson 6: SR Bistable
SR bistable (Asynchronous)
Truth table: SR circuit:

Timing diagram

Engineering Introduction to Computers Lesson 6 Pag. 17

Lesson 6: SR Bistable
SR bistable (Asynchronous)
Truth table: SR circuit:

Timing diagram

Engineering Introduction to Computers Lesson 6 Pag. 18

9
14/02/2023

Lesson 6: SR Bistable
SR bistable (Asynchronous) (negative logic)
Truth table SR Circuit

SR
bistable

Timing diagram

Engineering Introduction to Computers Lesson 6 Pag. 20

Lesson 6: SR Bistable
SR bistable (Asynchronous)
Class exercise

Engineering Introduction to Computers Lesson 6 Pag. 21

10
14/02/2023

Lesson 6: SR Bistable
SR bistable (Asynchronous)
Class exercise (Solution)

Engineering Introduction to Computers Lesson 6 Pag. 22

D bistable

Engineering Introduction to Computers Lesson 6 Pag. 23

11
14/02/2023

Lesson 6: D Bistable
D bistable (Synchronous)
Technical features:
 It is a synchronous bistable. That means, the output is 
updated according to an input named trigger (clock).
 It works by edge detection.
 For this case, every time there is a rising edge, the value 
of input D is passed to output Q.

Truth table:

without

Engineering Introduction to Computers Lesson 6 Pag. 24

Lesson 6: D Bistable
D bistable (Synchronous)
Special case:
 What happens when the rising edge of the clock signal 
coincides with the falling edge of the D signal?
 Don’t panic!! The clock is considered to be always faster, 
so at the output we have Dt‐1.

Engineering Introduction to Computers Lesson 6 Pag. 25

12
14/02/2023

Lesson 6: D Bistable
D bistable (Synchronous)
D Circuit:

Although the external appearance 
looks like an RS bistable, the internal 
implementation is more complex. 

Engineering Introduction to Computers Lesson 6 Pag. 26

Lesson 6: D Bistable
D bistable (Synchronous) (negative logic)
Truth table:

D
bistable
without

Engineering Introduction to Computers Lesson 6 Pag. 27

13
14/02/2023

Lesson 6: D Bistable
D bistable (Synchronous)
Class exercise

Engineering Introduction to Computers Lesson 6 Pag. 28

Lesson 6: D Bistable
D bistable (Synchronous)
Class exercise (solution)

Engineering Introduction to Computers Lesson 6 Pag. 29

14
14/02/2023

D-SR bistable

Engineering Introduction to Computers Lesson 6 Pag. 30

Lesson 6: D-SR Bistable


D‐SR Synchronous/Asynchronous
Technical features:
 It combines the edge‐detecting properties of a D bistable 
with the level‐operating properties of a SR bistable.
 Therefore, its response is synchronous and 
asynchronous depending on which inputs are activated.
 Shows the typical outputs Q and Q

Inputs:
 R, if it is activated  the output Q is zero.
 S, if it is activated  the output Q is one.
 D, it is the value which update Q when a rising edge is produced in T.
 T or synchronism signal (clock).

Engineering Introduction to Computers Lesson 6 Pag. 31

15
14/02/2023

Lesson 6: D-SR Bistable


D‐SR Synchronous/Asynchronous
Technical features:
 It combines the edge‐detecting properties of a D bistable 
with the level‐operating properties of a SR bistable.
 Therefore, its response is synchronous and 
asynchronous depending on which inputs are activated.
 Shows the typical outputs Q and Q
IMPORTANT: the inputs S and R
Inputs: have priority over T (clock) and D
 R, if it is activated  the output Q is zero.
 S, if it is activated  the output Q is one.
 D, it is the value which update Q when a rising edge is produced in T.
 T or synchronism signal.

Engineering Introduction to Computers Lesson 6 Pag. 32

Lesson 6: D-SR Bistable


D‐SR Synchronous/Asynchronous
D‐SR circuit:

The complexity is higher since it 
is necessary to add a pair of 
NAND gates on the internal S‐R 
signals.

Engineering Introduction to Computers Lesson 6 Pag. 33

16
14/02/2023

Lesson 6: D-SR Bistable


D‐SR Synchronous/Asynchronous
Truth table:

without

Remember that the 
inputs S and R have 
priority over T (clock) 
and D. 

Engineering Introduction to Computers Lesson 6 Pag. 34

Lesson 6: Memorization elements


Exercise 1: Bistable outputs
Draw the value of the output signal Q 
(mark the timing diagram well). (eStudy PDFs)

Engineering Introduction to Computers Lesson 6 Pag. 35

17
14/02/2023

Lesson 6: Memorization elements


EXERCISE 1: Bistable outputs (solution)
Draw the value of the output signal Q 
(mark the timing diagram well).

Engineering Introduction to Computers Lesson 6 Pag. 36

Design of circuits
with multiple
bistables

Engineering Introduction to Computers Lesson 6 Pag. 37

18
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 1: timing diagram analysis for Q1, Q2 and Q3

D‐SR SR D‐SR
bistable bistable bistable

Steps:
 Analyse the influence of external signals (in this case R and T)
 See how those changes affect the outputs of each bistable

Engineering Introduction to Computers Lesson 6 Pag. 38

Lesson 6: Design of circuits with multiple bistables

Example 1: timing diagram analysis for Q1, Q2 and Q3

D‐SR SR D‐SR
bistable bistable bistable

Steps:
 Analyse the influence of external signals (in this case R and T)
 See how those changes affect the outputs of each bistable

Engineering Introduction to Computers Lesson 6 Pag. 39

19
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 1: timing diagram analysis for Q1, Q2 and Q3

D‐SR SR D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 40

Lesson 6: Design of circuits with multiple bistables

Example 1: timing diagram analysis for Q1, Q2 and Q3

D‐SR SR D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 41

20
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 1: timing diagram analysis for Q1, Q2 and Q3

D‐SR SR D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 42

Lesson 6: Design of circuits with multiple bistables

Example 1: timing diagram analysis for Q1, Q2 and Q3

D‐SR SR D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 43

21
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 1: timing diagram analysis for Q1, Q2 and Q3

D‐SR SR D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 44

Lesson 6: Design of circuits with multiple bistables

Synchronous and Asynchronous 

D‐SR SR D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 45

22
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Synchronous and Asynchronous 

D‐SR SR D‐SR
bistable bistable bistable

Engineering Introduction to Computers Lesson 6 Pag. 46

Lesson 6: Design of circuits with multiple bistables

Example 2: draw the signal A 

We have to take into account the 
signal T (clock) and the feedback D. D‐SR
bistable

A t

Engineering Introduction to Computers Lesson 6 Pag. 47

23
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 2: draw the signal A 

We have to take into account the 
signal T (clock) and the feedback D. D‐SR
bistable

Engineering Introduction to Computers Lesson 6 Pag. 48

Lesson 6: Design of circuits with multiple bistables

Example 2: draw the signal A 

We have to take into account the 
signal T (clock) and the feedback D. D‐SR
bistable

This produces a change in the output

Engineering Introduction to Computers Lesson 6 Pag. 49

24
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 3: analysis A, B and C  
The most important 
characteristics must be evaluated 
first and then the evolution of 
outputs A, B and C.

IMPORTANT: take into account the 
negative logic.

Engineering Introduction to Computers Lesson 6 Pag. 50

Lesson 6: Design of circuits with multiple bistables

Example 3: analysis A, B and C  

Engineering Introduction to Computers Lesson 6 Pag. 51

25
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 3: analysis A, B and C  

A t

B t

C t

Engineering Introduction to Computers Lesson 6 Pag. 52

Lesson 6: Design of circuits with multiple bistables

Example 3: analysis A, B and C  
This produces a change in the 
output

Engineering Introduction to Computers Lesson 6 Pag. 53

26
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 3: analysis A, B and C  
This produces a change in the 
output

Engineering Introduction to Computers Lesson 6 Pag. 54

Lesson 6: Design of circuits with multiple bistables

Example 3: analysis A, B and C  
This produces a change in the 
output

Engineering Introduction to Computers Lesson 6 Pag. 55

27
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 4: analysis Y1, Y2, Y3 and Y4

Engineering Introduction to Computers Lesson 6 Pag. 56

Lesson 6: Design of circuits with multiple bistables

Example 4: analysis Y1, Y2, Y3
and Y4

Engineering Introduction to Computers Lesson 6 Pag. 57

28
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 4: analysis Y1, Y2, Y3
and Y4

Engineering Introduction to Computers Lesson 6 Pag. 58

Lesson 6: Design of circuits with multiple bistables

Example 4: analysis Y1, Y2, Y3
and Y4

Engineering Introduction to Computers Lesson 6 Pag. 59

29
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 4: analysis Y1, Y2, Y3
and Y4

Engineering Introduction to Computers Lesson 6 Pag. 60

Lesson 6: Design of circuits with multiple bistables

Example 4: analysis Y1, Y2, Y3
and Y4

Engineering Introduction to Computers Lesson 6 Pag. 61

30
14/02/2023

Lesson 6: Design of circuits with multiple bistables

Example 4: analysis Y1, Y2, Y3
and Y4

Engineering Introduction to Computers Lesson 6 Pag. 62

Lesson 6: Memorization elements


Exercise 2: Bistable outputs

Draw the timing diagram Y1 , 
Y1 , Y1 and Y4,  but now using 
negative edges for T (15 
minutes. Only PDFs are 
accepted).

Engineering Introduction to Computers Lesson 6 Pag. 63

31
14/02/2023

Bistables in VHDL

Engineering Introduction to Computers Lesson 6 Pag. 67

Lesson 6: Bistables in VHDL

Introduction 
The Quartus Prime has some bistable implementations:
 RS bistable: norltch, nandltch.
 D‐SR Bistable: DFF, DFF2.
 Commercial bistables: 7474,…

Engineering Introduction to Computers Lesson 6 Pag. 68

32
14/02/2023

Lesson 6: Bistables in VHDL

Introduction 

We can also define our own bistables: using schematics or in VHDL.

As support material, you have available several bistables in VHDL on the 
eStudy platform:
 SR bistable: RS_FF.
 D bistable: D_FF.
 D‐SR bistables: DRS_FF

Engineering Introduction to Computers Lesson 6 Pag. 69

Lesson 6: Bistables in VHDL

SR bistable in VHDL 

SR
bistable

Engineering Introduction to Computers Lesson 6 Pag. 70

33
14/02/2023

Lesson 6: Bistables in VHDL

D bistable in VHDL 

D
bistable

Engineering Introduction to Computers Lesson 6 Pag. 71

Lesson 6: Bistables in VHDL

D‐SR bistable in VHDL 

D‐SR
bistable

Engineering Introduction to Computers Lesson 6 Pag. 72

34
14/02/2023

Lesson 6: Bistables in VHDL

Introduction 

We can also define our own bistables: using schematics or in VHDL.

As support material, you have available several bistables in VHDL on the 
eStudy platform:
TO WORK WITH THE BISTABLES AVAILABLE IN ESTUDY:
 SR bistable: RS_FF.
You have to: (i) copy the .vhdl
D bistable: D_FF. file(s) to the project folder, (ii) add it to the project, (iii) select it 
(compile), (iv) define a symbol for the bistable, and (v) use it in any schematic project.
 D‐SR bistables: DRS_FF

Engineering Introduction to Computers Lesson 6 Pag. 73

Simulation of circuits
with bistables

Engineering Introduction to Computers Lesson 6 Pag. 74

35
14/02/2023

Lesson 6: Simulation of circuits with bistables

SR bistable: theory vs practice
Circuit to simulate

Theoretical outputs

Engineering Introduction to Computers Lesson 6 Pag. 75

Lesson 6: Simulation of circuits with bistables

SR bistable: theory vs practice
Circuit to simulate

In the simulation, the University Program VWF sometimes does not give the 
expected results with undetermined values in the in outputs. Furthermore, R=S=1 
cannot be synthesized in reality and the value will depend on the specific 
implementation of the circuit.
Theoretical outputs

Engineering Introduction to Computers Lesson 6 Pag. 76

36
14/02/2023

Lesson 6: Simulation of circuits with bistables

SR bistable: theory vs practice

Engineering Introduction to Computers Lesson 6 Pag. 77

Lesson 6: Simulation of circuits with bistables

D‐SR bistable: theory vs practice
Circuit to simulate

Theoretical outputs

Engineering Introduction to Computers Lesson 6 Pag. 78

37
14/02/2023

Lesson 6: Simulation of circuits with bistables

D‐SR bistable: theory vs practice

Engineering Introduction to Computers Lesson 6 Pag. 79

QUARTUS: simulation
of circuits with
bistables

Engineering Introduction to Computers Lesson 6 Pag. 80

38
14/02/2023

Lesson 6: Simulation of circuits with bistables

QUARTUS: Example 1

Engineering Introduction to Computers Lesson 6 Pag. 81

Lesson 6: Simulation of circuits with bistables

QUARTUS: Example 1

Engineering Introduction to Computers Lesson 6 Pag. 82

39
14/02/2023

Lesson 6: Simulation of circuits with bistables

QUARTUS: Example 1

Engineering Introduction to Computers Lesson 6 Pag. 83

40

You might also like