Chapter 7
Download
1 / 25

Data Coding - PowerPoint PPT Presentation


  • 232 Views
  • Uploaded on

Chapter 7. Data Coding. Agenda. Coding Code efficiency and conversion Compression/compaction Code encryption/decryption. Coding. Definition A predetermined set of symbols having specific meanings Types Human code Morse code (dot and dash for telegraph) Machine code Binary states

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Data Coding' - olin


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Chapter 7

Chapter 7

Data Coding


Agenda
Agenda

  • Coding

  • Code efficiency and conversion

  • Compression/compaction

  • Code encryption/decryption


Coding
Coding

  • Definition

    • A predetermined set of symbols having specific meanings

  • Types

    • Human code

      • Morse code (dot and dash for telegraph)

    • Machine code

      • Binary states

      • Binary digit (bit)


Machine codes i
Machine Codes - I

  • Characteristics

    • Two-state code

    • Same number of bits

    • Perfectly formed

    • Same transmission duration

  • Character Assignment: unique sequence of bits


Machine codes ii
Machine Codes - II

  • Types of characters

    • Alphanumeric

    • Format effector for terminal screen or paper

    • Control (device & transmission)


Parity checking
Parity checking

  • Parity bit

  • Even or odd


Escape mechanisms
Escape mechanisms

  • Escape or ESC Character

  • Pro:

    • Increase codes

  • Con:

    • Code and decode the data


Specific codes
Specific Codes

  • Baudot code

  • American Standard Code for Information Interchange (ASCII)

  • Extended Binary Coded Decimal Interchange Code (EBCDIC)

  • Unicode

  • Binary Coded Decimal

  • N-out-of-M code


Baudot code
Baudot Code

  • 5 bits (32 code points)

  • ESC mechanism

    • Figure shift (uppercase)

    • Letter shift (lowercase)

  • Teletypewriters before 1965

  • No error checking


American standard code for information interchange ascii
American Standard Code for Information Interchange (ASCII)

  • By American National Standards Institute (ANSI)

  • 7654321 (7-bit or 128 characters)

  • Pros:

    • Easy sorting by computers

    • Used by microcomputers


Extended binary coded decimal interchange code ebcdic
Extended binary Coded Decimal Interchange Code (EBCDIC)

  • 8-bit code or 256 characters

  • IBM mainframe computers

  • 01234567


Unicode
Unicode

  • 16-bit or 65,536 characters

  • By Unicode Consortium for international languages

  • Used by Windows NT


Other codes
Other Codes

  • Binary Coded Decimal

    • 6-bit code Hollerith code

    • No standard

  • N-Out-Of-M Codes

    • M bits to transmit each character, n must be 1s

    • Error Detection

    • IBM’s 4-out-of-8


Control characters
Control Characters

  • Transmission control characters

    • SOH, STX, ETX, EOT, ACK, NAK, NUL

  • Device control characters

    • BEL, DC1 (X-ON), DC3 (X-OFF)

  • Format effect control characters

    • CR, LF, HT, VT


Code efficiency
Code Efficiency

  • Types of bits in a character

    • Information bits

    • Noninformation bits (parity bit)

  • Definition: No. of information bits divided by the total no. of bits in a character


Code conversion
Code Conversion

  • Harder from larger no. of bits code to smaller no. of bits code

  • Use ESC mechanism


Data compression compaction
Data Compression/Compaction

  • Types

    • Character compression/Huffman coding or adaptive Huffman coding (bits assignment)

    • Run length coding (repetitive characters)

    • Character stripping (heading & trailing characters)

    • Combination of the above three

  • Consideration

    • throughput

    • Storage and transmission cost

    • Hardware cost & software cost


Code encryption
Code Encryption

  • Voice

    • Scramble and descramble

  • Data

    • Symmetric key

      • Data encryption standard (DES) by National Institute of Standard and Technology (2 to 56)

      • Triple DES (2 to 112)

      • Key security

    • Asymmetric key or RSA encryption

    • Public key & private key

  • Consideration

    • Hardware and/or software cost

    • Time delay

    • Security management cost


Example of encryption i
Example of Encryption - I

  • Divide text into groups of 8 characters. Pad with blank at end as necessary

  • Select an 8-characters key

  • Rearrange text by interchanging adjacent characters

  • Translate each character into an ordinal number with blank as 0, A as 1, B as 2…

  • Add the ordinal number of the key to the results

  • Divide the total by 27 and retain the remainder

  • Translate the remainder back into a character to yield the cipher text


Example of encryption ii
Example of Encryption - II

  • Message: DATA COM

  • Key: PROTOCOL

  • A D A T C M O

  • 01 04 01 20 03 00 13 15

  • 01 04 01 20 03 00 13 15

  • 16 18 15 20 15 03 15 12

  • 17 22 16 40 18 03 28 27

  • 17 22 16 13 18 03 01 00

  • Q V P M R C A SPACE


Example of decryption i
Example of Decryption - I

  • Divide cipher text into groups of eight characters. Pad with blanks at end as necessary

  • Translate each cipher text alphabetic character and the encryption key into an ordinal number

  • For each group, subtract the ordinal number of the key value from the ordinal number of the cipher text

  • Add 27 to any negative number

  • Translate the number back to alphabetic equivalents

  • Rearrange the text by interchanging adjacent characters


Example of decryption ii
Example of Decryption - II

  • Q V P M R C A SPACE

  • 17 22 16 13 18 03 01 00

  • 17 22 16 13 18 03 01 00

  • 16 18 15 20 15 03 15 12

  • 01 04 01 -7 01 00 -14 -12

  • plus 27 27 27 27

  • 01 04 01 20 01 00 13 15

  • A D A T C M O

  • D A T A C O M


Points to remember
Points to Remember

  • Coding

  • Code efficiency and conversion

  • Compression/compaction

  • Code encryption/decryption


Discussion
Discussion

  • Design the efficient and secure coding system for an international company


Assignment
Assignment

  • Review chapters 1-7

  • Read chapters 8-9


ad