You are on page 1of 85

1

Preliminary Computer Science I

COMP0001

School of Science, Computing and Artificial Intelligence

Lecturer: Ilenius Ildephonce

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 1 / 82
2

Lecture 2

Functional components of a
computer system

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 2 / 82
Contents
3

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 3 / 82
Content
4

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 4 / 82
Types of memory and storage
5

Memory is usually referred to as the internal devices which the


computer can access directly.
This memory can be the user’s workspace, temporary data or data that
is key to running the computer.

Figure: Types of computer memory

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 5 / 82
Types of memory and storage
5

Memory is usually referred to as the internal devices which the


computer can access directly.
This memory can be the user’s workspace, temporary data or data that
is key to running the computer.

Figure: Types of computer memory

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 5 / 82
Internal Memory
6

Internal memory includes components such as registers (which are


part of the processor).
There is also memory cache (which is external to the processor); this
is used to store data which the processor will probably need to use
again.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 6 / 82
Primary memory
7

Figure: Structure of primary memory

These memory devices are not really random, it refers to the


fact that any memory location can be accessed independent
of which memory location was last used

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 7 / 82
Primary memory
7

Figure: Structure of primary memory

These memory devices are not really random, it refers to the


fact that any memory location can be accessed independent
of which memory location was last used

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 7 / 82
Primary memory cont..
8

There are two types of RAM technology, dynamic RAM (DRAM) and
static RAM (SRAM)

Table: differences between DRAM and SRAM


DRAM SRAM
1 consists of a number of transistors and uses flip - flops to hold each bit of mem-
capacitors ory
2 needs to be constantly refreshed does not need to be constantly refreshed
3 less expensive to manufacture than
SRAM
4 has a higher memory capacity than has a faster data access time than
SRAM DRAM
5 main memory is constructed from DRAM processor memory cache makes use of
SRAM
6 consumes more power than SRAM un- if accessed at a high frequency, power
der reasonable levels of access, as it usage can exceed that of DRAM
needs to be constantly refreshed

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 8 / 82
ROM
9

ROM
Another form of primary memory is the read-only memory (ROM). This
is similar to RAM in that it shares the same random access properties,
but it cannot be written to or changed. As the name suggests, ROM is
a read-only memory device.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 9 / 82
Difference between RAM and ROM
10

Table: differences between RAM and ROM


RAM ROM
temporary memory device permanent memory device
volatile memory non-volatile memory device
can be written to and read from data stored cannot be altered
used to store data, files, programs, part sometimes used to store BIOS and other
of OS currently in use data needed at start up
can be increased in size to improve op-
erational speed of a computer

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 10 / 82
Embedded systems
11

Embedded systems
This involve installing microprocessors into devices to enable
operations to be controlled in a more efficient way.

Devices such as cookers, refrigerators and central heating systems


can now all be activated by a web-enabled device (such as a mobile
phone or tablet)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 11 / 82
Secondary memory
12

Secondary Memory
storage devices that are not directly accessible by the CPU.

They are non-volatile devices which allow data to be stored as long as


required by the user.

They are larger than primary memory, but data access time is
considerably slower than RAM and ROM.

All applications, the operating system, device drivers and general files

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 12 / 82
Hard Disk Drives
13

Hard disk
1 Data is stored in a digital format on the magnetic surfaces of the
disks (or platters, as they are frequently called)
2 Many applications require the read-write heads to constantly seek
for the correct blocks of data; this means a large number of head
movements.
3 The effects of latency then become very significant. Latency is
defined as the time it takes for a specific block of data on a data
track to rotate around to the read-write head.
4 Through time, the HDD will undergo numerous deletions and
editing, which leads to sectors becoming increasingly fragmented,
resulting in a gradual deterioration of the HDD performance.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 13 / 82
HDD Cont..
14

Solid State
The most common type of solid state storage devices store data by
controlling the movement of electrons within NAND chips.

They have no moving parts and all data is retrieved at the same rate.
Latency is reduced considerably.

a number of solid state storage devices sometimes use electronically


erasable PROM (EEPROM) technology.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 14 / 82
Content
15

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 15 / 82
16

Early computers were fed data while the machines were running. It
was not possible to store programs or data;
In 1940, John Von Neumann developed the concept of the stored
program computer.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 16 / 82
Components of the processor (CPU)
17

