{"base":{"id":"cs8-13","subject":"Systems","title":"Text as numbers: ASCII","scene":"chip","steps":[{"mode":"ascii","eyebrow":"Character codes","title":"Every letter is a number","body":"Computers only store numbers, so every character has a code. ASCII is a code table: A is 65, B is 66, and so on. Move the slider through the table.","controls":[{"id":"code","label":"ASCII code","min":48,"max":122,"step":1,"value":65}]},{"mode":"word","eyebrow":"Words","title":"Capital or small?","body":"A word is stored as a list of codes. Capital and small letters have different codes, which is why passwords care about capitals. Compare the three words.","actions":[{"id":"w0","label":"“Hi”"},{"id":"w1","label":"“CAT”"},{"id":"w2","label":"“cat”"}],"words":["Hi","CAT","cat"]},{"mode":"send","eyebrow":"Sending text","title":"Eight bits per letter","body":"To send a message, each character's code travels as 8 bits. The receiver uses the same table to turn the bits back into letters. Send the message.","actions":[{"id":"send","label":"Send the message"}],"message":"Yes!"},{"mode":"quiz","eyebrow":"Check yourself","title":"Decode it","body":"The ASCII codes 68, 79, 71 arrive. (A = 65, B = 66 …)","question":"Which word is it?","options":["CAT","dog","DOG"],"answer":2,"right":"Correct. 68 = D, 79 = O, 71 = G. Capitals, because the codes are under 97.","wrong":"Not quite. Count on from A = 65.","look":"ascii"}],"more":[{"type":"cards","id":"ideas","eyebrow":"Popular idea vs science","title":"Common mix-ups","items":[{"tag":"Popular idea","title":"\"The computer stores the shape of each letter.\"","body":"It stores a number. A font turns the number into a shape on screen."},{"tag":"Popular idea","title":"\"A and a are the same to a computer.\"","body":"A is 65 and a is 97. Different codes, different characters."},{"tag":"Popular idea","title":"\"The digit 5 in a message is stored as the number 5.\"","body":"As a character, '5' has the code 53."}]},{"type":"cards","id":"ranges","eyebrow":"ASCII table","title":"Codes to remember","items":[{"tag":"32","title":"Space","body":"Even a space has a code."},{"tag":"48–57","title":"Digits 0–9","body":"'0' is 48, '9' is 57."},{"tag":"65–90","title":"Capitals A–Z","body":"A is 65, Z is 90."},{"tag":"97–122","title":"Small letters a–z","body":"Each small letter is 32 more than its capital."}]},{"type":"cards","id":"unicode","eyebrow":"Going further","title":"Beyond ASCII","items":[{"tag":"Unicode","title":"Every language, and emoji","body":"ASCII has only 128 codes: enough for English, not for Sinhala, Tamil, Chinese or emoji. Unicode gives codes to over 150,000 characters. Its first 128 codes match ASCII."}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Secret codes","items":[{"title":"ASCII messages","time":"15 minutes","need":["Paper and a pen","A partner"],"steps":["Write A = 65 to Z = 90 down the side of your paper.","Write a short secret word as codes, e.g. 72 73 = HI.","Swap with your partner and decode each other's words.","Now try binary: write one letter's code as 8 bits using place values."],"why":"Both of you used the same table, so the message survived. Computers rely on this agreement.","safety":"No safety risks."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Six more questions","questions":[{"question":"What does ASCII do?","options":["Makes files smaller","Connects to Wi-Fi","Gives each character a number code"],"answer":2,"right":"Correct. It's a character code table.","wrong":"Not quite. Think of A = 65."},{"question":"What is the code for C if A is 65?","options":["66","67","68"],"answer":1,"right":"Correct. A 65, B 66, C 67.","wrong":"Not quite. Count on from A."},{"question":"Why is “Cat” different from “cat” to a computer?","options":["It isn't different","Capitals use more bits","C and c have different codes"],"answer":2,"right":"Correct. 67 versus 99.","wrong":"Not quite. Compare the first codes."},{"question":"In this lesson each character is sent as one byte. How many bits is that?","options":["8","2","100"],"answer":0,"right":"Correct. A byte is 8 bits. ASCII codes need only 7, so they fit inside one byte.","wrong":"Not quite. How many bits make a byte?"},{"question":"Why must sender and receiver use the same code table?","options":["Otherwise the codes turn into the wrong characters","To save power","So it goes faster"],"answer":0,"right":"Correct. Same codes, same letters.","wrong":"Not quite. What if 65 meant something else?"},{"question":"Which code system includes emoji and Sinhala letters?","options":["Binary only","Unicode","RLE"],"answer":1,"right":"Correct. Unicode covers many languages.","wrong":"Not quite. ASCII has only 128 codes."}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can explain…","items":["why characters need number codes","how to use an ASCII table","why capital and small letters have different codes","how text is sent as bits","why both computers must use the same code table"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"character","meaning":"A letter, digit, space or symbol."},{"word":"character set","meaning":"A list of characters and their codes."},{"word":"ASCII","meaning":"A 7-bit character code with 128 characters."},{"word":"Unicode","meaning":"A larger code that covers almost every writing system."},{"word":"case-sensitive","meaning":"Treating capital and small letters as different."}]},{"type":"sources","id":"sources","title":"Sources","items":["ANSI X3.4 (ASCII)","The Unicode Consortium"]}]},"overlay":null}