PADC notes
counters, encoding, error detection
and correction & fiber optic
BY: MT Ihuhwa
Introduction to counters
• The digital circuit which is used to count the number of pulses are formally called the
counter (Timers) .
• A counter is a logic circuit that can count a sequence of numbers or states when
activated by a clock input.
• The output of a counter indicates the binary number stored in the counter at any given
time.
• Counters have modes. The ‘mod’ of the counter represents the number of states of the
cycles through it, before setting the counter to its initial state.
E.g A binary mod 4 counter has 4 count states, from 000 to 011. So the mod 4 counter
counts from 0 to 4. This means, in general a mod N counter can contain n number of flip
flops, where 2n = N.
1
10/31/2018
TYPES OF COUNTER
• Asynchronous Counters
• Synchronous Counters
• Decade Counter
• Up And Down Counter
• Ring Counter
• Johnson Counter
2
10/31/2018
Synchronous Counters
• Synchronous means occurring at the same time.
• A synchronous counter is a counter in which each stage is clocked at the same
time. This is accomplished by connecting the clock input to each stage of the
counter .
• A synchronous counter is also called a parallel counter because the clock input
is connected in parallel to each flip-flop.
3
10/31/2018
Decade Counter
4
10/31/2018
up-down counter
• An up-down counter can count in either direction through a certain
sequence. It is also referred to as a bidirectional counter.
• The counter can be reversed at any point in the counting sequence.
• The inputs to the JK flip-flops are enabled by the up-down input
qualifying the up or down set of the AND gates.
• Counters can be stopped after any sequence of counting by using a
logic gate or combination of logic gates.
• The output of the gate is fed back to the input of the first flip-flop in
a ripple counter.
• If a 0 is fed back to the JK input of the first flip-flop it prevents the
first flip flop from toggling, thereby stopping the count.
5
10/31/2018
Ring Counter
• The ring counter is a cascaded connection of flip flops, in which the output
of last flip flop is connected to input of first flip flop. In ring counter if the
output of any stage is 1, then its re
• Initially, all the flip flops in ring counter are reset to 0 by applying CLEAR
signal. Before minder is 0. The Ring counters transfers the same output
throughout the circuit.
• Ring counters are used to count the data in a continuous loop.
Johnson Counter
• The Johnson counter is a modification of ring counter. In this
the inverted output of the last stage flip flop is connected to
the input of first flip flop.
• If we use n flip flops to design the Johnson counter, it is
known as 2n bit Johnson counter or Mod 2n Johnson counter.
6
10/31/2018
Shift registers
• A shift register is a sequential logic circuit widely
used to store data temporarily.
• Data can be loaded into and removed from a shift
register in either a parallel or serial format.
• It has ability to move data one bit at a time from
one storage medium to another, the shift register
is valuable in performing a variety of logic
operations.
• Shift registers can move data to the left or right
7
10/31/2018
Shift registers
• For example, if the binary number 1011 is applied to the input
of the shift register and a shift pulse is applied, the number
stored in the shift register is shifted out and lost while the
external number is shifted in.
8
10/31/2018
Encoder
• An encoder is a combinational logic circuit
that accepts one or more inputs and
generates a multibit binary output.
• Encoding is the process of converting any
keyboard character or number as input to a
coded output such as a binary or BCD form.
decimal-to-binary encoder.
• Its function is to take a single digit (0 to 9) as input
and to output a 4-bit code representation of the
digit.
• This is referred to as a 10-line-to-4-line encoder.
9
10/31/2018
Encoding
• Data Encoding is a method to convert the data into
signal form because we cannot transmit data until it is
converted into signal.
• Whenever we transmit a data it is always in the form of
a signal.
• It can be in digital or analog form.
• Encoding is the process of putting a sequence of
characters (letters, numbers, punctuation, and certain
symbols) into a specialized digital format for efficient
transmission or transfer.
• Decoding is the opposite process -- the conversion of a
digital signal into a sequence of characters
10
10/31/2018
Types of encoding
Types of Encoding
• Digital Data , Analog signals Basis for analog signaling is a
continuous, constant-frequency signal known as the carrier
frequency. By modulating(Amplitude , Frequency , Phase) [modem]
11
10/31/2018
12
10/31/2018
• With NRZ the level of signal is determined by the binary digit being sent.
Binary 1's are indicated by positive voltages and binary 0's by negative
voltages .
13
10/31/2018
Biphase
• Biphase is implemented in two different ways:
1. Manchester encoding "1" is transmitted as 0 in the first half of the clock
and 1 in the second half of the clock. And "0" is transmitted as 1 in the
first half of the clock and 0 in the second half of the clock.
2. Differential Manchester: In differential Manchester encoding, a 1-bit is
indicated by making the first half of the signal equal to the last half of the
previous bit's signal and a 0-bit is indicated by making the first half of the
signal opposite to the last half of the previous bit's signal. That is, a zero
bit is indicated by a transition at the beginning of the bit.
14
10/31/2018
15
10/31/2018
Repetition codes
• A repetition code is a coding scheme that repeats the bits across a channel
to achieve error-free communication.
• Given a stream of data to be transmitted, the data are divided into blocks
of bits. Each block is transmitted some predetermined number of times.
For example, to send the bit pattern "1011", the four-bit block can be
repeated three times, thus producing "1011 1011 1011". However, if this
twelve-bit pattern was received as "1010 1011 1011" – where the first block is
unlike the other two – it can be determined that an error has occurred.
16
10/31/2018
Checksum
• In checksum error detection scheme, the data is divided into k segments each of m
bits.
• In the sender’s end the segments are added using 1’s complement arithmetic to
get the sum. The sum is complemented to get the checksum.
• The checksum segment is sent along with the data segments.
• At the receiver’s end, all received segments are added using 1’s complement
arithmetic to get the sum. The sum is complemented.
• If the result is zero, the received data is accepted; otherwise discharged.
17
10/31/2018
18
10/31/2018
Error-correcting code
• An error-correcting code (ECC) or forward error
correction (FEC) code is a process of adding redundant
data, or parity data, to a message, such that it can be
recovered by a receiver even when a number of errors
(up to the capability of the code being used) were
introduced, either during the process of transmission,
or on storage.
• Since the receiver does not have to ask the sender for
retransmission of the data, a backchannel is not
required in forward error correction, and it is therefore
suitable for simplex communication such as
broadcasting
19
10/31/2018
Hybrid schemes
• Hybrid ARQ is a combination of ARQ and forward error
correction. There are two basic approaches:
• Messages are always transmitted with FEC parity data (and
error-detection redundancy). A receiver decodes a message
using the parity information, and requests retransmission
using ARQ only if the parity data was not sufficient for
successful decoding (identified through a failed integrity
check).
• Messages are transmitted without parity data (only with
error-detection information). If a receiver detects an error,
it requests FEC information from the transmitter using
ARQ, and uses it to reconstruct the original message.
20
10/31/2018
• There are three main basic elements of fiber optic communication system.
• They are:
– Compact Light Source
– Low loss Optical Fiber
– Photo Detector
• Accessories like connectors, switches, couplers, multiplexing devices, amplifiers
and splices are also essential elements in this communication system.
21
10/31/2018
• The light emitting diodes are used for short distances and low data
rate applications due to their low bandwidth and power
capabilities.
• For longer distances and high data rate transmission, Laser Diodes
are preferred due to its high power, high speed and narrower
spectral line width characteristics.
Single-Mode Fibers: Single mode fibers are used to transmit one signal per fiber; these
fibers are used in telephone and television sets. Single mode fibers have small cores.
Multimode fibers are used to transmit many signals per fiber; these signals are used in
computer and local area networks that have larger cores.
22
10/31/2018
Photo Detectors
• The purpose of photo detectors is to convert the light signal back to an
electrical signal. Two types of photo detectors are mainly used for optical
receiver in optical communication system: PN photo diode and avalanche
photo diode. Depending on the application’s wavelengths, the material
composition of these devices vary.
23