The main components of the processor are:


1 the arithmetic logic unit (ALU)
2 the control unit (CU)
3 the system clock
4 the immediate access store (IAS)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 17 / 82
The ALU
18

The ALU
The ALU allows the required arithmetic or logic operations to be
carried out while a program is being run.

It is possible for a computer to have more than one ALU:


one will perform fixed point operations and the other floating-point
operations
The accumulator (ACC) is a temporary register used when carrying
out ALU calculations.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 18 / 82
The Control Unit (CU)
19

The CU
The CU reads an instruction from memory (the address of the location
where the instruction can be found is stored in the program counter
(PC)). This instruction is then interpreted. During that process, signals
are generated along the control bus to tell the other components in the
computer what to do.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 19 / 82
The Clock
20

The Clock
A system clock is used to produce timing signals on the control bus to
ensure this vital synchronisation takes place - without the clock the
computer would simply crash.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 20 / 82
Immediate access store (IAS)
21

The IAS
The IAS holds all the data and programs that the processor (CPU)
needs to access.
This is done because read/write operations carried out using the IAS
are considerably faster than read/write operations to backing store.
The IAS is another name for primary (RAM) memory.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 21 / 82
System buses
22

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 22 / 82
Content
23

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 23 / 82
RISC and CISC processors
24

RISC & CISC processor


Two basic philosophies have emerged over the last few years
developers who want the emphasis to be on the hardware used
(hardware should be chosen to suit the high-level language
development) - CISC (complex instruction set computer)
developers who want the emphasis to be on the
software/instruction sets to be used (driven by ever faster
execution times) - RISC (reduced instruction set computer)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 24 / 82
CISC
25

CISC processor
CISC architecture is based on single complex instructions which need
to be converted by the processor into a number of sub-instructions to
carry out the required operation.

For example: Adding two numbers A and B, we write assembly code:


ADD A, B - this is a single instruction that requires several
sub-instructions (multi - cycle) to carry out the ADDition operation

This methodology leads to shorter coding (than RISC) but may actually
lead to more work being carried out by the processor.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 25 / 82
RISC
26

RISC processor
RISC processors have fewer built-in instruction formats than CISC.
This can lead to higher processor performance. The RISC design
philosophy is built on the use of less complex instructions, which is
done by breaking up the assembly code instructions into a number of
simpler single-cycle instructions. Using the same example as above to

carry out the addition of two numbers A and B (this is the equivalent
operation to ADD A, B): LOAD X, A - this loads the value of A into a

register X LOAD Y, B - this loads the value of B into a register Y ADD


A, B - this takes the values for A and B from X and Y and adds them
STORE Z - the result of the addition is stored in register Z

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 26 / 82
CISC & RISC Features
27

Figure: The differences between CISC and RISC processors

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 27 / 82
Content
28

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 28 / 82
Logic gates
29

Electronic circuits in computers, many memories and controlling


devices are made up of thousands of logic gates

Logic gates take binary inputs and produce a binary output.

Several logic gates combined together form a logic circuit and these
circuits are designed to carry out a specific function.

The checking of the output from a logic gate or logic circuit can be
done using a truth table

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 29 / 82
Logic gates
29

Electronic circuits in computers, many memories and controlling


devices are made up of thousands of logic gates

Logic gates take binary inputs and produce a binary output.

Several logic gates combined together form a logic circuit and these
circuits are designed to carry out a specific function.

The checking of the output from a logic gate or logic circuit can be
done using a truth table

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 29 / 82
Types of Logic Gates
30

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 30 / 82
Truth tables
31

Truth tables are used to trace the output from a logic gate or logic
circuit.
The NOT gate is the only logic gate with one input; the other five gates
have two inputs.
For logic circuits, the number of inputs can be more than 2:
for example, three inputs give a possible 23 (8) binary combinations.
And for four inputs, the number of possible binary combinations is 24
(16). The number of possible binary combinations is a multiple of the
number 2 in every case.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 31 / 82
NOT gate
32

Description The output, X, is 1 if the input A is NOT 1


How to write this
X = NOT A (logic notation)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 32 / 82
AND gate
33

Description
The output, X, is 1 if input A is 1 and input B is 1
How to write this
X = A AND B (logic notation) X = A.B (Boolean algebra)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 33 / 82
OR gate
34

