0% found this document useful (0 votes)
441 views

Lesson 10 MMW Codes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
441 views

Lesson 10 MMW Codes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

CODES

BINARY CODE 01
BINARY
02 OPERATIONS

ERROR DETECTION 03 ERROR


04 CORRECTION
BINARY CODE
BINARY

• A system of counting
• a base-2 number system invented by Gottfried
Leibniz that is made up of only two numbers: 0 and 1.

• This number system is the basis for all binary code


BINARY CODE

• is used to write data such as the computer processor


instructions.
• code used in digital computers, based on a binary
number system in which there are only two possible
states, off and on, usually symbolized by 0 and 1.
TALLY MARKS

• also called hash marks, are a unary numeral system.


• They are a form of numeral used for counting.
• They are most useful in counting or tallying ongoing
results, such as the score in a game or sport, as no
intermediate results need to be erased or discarded.
TALLY MARKS
DECIMAL NUMBER SYSTEM

• also called the base-10 number system,


• the standard system for denoting integer and non-
integer numbers.

• It is the extension to non-integer numbers of the


Hindu–Arabic numeral system.
• The way of denoting numbers in the decimal system is
often referred to as decimal notation.
DECIMAL NUMBER SYSTEM

• In base-10, each digit of a number can have an


integer value ranging from 0 to 9 (10 possibilities)
depending on its position.

• The places or positions of the numbers are based on


powers of 10.

• Each number position is 10 times the value to the right


of it, hence the term base-10.
• Exceeding the number 9 in a position initiates
counting in the next highest position.
DECIMAL NUMBER SYSTEM

Numbers greater than 1 appear to the left of a decimal


point and have the following place values:
• Ones

• Tens

• Hundreds

• Thousands
• Ten-thousands, and so on
DECIMAL NUMBER SYSTEM

Values that are a fraction of or less than 1 in value


appear to the right of the decimal point:
• Tenths

• Hundredths

• Thousandths

• Ten-thousandths
• Hundred-thousandths, and so on
DECIMAL NUMBER SYSTEM
BINARY NUMBER SYSTEM

• also called the base-2 number system.


• a method of representing numbers that counts by
using combinations of only two numerals: zero (0) and
one (1).
• Computers use the binary number system to
manipulate and store all of their data including
numbers, words, videos, graphics, and music.
BINARY NUMBER SYSTEM

• The term bit, the smallest unit (0 and 1) of digital


technology, stands for "BInary digiT."
• A byte is a group of eight bits.

• A kilobyte is 1,024 bytes or 8,192 bits.


BINARY NUMBER SYSTEM

• BITSTREAM (or bit stream), also known as binary


sequence, is a sequence of bits.

• BYTESTREAM is a sequence of bytes. Typically,


each byte is an 8-bit quantity, and so the term octet
stream is sometimes used interchangeably.
BINARY NUMBER SYSTEM

• The advantage of the binary system is its simplicity.


A computing device can be created out of anything
that has a series of switches, each of which can
alternate between an "on" position and an "off"
position.
• These switches can be electronic, biological, or
mechanical, as long as they can be moved on
command from one position to the other.
BINARY NUMBER SYSTEM

• When a switch is "on" it represents the value of one,


and when the switch is "off" it represents the value of
zero.

• Digital devices perform mathematical operations by


turning binary switches on and off. The faster the
computer can turn the switches on and off, the faster it
can perform its calculations.
DECIMAL-BINARY
CONVERSION
DECIMAL-BINARY CONVERSION

• To convert decimal numbers from base-10 to Binary


(base-2), divide that number repeatedly by the value
of 2, which is the base of the number is being
converted to.
• The division operation is repeated until the quotient is
zero (0).
• The remainders – written in reverse of the order in
which they were obtained, form the new equivalent
numeral.
DECIMAL-BINARY CONVERSION

EXAMPLE
Convert the decimal numeral 139 to its binary equivalent.
DECIMAL-BINARY CONVERSION

EXAMPLE
DECIMAL-BINARY CONVERSION

EXAMPLE
BINARY –DECIMAL
CONVERSION
BINARY-DECIMAL CONVERSION

