SlideShare a Scribd company logo
1 of 16
Module:3
Architecture of Special Purpose
Computing
System
Data Compressor
• The data compressor takes in a sequence of input symbols and
then produces a stream of output symbols.
• The input symbols are one byte in length and the output
symbols are variable length.
• Delivering each coded symbol separately is tedious.
• We will rely on the data compressor to pack the coded symbols
into an array.
• There is not a one-to-one relationship between the input and
output symbols, and we may have to wait for several input
symbols before a packed output word comes out.
Huffman coding for text compression
• Text compression algorithms aim at statistical reductions
in the volume of data.
• One commonly used compression algorithm is Huffman
coding.
• It makes use of information on the frequency of
characters to assign variable-length codes to characters.
• If shorter bit sequences are used to identify more frequent
characters, then the length of the total sequence will be
reduced.
• After sorting the characters by probability, we create a new
symbol by adding a bit.
• We then compute the joint probability of finding either one of
those characters and re-sort the table.
• The result is a coding tree.
• As a simple example of Huffman coding, assume that these
characters have the following probabilities P of appearance in
a message:
• Reading the codes off the tree from the root to the leaves, we obtain
the following coding of the characters.
• Once the code has been constructed, which in many applications is
done off-line, the codes can be stored in a table for encoding.
• This makes encoding simple, but clearly the encoded bit rate
can vary significantly depending on the input character
sequence.
• On the decoding side, because we do not know a priori the
length of a character’s bit sequence, the computation time
required to decode a character can vary significantly.
• The data compressor as discussed above is not a complete
system, but we can create at least a partial requirements list.
Requirements for data compressor
Specification
• For a fully functional Data Compression Module system, we
have to provide some additional behavior:
1. We have to be able to provide the compressor with a new
symbol table.
2. We should be able to flush the symbol buffer to cause the
system to release all pending symbols that have been partially
packed. We may want to do this when we change the symbol
table or in the middle of an encoding session to keep a
transmitter busy.
Definition of the data-compressor
class
• The class’s buffer and current-bit behaviors keep track of the
state of the encoding.
• The table attribute provides the current symbol table.
• The class has three methods as follows:
1. encode performs the basic encoding function. It takes in a 1-
byte input symbol and returns two values: a boolean showing
whether it is returning a full buffer and, if the boolean is true,
the full buffer itself.
2. new-symbol-table installs a new symbol table into the object
and throws away the current contents of the internal buffer.
3. flush returns the current state of the buffer, including the
number of valid bits in the buffer.
• We also need to define classes for the data buffer and the
symbol table.
• The data-buffer will be used to hold both packed symbols and
unpacked ones (such as in the symbol table).
• It defines the buffer itself and the length of the buffer.
• The insert function packs a new symbol into the upper bits of
the buffer; it also puts the remaining bits in a new buffer if the
current buffer is overflowed.
• The Symbol-table class indexes the encoded version of each
symbol.
• The class defines an access behavior for the table; it also
defines a load behavior to create a new symbol table.
• The relationships between these classes are shown in Figure
where the data compressor object includes one buffer and one
symbol table.
Relationships between classes in the
data compressor.
State diagram for encode behavior
State diagram for insert behavior

More Related Content

Similar to Special purpose computing system document

Similar to Special purpose computing system document (20)

Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Computer Networks
Computer NetworksComputer Networks
Computer Networks
 
Text compression
Text compressionText compression
Text compression
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compiler
 
INTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c languageINTRODUCTION TO C PROGRAMMING in basic c language
INTRODUCTION TO C PROGRAMMING in basic c language
 
Programming in C.pptx
Programming in C.pptxProgramming in C.pptx
Programming in C.pptx
 
Group presentation.pptx
Group presentation.pptxGroup presentation.pptx
Group presentation.pptx
 
THE PROCESSOR
THE PROCESSORTHE PROCESSOR
THE PROCESSOR
 
10600122065_Animesh mani (CD).pdf
10600122065_Animesh mani (CD).pdf10600122065_Animesh mani (CD).pdf
10600122065_Animesh mani (CD).pdf
 
Module 2
Module 2 Module 2
Module 2
 
