Anda di halaman 1dari 23

10/31/2018

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.

• A counter circuit is usually constructed of a number of flip-flops connected in cascade.

• 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

Asynchronous (Ripple) Counter


• Asynchronous means not occurring at the same time.
• With respect to counter operations, asynchronous means that the flip-flops do not change
states at the same time. This is because the clock pulse is not connected to the clock input of
each stage.
• It consists of a cascaded arrangement of flip-flops wherein clock pulse of one flip-flop is
driven by the output of its predecessor flip-flop.
• The number of flip-flops used determine the modulus of the counter, wherein the number of
flip-flops depend upon the number of logic states in the counter, before it reaches its initial
state.

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.

A synchronous counter operates as follows.


• Initially the counter is reset with both flip-flops in the 0 state.
• When the first clock pulse is applied, the first flip-flop toggles and the output
goes high. The second flip-flop does not toggle because of the delay from the
input to the actual changing of the output state.
• Therefore, there is no change in the second flip-flop output state.
• When the second clock pulse is applied, the first flip-flop toggles and the
output goes low. Because there is a high from the output of the first stage, the
second stage toggles and its output goes high.
• After four clock pulses, the counter recycles to its original state.
SYNCHRONOUS COUNTERS

3
10/31/2018

Decade Counter

• Decade counters have a modulus of ten, or ten


states in their counting sequence. A common
decade counter is the BCD (8421) counter, which
produces a binary-coded-decimal sequence.

• The AND and OR gates detect the occurrence of


the ninth state and cause the counter to recycle
on the next clock pulse. The symbol for a 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.

Logic diagram for a BCD up-down counter

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

Methods of loading and reading data


in a shift register

7
10/31/2018

Shift register constructed from four flip-flops

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.

• the sequence of events for storing a number in the shift


register.
• One of the most common applications of a shift register is
serial-to-parallel or parallel-to-serial data conversion.

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

Types of data encoding

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]

• Analog Data ,Digital signals Analog-to-digital conversion is an


electronic process in which a continuously variable analog signal is
changed, without altering its essential content, into a multi-level
digital signal. [codec]
– Frequency Division Multiplexing (FDM)
– Wave Division Multiplexing (WDM) [fiber]
– Time Division Multiplexing (TDM)

• Digital Data , Digital signals Digital signal –is a sequence of discrete,


discontinuous voltage pulses. Bit duration :: the time it takes for the
transmitter to emit the bit. [wired networks ]

11
10/31/2018

Digital to Digital encoding


• Data as well as signals that represents data can either be digital or
analog.
• Line coding is the process of converting digital data to digital
signals.
• By this technique we converts a sequence of bits to a digital signal.
• At the sender side digital data are encoded into a digital signal and
at the receiver side the digital data are recreated by decoding the
digital signal.

• Main line coding schemes categories:


– Unipolar (eg. NRZ scheme)
– Polar (eg. NRZ-L, NRZ-I, RZ)
– Biphase – Manchester and differential Manchester).

characteristic of line coding techniques


• There should be self-synchronizing i.e., both receiver
and sender clock should be synchronized.
• There should have some error-detecting capability.
• There should be immunity to noise and interference.
• There should be less complexity.
• There should be no low frequency component (DC-
component) as long distance transfer is not feasible for
low frequency component signal.
• There should be less base line wandering

12
10/31/2018

Non return to zero (NRZ)


• As its name implies Non Return to Zero (NRZ) encodes a signal that is
always positive or negative but never zero. If the line is idle, i.e. neither
positive nor negative, then there is no transmission.

• 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 .

The graphic shows NRZ in action sending the binary transmission of


"11011000100".

Return to zero encoding


• Return to Zero use three value(positive, negative, zero) : 1 : positive-to-
zero, 0 : negative-to-zero. Return-to-zero (RZ) describes a line code where
the signal drops (returns) to zero between each pulse.
• This takes place even if a number of consecutive 0s or 1s occur in the
signal.
• The signal is self-clocking. This means that a separate clock does not need
to be sent alongside the signal, but suffers from using twice the
bandwidth to achieve the same data-rate as compared to non-return-to-
zero format.

13
10/31/2018

Types of Non Return to Zero :


• Non return to Zero-Level (NRZ-L) : the level of the
signal is dependent upon the state of the bit.
• Non return to Zero-Inverted (NRZ-I): the signal is
inverted if a 1 is encountered.

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

Error detection and correction


• Error is a condition when the receiver’s information
does not matches with the sender’s information.
• During transmission, digital signals suffer from noise
that can introduce errors in the binary bits travelling
from sender to receiver. That means a 0 bit may change
to 1 or a 1 bit may change to 0.
• Error detection is the detection of errors caused by
noise or other impairments during transmission from
the transmitter to the receiver.
• Error correction is the detection of errors and
reconstruction of the original, error-free data.

Techniques for error detection


