10
KOMPRESI Jim Michael Widi

KOMPRESI

  • Upload
    glenna

  • View
    35

  • Download
    0

Embed Size (px)

DESCRIPTION

KOMPRESI. Jim Michael Widi. KOMPRESI. Berguna untuk memanfaatkan file. Banyak algoritma yang digunakan untuk mengkompres data, antara lain : ASCII (?), Huffman. Lempel-Ziv dan kombinasinya, dll. - PowerPoint PPT Presentation

Citation preview

Page 1: KOMPRESI

KOMPRESIKOMPRESI

Jim Michael Widi

Page 2: KOMPRESI

KOMPRESI• Berguna untuk memanfaatkan file.• Banyak algoritma yang digunakan

untuk mengkompres data, antara lain : ASCII (?), Huffman. Lempel-Ziv dan kombinasinya, dll.

• Metoda ASCII digunakan pada file teks dengan cara menghilangkan bit ke-8 dari setiap bytenya. Pada file teks, bit ke-8 dari setiap bytenya pasti 0.

Page 3: KOMPRESI

KOMPRESI• Kompresi dengan metode ASCII

Contoh String : A B C D (ada 32 bit)8 bit x 4 karakter = 32

Page 4: KOMPRESI

Contoh dengan metode ASCII

A = 0 1 0 0 0 0 0 1

B = 0 1 0 0 0 0 1 0

C = 0 1 0 0 0 0 1 1

D = 0 1 0 0 0 1 0 0

Kode ASCII

Bit ke-8 dihilangkan

Page 5: KOMPRESI

Contoh dengan metode ASCII

• Sehingga menjadi : 1 0 0 0 0 0 11 0 0 0 0 1 01 0 0 0 0 1 1 1 0 0 0 1 0 0

A

B

C

D

28 Bit

Page 6: KOMPRESI

KOMPRESI• Kompresi dengan metode Huffman

Contoh :

“ A K U S U K A S A S A “

Page 7: KOMPRESI

Contoh

“ A K U S U K A S A S A “A = 4

K = 2

U = 2

S = 3

Jumlah karakter

A4 S3 K2 U2Urutkan dari kiri, mulai yang terbesar.

KU4A4 S3

K2 U2

Gabungkan jumlah karakter yang terkecil

Page 8: KOMPRESI

Contoh

KUS7 A4

S3

K2 U2

KU4

AKUS11

KUS7

K2 U2

KU4

A4

S3

Page 9: KOMPRESI

ContohAKUS11

KUS7

K2 U2

KU4

A4

0

0

0

1

1

S3

1

A = 1

S = 0 1

U = 0 0 1

K = 0 0 0

1 000 001 01 001 000 1 01 1 01 1A K U S U K A S A S A

Page 10: KOMPRESI

LatihanBuat Kompresi dengan metode Huffman1. “AKUSUKAZIZI“2. “KAKIKUKAKU“3. “KENAPAAKU“4. “AKUSUKAPIZZA”5. “UNIVERSITAS BUDI LUHUR”6. “Fakultas Teknologi Informasi”7. “Fakultas Sistem Informasi”