SS & CD Module 3
SS & CD Module 3 SS & CD Module 3
SS & CD Module 3
 
Introduction to data compression.pptx
Introduction to data compression.pptxIntroduction to data compression.pptx
Introduction to data compression.pptx
 
Assembler
AssemblerAssembler
Assembler
 
C- language Lecture 6
C- language Lecture 6C- language Lecture 6
C- language Lecture 6
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Chapter 13_m5JAVANOTESAPPLETS,INPUT.pptx
Chapter 13_m5JAVANOTESAPPLETS,INPUT.pptxChapter 13_m5JAVANOTESAPPLETS,INPUT.pptx
Chapter 13_m5JAVANOTESAPPLETS,INPUT.pptx
 
EC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptxEC8691-MPMC-PPT.pptx
EC8691-MPMC-PPT.pptx
 
Compiler design Project
Compiler design ProjectCompiler design Project
Compiler design Project
 

Recently uploaded

一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理
cnzepoz
 
Balancing of rotating bodies questions.pptx
Balancing of rotating bodies questions.pptxBalancing of rotating bodies questions.pptx
Balancing of rotating bodies questions.pptx
joshuaclack73
 
一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理
cnzepoz
 
一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理
cnzepoz
 
1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptx1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptx
louise569794
 
Abortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy Cytotec
Abortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy CytotecAbortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy Cytotec
Abortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理
cnzepoz
 
一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理
cnzepoz
 
一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理
cnzepoz
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
cnzepoz
 
一比一原版UBC毕业证成绩单如何办理
一比一原版UBC毕业证成绩单如何办理一比一原版UBC毕业证成绩单如何办理
一比一原版UBC毕业证成绩单如何办理
cnzepoz
 
一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理
cnzepoz
 
一比一原版UMich毕业证成绩单如何办理
一比一原版UMich毕业证成绩单如何办理一比一原版UMich毕业证成绩单如何办理
一比一原版UMich毕业证成绩单如何办理
cnzepoz
 
一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理
cnzepoz
 
一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理
cnzepoz
 
一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理
cnzepoz
 

Recently uploaded (20)

一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理一比一原版UCB毕业证成绩单如何办理
一比一原版UCB毕业证成绩单如何办理
 
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
NO1 Qari kala jadu karne wale ka contact number kala jadu karne wale baba kal...
 
Balancing of rotating bodies questions.pptx
Balancing of rotating bodies questions.pptxBalancing of rotating bodies questions.pptx
Balancing of rotating bodies questions.pptx
 
一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理一比一原版迪肯大学毕业证成绩单如何办理
一比一原版迪肯大学毕业证成绩单如何办理
 
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
NO1 Qari Rohani Amil In Islamabad Amil Baba in Rawalpindi Kala Jadu Amil In R...
 
一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理一比一原版Otago毕业证成绩单如何办理
一比一原版Otago毕业证成绩单如何办理
 
1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptx1. WIX 2 PowerPoint for Work Experience.pptx
1. WIX 2 PowerPoint for Work Experience.pptx
 
Abortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy Cytotec
Abortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy CytotecAbortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy Cytotec
Abortion pills in Riyadh |•••@•••| +966572737505 |•••@•••| Buy Cytotec
 
China Die Casting Manufacturer & Supplier - Bian Diecast
China Die Casting Manufacturer & Supplier - Bian DiecastChina Die Casting Manufacturer & Supplier - Bian Diecast
China Die Casting Manufacturer & Supplier - Bian Diecast
 
一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理一比一原版UC Berkeley毕业证成绩单如何办理
一比一原版UC Berkeley毕业证成绩单如何办理
 
一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理一比一原版UVic毕业证成绩单如何办理
一比一原版UVic毕业证成绩单如何办理
 
一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理一比一原版ArtEZ毕业证成绩单如何办理
一比一原版ArtEZ毕业证成绩单如何办理
 
Aluminum Die Casting Manufacturers in China - BIAN Diecast
Aluminum Die Casting Manufacturers in China - BIAN DiecastAluminum Die Casting Manufacturers in China - BIAN Diecast
Aluminum Die Casting Manufacturers in China - BIAN Diecast
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
 