• Types of errors • Error Detecting Codes
Single-bit Error: The term single-bit error Basic approach used for error detection
means that only one bit of given data is the use of redundancy, where
unit additional bits are added to facilitate
detection and correction of errors.
Popular techniques are:
– Repetition code
– Simple Parity check
Burst Error : that two or more bits in the – Two-dimensional Parity check
data unit have changed from 0 to 1 or – Checksum
vice-versa.
– Cyclic redundancy check

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.

• A repetition code is very inefficient, and can be susceptible to problems if


the error occurs in exactly the same place for each group (e.g., "1010 1010
1010" in the previous example would be detected as correct).

Simple Parity check


• Blocks of data from the source are subjected to a check bit or parity bit
generator form, where a parity of :
– 1 is added to the block if it contains odd number of 1’s, and
– 0 is added if it contains even number of 1’s
• This scheme makes the total number of 1’s even, that is why it is called
even parity checking.

16
10/31/2018

Two-dimensional Parity check


• Parity check bits are calculated for each row, which is equivalent to a
simple parity check bit.
• Parity check bits are also calculated for all columns, then both are sent
along with the data.
• At the receiving end these are compared with the parity bits calculated on
the received data.

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

Cyclic redundancy check (CRC)


• CRC is based on binary division.
• In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are
appended to the end of data unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.
• At the destination, the incoming data unit is divided by the same number. If at this
step there is no remainder, the data unit is assumed to be correct and is therefore
accepted.
• A remainder indicates that the data unit has been damaged in transit and
therefore must be rejected.

Error Correcting Codes


• Error Correction can be handled in two ways:

– One is when an error is discovered; the receiver


can have the sender retransmit the entire data
unit. This is known as backward error correction.

– In the other, receiver can use an error-correcting


code, which automatically corrects certain errors.
This is known as forward error correction.

18
10/31/2018

Automatic repeat request (ARQ)


• Automatic Repeat reQuest (ARQ) is an error control method for
data transmission that makes use of error-detection codes,
acknowledgment and/or negative acknowledgment messages, and
timeouts to achieve reliable data transmission. An acknowledgment
is a message sent by the receiver to indicate that it has correctly
received a data frame.

• Usually, when the transmitter does not receive the


acknowledgment before the timeout occurs (i.e., within a
reasonable amount of time after sending the data frame), it
retransmits the frame until it is either correctly received or the
error persists beyond a predetermined number of retransmissions.

• Three types of ARQ protocols are Stop-and-wait ARQ, Go-Back-N


ARQ, and Selective Repeat ARQ.

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.

Advantages of using fiber optic cables


for data transmission
• Fiber optic transmission is faster: Fiber optic versus copper wire transmission can
be boiled down to the speed of photons versus the speed of electrons. Fiber optic
transmission results in less attenuation.
• When traveling over a long distance, fiber optic cables experience less signal loss
than copper cabling.
• Fiber optic cables are impervious to electromagnetic interference (EMI).
• Copper wires, if not properly installed, will produce electromagnetic currents that
can interfere with other wires and wreak havoc on a network. Fiber optic cables,
unlike copper cables, do not conduct electricity.
• fiber optic cables is that they are not a fire hazard. This can also be attributed to
the same reason that the cables do not produce EMI—there is no electric current
traveling through the core.
• Fiber optic cables do not break as easily.
• This means that you will not have to worry about replacing them as frequently as
copper wires. Even though the fiber is made of glass, copper wires are more prone
to damage than fiber optic cables are.

20
10/31/2018

How a Fiber Optic Communication Works


• Fiber optics transmission involves transmission of signals in the form of light from
one point to the other.
• When the input data, in the form of electrical signals, is given to the transmitter
circuitry, it converts them into light signal with the help of a light source.
• This source is of LED whose amplitude, frequency and phases must remain stable
and free from fluctuation in order to have efficient transmission.
• The light beam from the source is carried by a fiber optic cable to the destination
circuitry wherein the information is transmitted back to the electrical signal by a
receiver circuit. The Receiver circuit consists of a photo detector along with an
appropriate electronic circuit, which is capable of measuring magnitude, frequency
and phase of the optic field. This type of communication uses the wave lengths
near to the infrared band that are just above the visible range

Basic Elements of a Fiber Optic Communication System

• 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

Compact Light Source:

• The requirements of the sources include power, speed, spectral line


width, noise, ruggedness, cost, temperature, and so on.

• Two components are used as light sources: light emitting diodes


(LED’s) and laser diodes.

• 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.

Low Loss Optical Fiber


• Optical fiber is a cable, which is also known as cylindrical dielectric waveguide
made of low loss material.
• An optical fiber also considers the parameters like the environment in which it is
operating, the tensile strength, durability and rigidity.
• The Fiber optic cable is made of high quality extruded glass (si) or plastic, and it is
flexible.
• The diameter of the fiber optic cable is in between 0.25 to 0.5mm (slightly thicker
than a human hair).

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

Anda mungkin juga menyukai