Description
The output, X, is 1 if input A is 1 or input B is 1
How to write this
X = A OR B (logic notation) X = A + B (Boolean algebra)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 34 / 82
NAND gate (NOT AND)
35

Description The output, X, is 1 if input A is NOT 1 or input B is NOT 1

How to write this X = A NAND B (logic notation) X=


(Boolean algebra)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 35 / 82
NOR gate (NOT OR)
36

Description The output, X, is 1 if: input A is NOT 1 and input B is NOT


1 How to write this X = A NOR B (logic notation)

X= (Boolean algebra)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 36 / 82
XOR gate
37

Description
The output, X, is 1 if (input A is 1 AND input B is NOT 1) OR (input A is
NOT 1 AND input B is 1)
How to write this
X = A XOR B (logic notation)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 37 / 82
Content
38

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 38 / 82
Logic circuit
39

When logic gates are combined to carry out a particular function, such
as controlling a robot, they form a logic circuit.

The output from the logic circuit is checked using a truth table. The
following three examples show how to:
1 produce a truth table
2 design a logic circuit from a given logic statement/Boolean algebra
3 design a logic circuit to carry out an actual safety function.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 39 / 82
Example 1: Produce a truth table
40

Produce a truth table for the following logic circuit (note the use of at
junctions)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 40 / 82
Solution 1
41

There are three inputs to this logic circuit; therefore, there will be eight
possible binary values which can be input.
To show step-wise how the truth table is produced, the logic circuit has
been split up into three parts and intermediate values are shown as P,
Q and R.
Part 1
first task is to find the intermediate values P and Q.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 41 / 82
Solution Part 1 cont..
42

The value of P is found from the AND gate where the inputs are A and
B.
The value of Q is found from the NOR gate where the inputs are B and
C.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 42 / 82
Part II
43

The second part of the logic circuit has P and Q as inputs and the
intermediate output, R.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 43 / 82
Part III
44

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 44 / 82
Final Solution
45

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 45 / 82
Example 2
46

Example 2
A safety system uses three inputs to a logic circuit. An alarm, X,
sounds if input A represents ON and input B represents OFF, or if input
B represents ON and input C represents OFF. Produce a logic circuit
and truth table to show the conditions which cause the output X to be
1.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 46 / 82
Solution
47

The first thing to do is to write down the logic statement representing


the scenario in this example.
To do this, it is necessary to recall that ON = 1 and OFF = 0 and also
that 0 is considered to be NOT 1.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 47 / 82
Solution 2 Cont ..
48

The logic circuit is made up of three parts as shown in the logic


statement. We will produce the logic gate for the Part 1 and Part 3,
then join both parts together with the OR gate.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 48 / 82
Solution 2 Cont ...
49

Now, combining both parts with Part 2 (the OR gate) gives us:

There are two ways to produce the


truth table.
1 Trace through the logic circuit using the method described in
Example 1.
2 Use the original logic statement; this allows you to check that your
logic circuit is correct.
Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 49 / 82
Solution 2 Cont ....
50

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 50 / 82
Example 3 is Homework
51

A wind turbine has a safety system which uses three inputs to a logic
circuit. A certain combination of conditions results in an output, X, from
the logic circuit being equal to 1. When the value of X = 1, the wind
turbine is shut down. The following table shows which parameters are
being monitored and form the three inputs to the logic circuit.

The output, X, will have a value of 1 if any of the following combination


of conditions occur:
1 either the turbine speed <=1000rpm and the bearing temperature
>80C
2 or turbin speed > 1000rpm and wind velocity >120kph
3 or bearing temperature >=80C and wind velocity >120kph
Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 51 / 82
Content
52

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 52 / 82
Boolean algebra
53

Boolean algebra is named after the mathematician George Boole. It is


a form of algebra linked to logic circuits and is based on the two
statements:
TRUE (1)
FALSE (0)

Figure: The notation used in this course to represent these two Boolean
operators

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 53 / 82
Rules that govern Boolean algebra
54

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 54 / 82
Proofs of DeMorgan’s laws
55

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 55 / 82
Proofs of DeMorgan’s laws
56

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 56 / 82
Examples
57

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 57 / 82
Solution 1
58

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 58 / 82
Solution 2
59

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 59 / 82
60

Half Harder
The half adder circuit is the simplest circuit. This carries binary
addition on 2 bits generating two outputs
1 the sum bit (S)
2 the carry bit (C)