• To convert binary numbers from base-2 to Decimal


(base-10), multiply each digit to the powers of 2
starting from the rightmost digit to the leftmost digit.

• Add all the resulting products.


• The sum is the Decimal equivalent of the numeral.
POWERS OF 2
DECIMAL-BINARY CONVERSION

EXAMPLE
Convert the binary number 10001011 to its decimal
equivalent.
BINARY-DECIMAL CONVERSION

EXAMPLE
BINARY-DECIMAL CONVERSION

EXAMPLE
BINARY TO
CHARACTERS
ASCII
• Pronounced ask-ee

• ASCII is the acronym for the American Standard


Code for Information Interchange.
• It is a code for representing 128 English characters as
numbers, with each letter assigned a number from 0
to 127.

• For example, the ASCII code for uppercase M is 77.


Most computers use ASCII codes to represent text,
which makes it possible to transfer data from one
computer to another.
ASCII
• ASCII assigns a character to each value represented
by a byte of binary.
• Since a byte has 8 bits. There 255 possible
combination of bits.

• Therefore, ASCII actually represents up to 255


characters and symbols.
ASCII
ASCII
BINARY OPERATIONS
BINARY ADDITION
BINARY ADDITION

• Performed in the same manner as decimal addition.


There are only four possible combinations when
adding these two numbers.
BINARY ADDITION

• Simply remember the results of adding the fours


possible combination of digits.
• Carry-overs are performed in the same manner as in
decimal arithmetic.
• Since 1 is the largest digit in the binary system, any
sum greater than 1 requires that a digit be carried
over.
BINARY ADDITION

EXAMPLE
BINARY ADDITION

EXAMPLE
BINARY ADDITION

EXAMPLE
BINARY
SUBTRACTION
BINARY SUBTRACTION

• Just as in decimal arithmetic, subtraction is performed


column by column. There are also four possible
combinations when subtracting two numbers.
BINARY SUBTRACTION

• Binary numbers can also be negative, just like decimal


numbers. If a larger number is subtracted from a
smaller number, the negative sign is prefixed in the
answer.
BINARY SUBTRACTION

EXAMPLE
BINARY SUBTRACTION

EXAMPLE
BINARY SUBTRACTION

EXAMPLE
BINARY
MULTIPLICATION
BINARY MULTIPLICATION

• Binary Multiplication is simpler than decimal since


multiplying a number by the bit 0 or 1 yields
respectively 0 or the number.
BINARY MULTIPLICATION

EXAMPLE
BINARY DIVISION
BINARY DIVISION

• Division is the inverse of Multiplication and division by


zero is similarly meaningless.
• In Binary Division we are either able to subtract the
divisor, in which case the quotient is 1, or we are not
able to, yielding a quotient of 0
BINARY DIVISION

EXAMPLE
ERRORS
ERRORS

• When bits are transmitted over the computer network,


they are subject to get corrupted due to interference
and network problems.

• Are corrupted bits that leads to spurious data being


received by the receive.
ERROR DETECTING
CODES
ERROR DETECTING CODES

• are used to detect the errors present in the received


data bitstream.
• These codes contain some bits, which are included
appended to the original bit stream.
• These codes detect the error, if it is occurred during
transmission of the original data bitstream
ERROR DETECTING CODES

• a sequence of numbers generated by specific


procedures for detecting errors in data that has been
transmitted over computer networks.
PARITY CHECK
PARITY CHECK

• Parity check is done by adding an extra bit, called


parity bit to the data to make number of 1s either
even in case of even parity, or odd in case of odd
parity.

• Parity check is suitable for single bit error detection


only.
PARITY CHECK: SENDER

• While creating a frame, the sender counts the number


of 1s in it and adds the parity bit in following way
❑ In case of even parity: If number of 1s is even then
parity bit value is 0. If number of 1s is odd, then parity
bit value is 1.

❑ In case of odd parity: If number of 1s is odd then


parity bit value is 0. If number of 1s is even, then
parity bit value is 1.
PARITY CHECK: RECEIVER

• On receiving a frame, the receiver counts the number


