Skip to content
Exercises · Q11

Q.How does computer understand the following text? (hint: 7 bit ASCII code).

(i) HOTS
(ii) Main
(iii) CaSe
Punjab PsebTextbookSubjective· 3mImportance★★★★★est
80% · 36/45 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

A computer never stores letters — it stores each character's 7-bit ASCII code as binary; the text is simply the concatenation of those codes, and upper/lower case letters carry different codes.

The idea. ASCII (American Standard Code for Information Interchange) assigns every character a decimal code 0-127, which fits in 7 bits. When you type text, each character is mapped to its code and the code to binary — that bit stream is all the machine "understands".

(i) HOTS

CharacterASCII (decimal)7-bit binary
H721001000
O791001111
T841010100
S831010011

Stream: 1001000 1001111 1010100 1010011

(ii) Main

CharacterASCII (decimal)7-bit binary
M771001101
a971100001
i1051101001
n1101101110

Stream: 1001101 1100001 1101001 1101110

(iii) CaSe

CharacterASCII (decimal)7-bit binary
C671000011
a971100001
S831010011
e1011100101

Stream: 1000011 1100001 1010011 1100101

Generate the codes in Python:

for word in ["HOTS", "Main", "CaSe"]:
    print(word, "->", " ".join(format(ord(c), "07b") for c in word))

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.