一比一原版UBC毕业证成绩单如何办理
一比一原版UBC毕业证成绩单如何办理一比一原版UBC毕业证成绩单如何办理
一比一原版UBC毕业证成绩单如何办理
 
一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理一比一原版AIS毕业证成绩单如何办理
一比一原版AIS毕业证成绩单如何办理
 
一比一原版UMich毕业证成绩单如何办理
一比一原版UMich毕业证成绩单如何办理一比一原版UMich毕业证成绩单如何办理
一比一原版UMich毕业证成绩单如何办理
 
一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理一比一原版UofM毕业证成绩单如何办理
一比一原版UofM毕业证成绩单如何办理
 
一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理一比一原版GT毕业证成绩单如何办理
一比一原版GT毕业证成绩单如何办理
 
一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理一比一原版SUT毕业证成绩单如何办理
一比一原版SUT毕业证成绩单如何办理
 

Special purpose computing system document

  • 1. Module:3 Architecture of Special Purpose Computing System
  • 2. Data Compressor • The data compressor takes in a sequence of input symbols and then produces a stream of output symbols. • The input symbols are one byte in length and the output symbols are variable length. • Delivering each coded symbol separately is tedious. • We will rely on the data compressor to pack the coded symbols into an array. • There is not a one-to-one relationship between the input and output symbols, and we may have to wait for several input symbols before a packed output word comes out.
  • 3. Huffman coding for text compression • Text compression algorithms aim at statistical reductions in the volume of data. • One commonly used compression algorithm is Huffman coding. • It makes use of information on the frequency of characters to assign variable-length codes to characters. • If shorter bit sequences are used to identify more frequent characters, then the length of the total sequence will be reduced.
  • 4. • After sorting the characters by probability, we create a new symbol by adding a bit. • We then compute the joint probability of finding either one of those characters and re-sort the table. • The result is a coding tree.
  • 5. • As a simple example of Huffman coding, assume that these characters have the following probabilities P of appearance in a message:
  • 6. • Reading the codes off the tree from the root to the leaves, we obtain the following coding of the characters. • Once the code has been constructed, which in many applications is done off-line, the codes can be stored in a table for encoding.
  • 7. • This makes encoding simple, but clearly the encoded bit rate can vary significantly depending on the input character sequence. • On the decoding side, because we do not know a priori the length of a character’s bit sequence, the computation time required to decode a character can vary significantly. • The data compressor as discussed above is not a complete system, but we can create at least a partial requirements list.
  • 9. Specification • For a fully functional Data Compression Module system, we have to provide some additional behavior: 1. We have to be able to provide the compressor with a new symbol table. 2. We should be able to flush the symbol buffer to cause the system to release all pending symbols that have been partially packed. We may want to do this when we change the symbol table or in the middle of an encoding session to keep a transmitter busy.
  • 10. Definition of the data-compressor class
  • 11. • The class’s buffer and current-bit behaviors keep track of the state of the encoding. • The table attribute provides the current symbol table. • The class has three methods as follows: 1. encode performs the basic encoding function. It takes in a 1- byte input symbol and returns two values: a boolean showing whether it is returning a full buffer and, if the boolean is true, the full buffer itself. 2. new-symbol-table installs a new symbol table into the object and throws away the current contents of the internal buffer. 3. flush returns the current state of the buffer, including the number of valid bits in the buffer.
  • 12. • We also need to define classes for the data buffer and the symbol table. • The data-buffer will be used to hold both packed symbols and unpacked ones (such as in the symbol table).
  • 13. • It defines the buffer itself and the length of the buffer. • The insert function packs a new symbol into the upper bits of the buffer; it also puts the remaining bits in a new buffer if the current buffer is overflowed. • The Symbol-table class indexes the encoded version of each symbol. • The class defines an access behavior for the table; it also defines a load behavior to create a new symbol table. • The relationships between these classes are shown in Figure where the data compressor object includes one buffer and one symbol table.
  • 14. Relationships between classes in the data compressor.
  • 15. State diagram for encode behavior
  • 16. State diagram for insert behavior