of 1s in it.
• In case of even parity check, if the count of 1s is
even, the frame is accepted, otherwise it is rejected.

• In case of odd parity check, if the count of 1s is odd,


the frame is accepted, otherwise it is rejected.
PARITY CHECK

EXAMPLE
a) 111 - transmit using odd parity
b) 100100 - transmit using odd parity
c) 1100 - transmit using even parity
d) 10110 - transmit using even parity
PARITY CHECK

EXAMPLE
a) 111 - parity bit: 0
b) 100100 - parity bit: 1
c) 1100 - parity bit: 0
d) 10110 - parity bit: 1
CHECKSUM
CHECKSUM
In this error detection scheme, the following procedure is
applied
• Data is divided into fixed sized frames or segments.

• The sender adds the segments using 1’s complement arithmetic to get
the sum. It then complements the sum to get the checksum and sends
it along with the data frames.

• The receiver adds the incoming segments along with the checksum
using 1’s complement arithmetic to get the sum and then complements
it.

• If the result is zero, the received frames are accepted; otherwise, they
are discarded.
CHECKSUM

EXAMPLE
Transmit the binary code “101111010010” using
checksum.
CHECKSUM

EXAMPLE
Transmit the binary code “101111010010” using
checksum.

STEP 1:

Divide the data in 3 blocks with each block containing 4


bits
CHECKSUM

STEP 2:
CHECKSUM

STEP 2:
CHECKSUM

STEP 2:
CHECKSUM

STEP 2:

COMPLEMENT
OF THE SUM
CHECKSUM

STEP 2:

CHECKSUM
CHECKSUM

STEP 2:
The new binary code that will then be transmitted is

Where the first group of digits is the checksum


CHECKSUM

STEP 3:
The receiver will then verify if the transmitted data is
correct by adding all the blocks of binary code.
CHECKSUM

STEP 3:
CHECKSUM

STEP 3:
CHECKSUM

STEP 3:
CHECKSUM

STEP 3:
Since the complement of the sum are all 0’s, the data
transmitted is accepted with no errors.
ERROR CORRECTING
CODES
ERROR CORRECTING CODES

• are used to correct the errors present in the received


data bitstream so that, we will get the original data.
• Error correction codes also use the similar strategy of
error detection codes.
ERROR CORRECTING CODES

• an encoding scheme that transmits messages as


binary numbers, in such a way that the message can
be recovered even if some bits are erroneously
flipped.
• They are used in practically all cases of message
transmission, especially in data storage where ECCs
defend against data corruption.
REPITITION
CODES
REPITITION CODES

• when a bit is to be transmitted, it is instead transmitted


multiple times (usually 3), with the bit transmitted more
times being interpreted as the intended message.

• In order to transmit a message over a noisy channel


that may corrupt the transmission in a few places, the
idea of the repetition code is to just repeat the
message several times.
REPITITION CODES
REPITITION CODES

EXAMPLE
What is the original binary code transmitted as
“111010111000110” using repetition code.
REPITITION CODES

EXAMPLE
What is the original binary code transmitted as
“111010111000110” using repetition code.

After encoding the transmitted data, the original binary


code is "10101“.
REPITITION CODES

EXAMPLE
After encoding the transmitted data, the original binary
code is "10101“.
HAMMING CODES
HAMMING CODES

• This code uses multiple parity bits and place these


parity bits in the positions of powers of 2.

• The different block of codes that will be checked are in


the following slides
HAMMING CODES
HAMMING CODES
HAMMING CODES
HAMMING CODES
HAMMING CODES
Click on the links below to view the supplementary
videos, where Hamming Codes is discussed in full detail.

“3Blue1Brown” Channel in YouTube


Hamming codes and error correction
https://www.youtube.com/watch?v=X8jsijhllIA

Hamming codes part 2, the elegance of it all

https://www.youtube.com/watch?v=b3NxrZOu_CE
THANK YOU
Does anyone have any questions?
[email protected]
Fonts & colors used
This presentation has been made using the following fonts:

Passion One
(https://fonts.google.com/specimen/Passion+One)

Abel
(https://fonts.google.com/specimen/Abel)

#f9e9d9 #5b72b7

You might also like