[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-564703-105":53,"doc-detail-564703-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","chapter-2-codes","Chapter 2 - Codes","","Chapter 2 explains how to represent complex objects using arrays of bits instead of a single bit. It introduces a simple communication model with symbols encoded into bit arrays, transmitted, and decoded to recover the original symbol. The chapter then examines key code-design concerns, starting with symbol space size, including cases with 2, powers of 2, finite non-powers of 2, infinite countable, and infinite uncountable symbol sets. It also discusses how to handle spare code capacity through strategies such as ignoring, mapping, reserving, control codes, and abbreviations.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/chapter-2-codes/564703/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/chapter-2-codes/564703.png","ImageObject",442,249,{"name":88,"@type":89},"asda1da","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-25","2026-10-12",true,{"@type":98,"interactionType":99,"userInteractionCount":79},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"Why are arrays of bits needed instead of a single bit?","Question",{"text":108,"@type":109},"A single bit works only when exactly two answers are possible. For more complex objects with many possible values, the chapter focuses on representing them using arrays of bits.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"What is symbol space size in code design?",{"text":113,"@type":109},"Symbol space size is the number of symbols that must be encoded. The chapter uses it to determine how many bits are needed under different symbol-set assumptions.",{"name":115,"@type":106,"acceptedAnswer":116},"How can unused (spare) code patterns be handled?",{"text":117,"@type":109},"When the number of symbols is not an integral power of 2, some bit patterns remain unused. The chapter lists strategies such as ignoring them, mapping them to other values, reserving them for future use, using them for control codes, or using them for common abbreviations.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},564703,1792403975,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":79,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":135,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":141},3985747861852,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","Chapter 2  \nCodes  \nIn the previous chapter we examined the fundamental unit of information, the bit, and its various abstract representations: the Boolean bit (with its associated Boolean algebra and realization in combinational logic circuits), the control bit, the quantum bit, and the classical bit.  \nA single bit is useful if exactly two answers to a question are possible. Examples include the result of a coin toss (heads or tails), the gender of a person (male or female), the verdict of a jury (guilty or not guilty), and the truth of an assertion (true or false) . Most situations in life are more complicated. This chapter concerns ways in which complex objects can be represented not by a single bit, but by arrays of bits.  \nIt is convenient to focus on a very simple model of a system, shown in Figure 2.1, in which the input isone of a predetermined set of objects, or \\symbols,\" the identity of the particular symbol chosen is encoded in an array of bits, these bits are transmitted through space or time, and then are decoded at a later time or in a di􀀋erent place to determine which symbol was originally chosen. In later chapters we will augment this model to deal with issues of robustness and e􀀎ciency.  \n-  \n-  \n-  \nInput  \n(Symbols)  \n(Arrays of Bits) (Arrays of Bits)  \nOutput  \n(Symbols)  \nCoder  \nChannel  \nDecoder  \nFigure 2.1: Simple model of a communication system  \nIn this chapter we will look into several aspects of the design of codes, and show some examples in which these aspects were either done well or not so well. Individual sections will describe codes that illustrate the important points. Some objects for which codes may be needed include:  \n􀀏 Letters: BCD, EBCDIC, ASCII, Unicode, Morse Code  \n􀀏 Integers: Binary, Gray, 2's complement  \nAuthor: Paul Pen􀀌eld, Jr.  \nThis document: [http://www.mtl.mit.edu/Courses/6.050/2007/notes/chapter2.pdf](http://www.mtl.mit.edu/Courses/6.050/2007/notes/chapter2.pdf)[ ](http://www.mtl.mit.edu/Courses/6.050/2007/notes/chapter2.pdf)[Version 1.4](Version 1.4) , [February 5](February 5) , [2007](2007). Copyright 􀀍c 2007 Massachusetts Institute of Technology  \nStart of notes 􀀁 back 􀀁 next j 6.050J/2.110J home page j Site map j Search j About this document j Comments and inquiries  \n􀀏 Numbers: Floating-Point  \n􀀏 Proteins: Genetic Code  \n􀀏 Telephones: NANP, International codes  \n􀀏 Hosts: Ethernet, IP Addresses, Domain names  \n􀀏 Images: TIFF, GIF, and JPEG  \n􀀏 Audio: MP3  \n􀀏 Video: MPEG  \n2.1 Symbol Space Size  \nThe 􀀌rst question to address is the number of symbols that need to be encoded. This is called the symbol space size. We will consider symbol spaces of di􀀋erent sizes:  \n􀀏 1  \n􀀏 2  \n􀀏 Integral power of 2  \n􀀏 Finite  \n􀀏 In􀀌nite, Countable  \n􀀏 In􀀌nite, Uncountable  \nIf the number of symbols is 2, then the selection can be encoded in a single bit. If the number of possible symbols is 4, 8, 16, 32, 64, or another integral power of 2, then the selection may be coded in the number of bits equal to the logarithm, base 2, of the symbol space size. Thus 2 bits can designate the suit (clubs, diamonds, hearts, or spades) of a playing card, and 5 bits can encode the selection of one student in a class of 32. As a special case, if there is only one symbol, no bits are required to specify it. A dreidel is a four-sided toy marked with Hebrew letters, and spun like a top in a children's game, especially at Hanukkah. The result of each spin could be encoded in 2 bits.  \nIf the number of symbols is 􀀌nite but not an integral power of 2, then the number of bits that would work for the next higher integral power of 2 can be used to encode the selection, but there will be some unused bit patterns. Examples include the 10 digits, the six faces of a cubic die, the 13 denominations of a playing card, and the 26 letters of the English alphabet. In each case, there is spare capacity (6 unused patterns in the 4-bit representation of digits, 2 unused patterns in the 3-bit representation of a die, etc.) Wha","cbCaiuF7UXaFbDbH","https://ap.wps.com/l/cbCaiuF7UXaFbDbH","pdf",542804,20,"English","# 2.1 Symbol Space Size\n## 2.1.1 Finite and power-of-2 symbol spaces\n## 2.1.2 Finite non-power-of-2 symbol spaces\n## 2.1.3 Infinite countable and uncountable sets\n# 2.2 Use of Spare Capacity\n## 2.2.1 Strategies for unused patterns","[{\"question\":\"Why are arrays of bits needed instead of a single bit?\",\"answer\":\"A single bit works only when exactly two answers are possible. For more complex objects with many possible values, the chapter focuses on representing them using arrays of bits.\"},{\"question\":\"What is symbol space size in code design?\",\"answer\":\"Symbol space size is the number of symbols that must be encoded. The chapter uses it to determine how many bits are needed under different symbol-set assumptions.\"},{\"question\":\"How can unused (spare) code patterns be handled?\",\"answer\":\"When the number of symbols is not an integral power of 2, some bit patterns remain unused. The chapter lists strategies such as ignoring them, mapping them to other values, reserving them for future use, using them for control codes, or using them for common abbreviations.\"}]","Chapter 2 - Codes | PDF",1791843740,7]