Data Representation and Logic Basics: Revision and References

Shared revision, practice questions, answer explanations and references from the original module.

By Akhilesh Saini

Module-level quick revision

TopicHigh-yield factMistake to avoid
BinaryBase 2; symbols 0 and 1Treating 10₂ as decimal 10
OctalBase 8; digits 0–7Allowing 8 or 9 as an octal digit
DecimalBase 10; digits 0–9Assuming every written numeral is decimal
HexadecimalBase 16; 0–9, A–FForgetting A=10, F=15
Binary → octalGroup 3 bits from the rightGrouping into four bits
Binary → hexadecimalGroup 4 bits from the rightGrouping from the left
Decimal → binaryDivide by 2; reverse remaindersReading remainders top-down
ASCIIStandard 7-bit, 128 code valuesCalling it a universal multilingual encoding
UnicodeAssigns code points to charactersCalling every character exactly 16 bits
UTF-8Variable-length 1–4 bytes per code pointConfusing it with a code point or encryption
ANDBoth inputs need to be trueTreating AND like OR
ORAt least one input is trueConfusing OR with XOR for (1,1)
XORTrue when two inputs differSaying XOR returns 1 for (1,1)
NAND/NORInverses; universal gatesForgetting the inversion
BooleanTrue/false valueTreating text "True" as always a native Boolean
CSVSimple tabular text exchangeAssuming it preserves full workbook features
PDFDocument presentation formatAssuming a PDF is automatically authentic
ZIPFile archiveAssuming every ZIP is encrypted
File extensionUseful filename hintTreating it as reliable proof of contents

Mixed review: five short prompts

  1. A number uses symbols 0–7. What base is it likely written in? Answer: Octal (base 8).
  2. Write decimal 10 in binary. Answer: 1010₂ (8 + 2).
  3. Which standard assigns U+20B9 to the rupee sign? Answer: Unicode; UTF-8 is one way to encode it.
  4. What is 1 XOR 1? Answer: 0, because XOR is true when two inputs differ.
  5. Is a renamed .txt file automatically a valid .pdf? Answer: No; renaming does not change the stored format.

Sources and further reading

This module uses original explanations and original exam-style questions. Technical qualifications were checked against the following standards and educational references:

  1. RFC Editor — RFC 20: ASCII Format for Network Interchange — standard 7-bit ASCII code and its character representation.
  2. Unicode Consortium — Technical Introduction — characters, Unicode code points, and encoding forms.
  3. Unicode Consortium — UTF-8, UTF-16, UTF-32 FAQ — encoding lengths, UTF-8 and ASCII compatibility.
  4. NIST — Binary Prefixes — decimal versus binary unit terminology, linked to prior memory-units study.
  5. MDN — Media Types (MIME Types) — format identifiers, extensions, file signatures and handling precautions.
  6. MDN — Common Media Types — common documents, media and archive formats.
  7. MDN — JavaScript Data Types and Data Structures — examples illustrating types; exact type systems vary between software environments.