Professional Documents
Culture Documents
Wa0124.
Wa0124.
Wa0124.
TEMPLATE
FACULTY Applied Science
PROGRAMME
BSC Honours in Computer Science
LEVEL Part 1
MODULE AIM After completing this module, students will be able to learn
the type of digital circuit, which is suitable for specific
application and techniques in problem-solving and program
development in Computer Science and IT-related areas.
1
LEARNING OUTCOMES Logic design skills, Switching circuits skills, Programming
skills, Problem solving.
1.1. Introduction:
This topic will focus on the popular number systems and how to represent a number in the
respective number system. The following number systems are the most commonly used.
• Decimal Number system
• Binary Number system
• Octal Number system
• Hexadecimal Number system
Key terms
Base/ Radix, Roman numerals, decimals, and binary numbers.
Base or radix: Is the number of different digits or combination of digits and letters that a
system of counting uses to represent numbers.
Roman numerals: any of the symbols used in a system of numerical notation based on the
ancient Roman system.
2
Decimals: the numbers, which consist of two parts namely, a whole number part and a
fractional part separated by a decimal point.
Binary numbers: contain only the digits 0 or 1, or bits, where each bit represents a power of
two.
In this number system, the successive positions to the left of the decimal point have
weights of 100 , 101 , 102 , 103 and so on. Similarly, the successive positions to the right of
the decimal point have weights of 10-1, 10-2, 10-3, and so on. That means, each position has
a specific weight, which is the power of base 10.
Consider the decimal number 1358.246. Integer part of this number is 1358 and fractional
part of this number is 0.246.
Mathematically, we can write it as:
The part of the number, which lies to the left of the binary point is known as integer part.
Similarly, the part of the number, which lies to the right of the binary point is known as
fractional part. In this number system, the successive positions to the left of the binary point
having weights of 20 , 21 , 22 , 23 and so on. Similarly, the successive positions to the right
of the binary point having weights of 2-1, 2-2, 2-3and so on. That means, each position has a
specific weight, which is the power of base 2.
The binary number 1101.011. Integer part of this number is 1101 and fractional part of this
number is 0.011.
Mathematically, we can write it as:
3
Consider the octal number 1457.236. Integer part of this number is 1457 and fractional part
of this number is 0.236. The digits 7, 5, 4 and 1 have weights of 80 , 81 , 82, and 83
respectively. Similarly, the digits 2, 3 and 6 have weights of 8-1, 8-2, and 8-3 respectively.
Mathematically, we can write it as:
The part of the number, which lies to the left of the hexadecimal point is known as integer
part. Similarly, the part of the number, which lies to the right of the Hexa-decimal point is
known as fractional part.
Consider the Hexa-decimal number 1A05.2C4. Integer part of this number is 1A05 and
fractional part of this number is 0.2C4. The digits 5, 0, A and 1 have weights of 160 , 161 ,
162, and 163 respectively. Similarly, the digits 2, C and 4 have weights of 16-1, 16-2, and 16-3
respectively.
Mathematically, we can write it as:
4
Binary To Hexadecimal Conversion
Here we had to group the bits in fours, from the binary point left, and from the binary
point right, adding (implied) zeros as necessary to make complete 4-bit groups: the
conversion from either octal or hexadecimal to binary is done by taking each octal or
hexadecimal digit and converting it to its equivalent binary (3 or 4-bit) group, then
putting all the binary bit groups together.
Hexadecimal notation is more popular, because binary bit groupings in digital
equipment are common multiples of eight (8, 16, 32, 64, and 128 bit), which are also
multiples of 4. Octal, being based on binary bit groups of 3, doesn’t work out evenly
with those common bit group sizes.
implied zeros
|||
1011 0111 1000
Convert each group of bit ---- ---- . ----
to its hexadecimal equivalent: B 7 8
.
Answer: 10110111.12 = B7.816
5
The decimal value of each octal place-weight times its respective cipher multiplier can
be determined as follows:
These basic techniques may be used to convert a numerical notation of any base into
decimal form if you know the value of that numeration system’s base.
Activity 1a
Consider the following numbers:
1. Convert octal number 145.23 to binary.
2. Convert binary number 1101.11 to octal.
3. Convert binary number 1101.11 to hexadecimal.
6
Reading sources/links
1. Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
2. Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th
edition, 2002, Prentice Hall, ISBN 0-13-089592X.
3. Textbook for Electrical Engineering & Electronics (allaboutcircuits.com)
2.1. Introduction:
Binary arithmetic is an essential part of all digital computers and many other digital
systems. There are ways that electronic circuits can be built to perform different tasks of
addition, subtraction, etc by representing each bit of each binary number as a voltage
signal (either “high,” for a 1; or “low” for a 0).
This is the very foundation of all the arithmetic which modern digital computers
perform. We’ll explore the techniques used to perform simple arithmetic functions on
binary numbers since these techniques will be employed in the design of electronic
circuits to do the same. You might take longhand addition and subtraction for granted,
having used a calculator for so long, but deep inside that calculator’s circuitry, all those
operations are performed “longhand,” using binary numeration.
7
For example
Binary Subtraction
Subtraction and borrowing, these two words will be used very frequently for binary
subtraction. There are four rules of binary subtraction.
For example:
8
Representation of Signed Binary Numbers
There are three types of representations for signed binary numbers.
Sign-Magnitude form
1’s complement form
2’s complement form
The representation of a positive number in all these 3 forms is the same. But, only the
representation of negative numbers will differ in each form.
Sign-Magnitude form
Consider the positive decimal number +108. The binary equivalent the of magnitude of
this number is 1101100. These 7 bits represent the magnitude of the number 108. Since
it is a positive number, consider the sign bit as zero, which is placed on the leftmost side
of magnitude.
The signed binary representation of the positive decimal number +108 is 01101100
So, the same representation is valid in sign-magnitude form, 1’s complement form, and
2’s complement form for positive decimal number +108. n-magnitude representation of -
108 is 01101100.
Consider the negative decimal number -108. The magnitude of this number is 108. We
know the unsigned binary representation of 108 is 1101100.
It has 7 bits. All these bits represent the magnitude. Since the given number is negative,
consider the sign bit as one, which is placed on left most side of magnitude.
Therefore, the sign-magnitude representation of -108 is 11101100. -108 is (11101100)2.
Binary Overflow
Binary overflow is when the answer to an addition or subtraction problem exceeds the
magnitude that can be represented with the allotted number of bits. Remember that the
place of the sign bit is fixed from the beginning of the problem.
Bit Grouping
Bit: A single, bivalent unit of binary notation. Equivalent to a decimal “digit.”
Crumb, Tydbit, or Tayste: Two bits.
Nibble, or Nybble: Four bits.
Nickle: Five bits.
Byte: Eight bits.
Deckle: Ten bits.
Playte: Sixteen bits.
Dynner: Thirty-two bits.
Word: (system dependent).
Activity 2a
10
3 Topic 3: LOGIC GATES
3.1 Introduction
In digital circuits, binary bit values of 0 and 1 are represented by voltage signals.
The absence of voltage represents a binary “0” and the presence of full DC supply
voltage represents a binary “1.”
A logic gate, or simply gate, is a special form of amplifier circuit designed to input and
output logic level voltages (voltages intended to represent binary bits).
A truth table is a standard way of representing the input/output relationships of a gate
circuit.
11
Two inverter gates are connected together so that the output of one fed into the input of
another, and the two inversion functions would “cancel” each other.
Buffer gates merely serve the purpose of signal amplification: taking a “weak” signal
source that isn’t capable of sourcing or sinking much current, and boosting the current
capacity of the signal so as to be able to drive a load.
Multiple-input Gates
Rule for an AND gate: output is “high” only if first input and second input are both
“high.”
12
Rule for an OR gate: output is “high” if input A or input B are “high.
NAND, NOR
Rule for a NAND gate: output is not “high” if both the first input and the second input
are “high.”
13
Rule for a NOR gate: output is not “high” if either the first input or the second input is
“high.”
Negative-AND, Negative-OR
A Negative-AND gate behaves like a NOR gate.
14
A Negative-OR gate behaves like a NAND gate.
Exclusive-OR, Exclusive-NOR
Rule for an Exclusive-OR gate: output is “high” if the input logic levels are different.
15
The rule for an Exclusive-NOR gate: output is “high” if the input logic levels are
the same.
16
TTL OR/ NOR Gate
An OR gate may be created by adding an inverter stage to the output of the NOR gate
circuit.
If both A and B are 0 no current flows, and transistors will be open. If A is high and B is
low, the current will flows, and then the output will be high, likewise if B is high and A
low, current will flows and then the output will be high. If both high current flows.
17
Special-output Gates
It is sometimes desirable to have a logic gate that provides both inverted and non-
inverted outputs. For example, a single-input gate that is both a buffer and an inverter,
with a separate output terminal for each function.
Complementary gates provide both inverted and non-inverted output signals, in such a
way that neither one is delayed with respect to the other.
Gate Universality
NAND and NOR gates possess a special property: they are universal. That is, given
enough gates, either type of gate is able to mimic the operation of any other gate type if
interconnected in sufficient numbers.
For example, it is possible to build a circuit exhibiting the OR function using three
interconnected NAND gates.
18
Implementation of three basic gates using NAND and NOR gates
19
Activity 3a
Q 1: Design Circuit Operation for
a).NAND
b). NOR gates.
Q2 Construct the
a). NOT, Buffer, OR, AND function using the universal gates.
b). NAND function using NOR gates.
Reading sources/links
1. https://www.allaboutcircuits.com/textbook/digital/#chpt-2
2. Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
3. Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition,
2002, Prentice Hall, ISBN 0-13-089592X
4.1 Introduction
Mathematical rules are based on the defining limits we place on the particular numerical
quantities dealt with. When we say that 1 + 1 = 2 or 3 + 4 = 7, we are implying the use of
integer quantities: the same types of numbers we all learned to count in elementary
education. What most people assume to be self-evident rules of arithmetic—valid at all
times and for all purposes—actually depend on what we define a number to be. No, it just
means that the rules of “real” numbers do not apply to the kinds of quantities encountered
in AC circuits, where every variable has both a magnitude and a phase. For AC circuits, we
must use a different kind of numerical quantity, or object, (complex numbers, rather
than real numbers), and along with this different system of numbers comes a different set
of rules telling us how they relate to one another. An expression such as “3 + 4 = 5” is
nonsense within the scope and definition of real numbers, but it fits nicely within the scope
and definition of complex numbers (think of a right triangle with opposite and adjacent
sides of 3 and 4, with a hypotenuse of 5). Because complex numbers are two-dimensional,
they are able to “add” with one another trigonometrically as single-dimension real numbers
cannot.
20
If a first task can be performed in m, ways, while a second task can be performed in n
ways and the two
Identity law
3. Commutative Property
A+B=B+A
21
4. Associative Property
A + (B + C) = (A + B) + C
Circuit Simplification
5. Distributive Property
A ( B + C ) = AB + AC
Circuit Simplification
22
Redundancy Theorem
• A.(A+B)= A
• A + ( A . B) = A
• (A +B).(A +B)=A
• A.B+A.B=A
Sum-Of-Products, or SOP
Boolean expressions may be generated from truth tables quite easily, by determining
which rows of the table have an output of 1, writing one product term for each row, and
finally summing all the product terms.
This creates a Boolean expression representing the truth table as a whole.
Sum-Of-Products Boolean expression is literally a set of Boolean terms added (summed)
together, each term being a multiplicative (product) combination of Boolean variables.
ABC + BC + DF, the sum of products “ABC,” “BC,” and “DF.”
Product-Of-Sums, or POS, Boolean expressions may also be generated from truth tables
quite easily, by determining which rows of the table have an output of 0, writing one
sum term for each row, and finally multiplying all the sum terms.
This creates a Boolean expression representing the truth table as a whole.
23
Product-Of-Sums expression is a set of added terms (sums), which are multiplied
(product) together.
An example of a POS expression would be (A + B)(C + D), the product of the sums
“A + B” and “C + D”.
24
The Exclusive-OR Function: The XOR Gate
The OR function is equivalent to Boolean addition, the AND function to Boolean
multiplication, and the NOT function (inverter) to Boolean complementation, there is no
direct Boolean equivalent for Exclusive-OR.
However, there is a way to represent the Exclusive-OR function in terms of OR and
AND, as: AB’ + A’B
Any expression following the AB’ + A’B form (two AND gates and an OR gate) may be
replaced by a single Exclusive-OR gate.
25
Activity 4a
Example Boolean expression
When “breaking” a complementation bar in a Boolean expression, the
operation directly underneath the break (addition or multiplication) reverses,
and the broken bar pieces remain over the respective terms
Reading sources/links
• https://www.allaboutcircuits.com/textbook/digital/#chpt-2
• Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
• Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition, 2002,
Prentice Hall, ISBN 0-13-089592X
26
Topic 5: KARNAUGH MAPPING
Introduction
The Karnaugh map, like Boolean algebra, is a simplification tool applicable to digital
logic. It is a graphical method, which consists of 2n cells for ‘n’ variables. The adjacent
cells are differed only in single bit position. Karnaugh maps are both faster and easier.
Karnaugh maps work well for up to six input variables,
The possible combinations of grouping 2 adjacent min terms are {(m0, m1), (m2, m3),
(m0, m2) and (m1, m3)}.
For the Truth table below, transfer the outputs to the Karnaugh, then write the Boolean
expression for the result.
27
5.4 Sub topic 2: 3 Variable K-Map
The number of cells in 3 variable K-map is eight since the number of variables is three.
The following figure shows 3 variable K-Map.
The possible combinations of grouping 4 adjacent min terms are {(m0, m1, m3, m2),
(m4, m5, m7, m6), (m0, m1, m4, m5), (m1, m3, m5, m7), (m3, m2, m7, m6) and (m2,
m0, m6, m4)}.
The possible combinations of grouping 2 adjacent min terms are {(m0, m1), (m1, m3),
(m3, m2), (m2, m0), (m4, m5), (m5, m7), (m7, m6), (m6, m4), (m0, m4), (m1, m5),
(m3, m7) and (m2, m6)}.
Solution: DeMorgan’s Theorems describe the equivalence between gates with inverted
inputs and gates with inverted outputs.
28
Example 2: Simplify the logic diagram below and Draw simplified logic diagram.
Solution
29
SOP to K-map
If we consider the combination of inputs for which the Boolean function is ‘1’, then we
will get the Boolean function, which is in the standard sum of products.
Example 3
Let us simplify the following Boolean function,
30
Maxterm, POS Expression
A minterm is a Boolean expression resulting in 1 for the output of a single cell, and 0s
for all other cells in a Karnaugh map, or truth table.
If a minterm has a single 1 and the remaining cells as 0s, it would appear to cover a
minimum area of 1s. A maxterm is a Boolean expression resulting in a 0 for the output
of a single cell expression, and 1s for all other cells in the Karnaugh map, or truth table.
Activity 5a
Question
Simplify the following Boolean function, f(W, X, Y, Z)= ΠM(0,1,2,4)
Reading sources/links
• https://www.allaboutcircuits.com/textbook/digital/#chpt-2
• Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
• Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition, 2002,
Prentice Hall, ISBN 0-13-089592X
31
Topic 6: COMBINATIONAL LOGIC FUNCTIONS
Introduction
The combinational circuit is a circuit in which we combine the different gates in the
circuit, for example, encoder, decoder, multiplexer, and demultiplexer. The output of a
combinational circuit at any instant of time, depends only on the levels present at input
terminals. The combinational circuit does not use any memory. The previous state of
input does not have any effect on the present state of the circuit. A combinational circuit
can have an n number of inputs and an m number of outputs.
Block diagram
Truth Table
32
Half Adder Gate diagram
Circuit diagram
33
Full Adder
• Full adder is developed to overcome the drawback of the Half Adder circuit. It can add
two one-bit numbers A and B, and carry c. The full adder is a three-input and two-output
combinational circuit.
Block diagram
34
Truth Table
Following is the circuit, using a block diagram for a full adder may be used.
35
8 Bit Adder
Block diagram
Truth Table
36
Demultiplexers
• A demultiplexer performs the reverse operation of a multiplexer.
• It receives one input and distributes it over several outputs.
• It has only one input, n outputs, and m select input.
• At a time only one output line is selected by the select lines and the input is transmitted
to the selected output line.
• A de-multiplexer is equivalent to a single pole multiple-way switch.
Demultiplexers come in multiple variations.
• 1: 2 demultiplexer
• 1: 4 demultiplexer
• 1: 16 demultiplexer
• 1: 32 demultiplexer
37
Truth Table
38
Block diagram
Examples of Decoders
• Code converters.
• BCD to seven segment decoders.
• Nixie tube decoders.
• Relay actuator.
2 to 4 Line Decoder
• The block diagram of the 2 to 4-line decoder.
• A and B are the two inputs where D through D are the four outputs.
Circuit Diagram
39
Encoder
Activity 6a
Come up with a Truth table for an encoder and draw the circuit diagram.
Reading sources/links
• https://www.allaboutcircuits.com/textbook/digital/#chpt-2
• Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
• Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition, 2002,
Prentice Hall, ISBN 0-13-089592X
40
Topic 7: MULTIVIBRATORS
Introduction
Any digital circuit employing feedback is called a multivibrator. They have two outputs Q and
notQ. These devices only have two possible states {Q = 0, notQ = 1} or { Q =1, not Q = 0}
Three Types
• Monostable - Also called “One-Shots”. It has one stable state, the Q output is normally
0 (that other state being momentary).
An input signal triggers the monostable and the output rises to 1. Remains in this state
for a fixed period of time. Then returns to its stable state of 0.
• Bistable - It is called “bistable” because it can hold stable in one of two possible output
states, either 0 or 1.
Types of bistable are SR, D, JK and Master/ Slaves.
• Astable - astable multivibrators, have no stable state (oscillating back and forth between
an output of 0 and 1).
Used for oscillators and square wave generators.
41
Gated SR- Latch and Truth Table
• When the E=0, the outputs of the two AND gates are forced to 0, regardless of the states
of either S or R.
• Consequently, the circuit behaves as though S and R were both 0, latching the Q and
not-Q outputs in their last states.
• Only when the enable input is activated (1) will the latch respond to the S and R inputs.
• Since the enable input on a gated S-R latch provides a way to latch the Q and not-Q
outputs without regard to the status of S or R, we can eliminate one of those inputs to
create a multivibrator latch circuit with no “illegal” input states.
• Such a circuit is called a D latch.
• The D latch is nothing more than a gated S-R latch with an inverter added to make R the
complement (inverse) of S.
• D latches can be used as 1-bit memory circuits, storing either a “high” or a “low” state
when disabled, and “reading” new data from the D input when enabled.
42
Block diagram
43
Sub topic 4: Positive edge-triggered D-latch response
• The outputs only respond to the D input during that brief moment of time when the
enable signal changes, or transitions, from low to high.
• This is known as positive edge-triggering.
44
S, R, and D Flip Flop
• It is important to note that the invalid state for the S-R flip-flop is maintained only for
the short period of time that the pulse detector circuit allows the latch to be enabled.
• After that brief time period has elapsed, the outputs will latch into either the set or the
reset state.
• The problem of a race condition manifests itself. With no enable signal, an invalid
output state cannot be maintained.
• However, the valid “latched” states of the multivibrator—set and reset—are mutually
exclusive to one another.
45
• Therefore, the two gates of the multivibrator circuit will “race” each other for
supremacy, and whichever one attains a high output state first will “win.”
• The triangle symbol next to the clock inputs tells us that these are edge-triggered
devices, and consequently that these are flip-flops rather than latches.
• The symbols below are positive edge-triggered: that is, they “clock” on the rising edge
(low-to-high transition) of the clock signal.
• Negative edge-triggered devices are symbolized with a bubble on the clock input line
• Both of the below flip-flops will “clock” on the falling edge (high-to-low transition) of
the clock signal.
J-K Flip-Flop
46
• If we want to preserve bistable operation for all combinations of input states,
we must use edge-triggering so that it toggles only when we tell it to, one step (clock
pulse) at a time.
47
Asynchronous inputs
Activity 7a
Solution
Reading sources/links
• https://www.allaboutcircuits.com/textbook/digital/#chpt-2
• Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
• Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition, 2002,
Prentice Hall, ISBN 0-13-089592X
48
Topic 8: COUNTERS
8.1 Introduction
A Counter is a device that stores (and sometimes displays) the number of times a particular event
or process has occurred, often in relationship to a clock signal. Counters are used in digital
electronics for counting purposes, they can count specific events happening in the circuit. Not
only counting, a counter can follow a certain sequence based on our design like any random
sequence 0,1,3,2… They can also be designed with the help of flip-flops. They are used as
frequency dividers where the frequency of a given pulse waveform is divided. Counters are
sequential circuits that count the number of pulses can be either in binary code or BCD form. The
main properties of a counter are timing, sequencing, and counting. Counter works in two modes
up counter and down counter
Binary Counter
An ‘N’ bit binary counter consists of ‘N’ T flip-flops. If the counter counts from 0 to 2N
− 1, then it is called as binary up counter. Similarly, if the counter counts down from 2N
− 1 to 0, then it is called as binary down counter.
There are two types of counters based on the flip-flops that are connected in
synchronous or not.
• Asynchronous counters
• Synchronous counters
49
The 3-bit Asynchronous binary up counter contains three T flip-flops and the T-input
of all the flip-flops are connected to ‘1’. All these flip-flops are negative edge triggered
but the outputs change asynchronously. The clock signal is directly applied to the first
T flip-flop. So, the output of the first T flip-flop toggles for every negative edge of
clock signal. The output of first T flip-flop is applied as the clock signal for second T
flip-flop. So, the output of second T flip-flop toggles for every negative edge of output
of first T flip-flop.
The block diagram of the 3-bit Asynchronous binary down counter is similar to the
block diagram of the 3-bit Asynchronous binary up counter. But, the only difference is
that instead of connecting the normal outputs of one stage flip-flop as the clock signal
for next stage flip-flop, connect the complemented outputs of the stage flip-flop as
clock signal for next stage flip-flop. The complemented output goes from 1 to 0 is same
as the normal output goes from 0 to 1.
50
8.4 Sub topic 2: Synchronous Counters
If all the flip-flops receive the same clock signal, then that counter is called as
Synchronous counter. Hence, the outputs of all flip-flops change (affect) at the same
time.
The 3-bit Synchronous binary up counter contains three T flip-flops & one 2-input AND
gate. All these flip-flops are negative edge triggered and the outputs of flip-flops change
(affect) synchronously. The T inputs of first, second and third flip-flops are 1, Q0’ & Q1’
Q0’ respectively. The output of first T flip-flop toggles for every negative edge of clock
signal. The output of second T flip-flop toggles for every negative edge of clock signal if
Q0’ is 1. The output of third T flip-flop toggles for every negative edge of clock signal if
both Q0’ & Q1’ are 1.
51
Counter modulus
• The modulus (or just modulo) is the number of states the counter counts and is the
dividing number of the counter. Modulus Counters, or simply MOD counters, are
defined based on the number of states that the counter will sequence through before
returning back to its original value.
• Modulus Counters, or simply MOD counters, are defined based on the number of
states that the counter will sequence through before returning back to its
original value.
For example, a 2-bit counter that counts from 002 to 112 in binary, that is 0 to 3 in
decimal, has a modulus value of 4 ( 00 → 1 → 10 → 11, and return back to 00 ) so
would therefore be called a modulo-4, or mod-4, counter. Note also that it has taken four
clock pulses to get from 00 to 11
Example
Activity 8a
Question 1
Reading sources/links
• https://www.allaboutcircuits.com/textbook/digital/#chpt-2
• Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
• Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition, 2002,
Prentice Hall, ISBN 0-13-089592X
52
Topic 9: SHIFT REGISTERS
Introduction
A shift register is a type of digital circuit using a cascade of flip-flops where the output of one
flip-flop is connected to the input of the next. They share a single clock signal, which causes the
data stored in the system to shift from one location to the next. By connecting the last flip-flop
back to the first, the data can cycle within the shifters for extended periods, and in this form,
they were used as a form of computer memory. Shift registers can have both parallel and serial
inputs and outputs. These are often configured as "serial-in, parallel-out" (SIPO) or as "parallel-
in, serial-out" (PISO). There are also types that have both serial and parallel input and types
with serial and parallel output. There are also "bidirectional" shift registers, which allow shifting
in both directions: L → R or R → L. The serial input and last output of a shift register can also
be connected to create a "circular shift register". A PIPO register (parallel in, parallel out) is
very fast – an output is given within a single clock pulse
53
• The connection of these FFs can be done by connecting the one Flip Flops output to the
next flip flop input.
• So these FFs are synchronous through each other because the equal CLK signal is
applied in each Flip Flop.
54
• The block diagram of the 3-bit SIPO shift register is shown below.
55
Parallel In - Parallel Out (PIPO) Shift Register
• The shift register, which allows parallel input and produces parallel output is known as
the Parallel In – Parallel Out (PIPO) shift register.
• This circuit consists of three D flip-flops, which are cascaded. That means the output of
one D flip-flop is connected to the input of the next D flip-flop.
• All these flip-flops are synchronous with each other since the same clock signal is
applied to each one. In this shift register, we can apply the parallel inputs to each D flip-
flop by making Preset Enable to 1.
• We can apply the parallel inputs through preset or clear.
• These two are asynchronous inputs. That means, the flip-flops produce the
corresponding outputs, based on the values of asynchronous inputs.
• In this case, the effect of outputs is independent of the clock transition.
• So, we will get the parallel outputs from each D flip-flop.
• The block diagram of 3-bit PIPO shift register is shown in the following figure.
56
9.2 Sub topic2: Universal Shift Register
• A Universal Shift register is a register that can store the data and /or shift the data
towards the right and left along with the parallel load capability known as a universal
shift register.
• It can be used to perform input/output operations in both serial and parallel modes.
• Unidirectional shift registers and bidirectional shift registers are combined together to
get the design of the universal shift register.
It is also known as a parallel-in-parallel-out shift register or shift register with the
parallel load.
• Parallel load operation – stores the data in parallel as well as the data in parallel
• Shift left operation – stores the data and transfers the data shifting towards left in the
serial path
• Shift right operation – stores the data and transfers the data by shifting towards the
right in the serial path.
• Hence, Universal shift registers can perform input/output operations with both serial and
parallel loads.
Ring counter
• A ring counter is a type of counter composed of flip flops connected into a shift register
with the output of the last flip flop fed into the input of the first making a circular or ring
structure.
• The flip flops are connected in such a way that information shifts either from left to right
and back around
• The ring counter is almost the same as the shift counter, the only difference is that the
output of the last flip-flop is connected to the input of the first flip-flop but with shift
counters it is taken as the output.
• The block diagram of 3-bit Ring counter is shown in the following figure.
57
Johnson Counter
• The operation of Johnson Ring counter is similar to that of Ring counter.
• But, the only difference is that the complemented output of rightmost D flip-flop is
given as input of leftmost D flip-flop instead of normal output.
• Therefore, ‘N’ bit Johnson Ring counter produces a sequence of states (pattern of zeros
and ones) and it repeats for every ‘2N’ clock cycles.
• Johnson Ring counter is also called as Twisted Ring counter and switch tail Ring
counter.
Activity 9a
1 Differentiate between Ring Type Counter and Johnson Type Counter
2 Explain the difference between:
a. PISO and SIPO Shift Registers
b. PIPO and SISO Shift Registers.
Reading sources/links
• https://www.allaboutcircuits.com/textbook/digital/#chpt-2
• Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
• Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition, 2002,
Prentice Hall, ISBN 0-13-089592X
58
Topic 10: DIGITAL STORAGE (MEMORY)
Introduction
When we store information in a circuit or device, we not only need some way to store and
retrieve it but also to locate precisely where in the device it is. Most, if not all, memory devices
can be thought of as a series of mailboxes, folders in a file cabinet, or some other metaphor
where information can be located in a variety of places.
• When we refer to the actual information being stored in the memory device, we usually
refer to it as the data. The location of this data within the storage device is typically
called the address.
• A vinyl record platter is an example of a random-access device: to skip to any song, you
just position the stylus arm at whatever location on the record that you want.
• Cassette tape, on the other hand, is sequential. You have to wait to go past the other
songs in sequence before you can access or address the song that you want to skip to.
• The process of storing a piece of data on a memory device is called writing, and the
process of retrieving data is called reading.
• Some devices do not allow for the writing of new data and are purchased “pre-written”
from the manufacturer.
• Such is the case for vinyl records and compact audio disks, and this is typically referred
to in the digital world as read-only memory, or ROM.
• Cassette audio and video tape, on the other hand, can be re-recorded (re-written) or
purchased blank and recorded fresh by the user. This is often called read-write memory.
• Many electronic memory devices store binary data by means of circuits that are either
latched in a “high” or “low” state, and this latching effect holds only as long as electric
power is maintained to those circuits.
• Such memory would be properly referred to as volatile. Storage media such as
magnetized disks or tape is nonvolatile because no source of power is needed to
maintain data storage.
59
Memory With Moving Parts
• Modern disk drives use multiple platters made of hard material (hence the name, “hard
drive”) with multiple read/write heads for every platter.
• The gap between the head and platter is much smaller than the diameter of a human hair.
• If the hermetically-sealed environment inside a hard disk drive is contaminated with
outside air, the hard drive will be rendered useless.
• Dust will lodge between the heads and the platters, causing damage to the surface of the
media.
• Here is a hard drive with four platters, although the angle of the shot only allows
viewing of the top platter.
• This unit is complete with drive motor, read/write heads, and associated electronics. It
has a storage capacity of 340 Mbytes
Reading sources/links
• https://www.allaboutcircuits.com/textbook/digital/#chpt-2
• Lessons In Electric Circuits, Volume IV – Digital, Tony R. Kuphaldt
• Introduction to Electronic Circuits, Samuel P. Harbison, Guy L. Steele, 5th edition, 2002,
Prentice Hall, ISBN 0-13-089592X
60
11.0 Module Summary/Conclusion
By the end of this module, ss will be able to solve logic and proof techniques, set theory,
elementary number theory, functions and relations, graphs, trees, modeling computations and
abstract algebra expressions. Techniques of counting: permutations, combinations, recurrences,
algorithms are also covered to help students have a broader scope of real world problem
solving techniques.
12 PRACTICUUM
13 REVISION
14 EXAMINATION
61