Consider 1 + 1. It will give the result 1 0 (denary value 2).


The ’1’ is the carry and ’0’ is the sum.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 60 / 82
Content
61

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 61 / 82
62
Full Harder

The sum shows how we


have to deal with CARRY from the previous column. There are three
inputs to consider in this third column, for example, A = 1, B = 0 and C

= 1 (S = 0).

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 62 / 82
Flip-flop circuits
63

All of the logic circuits you have encountered up to now are


combination circuits (the output depends entirely on the input
values).
now consider a second type of logic circuit, known as a sequential
circuit (the output depends on the input value produced from a
previous output value).
Examples of sequential circuits include flip-flop circuits.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 63 / 82
SR flip-flops
64

SR flip-flops consist of two cross-coupled NAND gates (note: they


can equally well be produced from NOR gates).
The two inputs are labelled ‘S’ and ‘R’, and the two outputs are
labelled ‘Q’ and NOT Q

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 64 / 82
65

The output from gate ‘X’ is Q and the output from gate ‘Y’ is Q.
The inputs to gate ‘X’ are R and Q (shown in red on Figure above)
the inputs to gate ‘Y’ are S and Q (shown in green on Figure).
The output from each NOR gate gives a form of positive feedback
(known as cross-coupling, as mentioned earlier).

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 65 / 82
66

consider the truth table to match our SR flip-flop using the initial states
of R = 0, S = 1 and Q = 1. The sequence of the stages in the process
is shown in Figure above

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 66 / 82
67

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 67 / 82
68

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 68 / 82
69

The truth table shows how an input value of S = 0 and R = 0


causes no change to the two output values;
S = 0 and R = 1 reverses the two output values; S = 1 and R = 0
always gives Q = 1 and Q = 0 which is the set value.
The truth table shows that SR flip-flops can be used as a
storage/memory device for one bit; because a value can be
remembered but can also be changed it could be used as a
component in a memory device such as a RAM chip.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 69 / 82
JK flip-flops
70

The SR flip-flop has the following problems:


1 Invalid S, R conditions (leading to conflicting output values) need
to be avoided.
2 If inputs do not arrive at the same time, the flip-flop can become
unstable.
To overcome such problems, the JK flip-flop has been developed. A
clock and additional gates are added, which help to synchronise the
two inputs and also prevent the illegal states.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 70 / 82
JK flip-flop representation
71

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 71 / 82
JK flip-flop Truth table
72

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 72 / 82
73

Use of JK flip-flops
1 Several JK flip-flops can be used to produce shift registers in a
computer.
2 A simple binary counter can be made by linking up several JK
flip-flop circuits (this requires the toggle function).

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 73 / 82
74

It is possible to use the truth table and apply the sum of products
(SoP), or the Boolean expression can be formed directly from the logic
circuit.
Example 1: Write down the Boolean expression to represent this logic
circuit.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 74 / 82
Solution
75

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 75 / 82
Example 2
76

Write the Boolean expression which represents this logic circuit.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 76 / 82
Solution
77

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 77 / 82
Content
78

1 Computer memory
2 Processor Fundamentals
3 Processor architectures
4 Logic gates and logic circuits
5 Logic circuits
6 Boolean algebra
Half adder circuit and full adder circuit
7 Advanced logic circuits
Flip-flop circuits
Boolean algebra and logic circuits
8 Karnaugh maps (K-maps)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 78 / 82
79

Karnaugh maps were developed to help simplify logic


expressions/circuits.
Karnaugh maps make use of Gray codes.

ACTIVITY: Find out the origin of Gray codes and other applications of
the code.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 79 / 82
Example
80

Produce a Boolean expression for the truth table for the NAND gate.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 80 / 82
Solution
81

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 81 / 82
82

The values along the top and the bottom follow Gray code rules.
Only cells containing a 1 are taken account of.
Groups can be a row, a column or a rectangle.
Groups must contain an even number of 1s (2, 4, 6, and so on).
Groups should be as large as possible.
Groups may overlap within the above rules.
Single values can be regarded as a group even if they cannot be
combined with other values to form a larger group.
The final Boolean expression can only consider those values
which remain constant within the group (that is, remain a 1 or a 0
throughout the group).

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 2 September 26, 2021 82 / 82

You might also like