PROJECTENGRAM

DATA REPRESENTATION - CHARACTERS AND BOOLEAN

6.0 Data Representation - Characters and Boolean

Tags: #◇Computer Science #◇CCICOMP #◇Problem Solving #◇M2


◇Overview

Since computers process only bits, character and boolean data cannot be represented directly. Characters are represented indirectly by mapping them to numeric values via standard coding tables, balancing compactness with representational range. Standard methods include ASCII and Unicode. Boolean data, consisting solely of true or false values, conceptually requires only a single bit, but CPU designers often use integer formats where 00 corresponds to false and any non-zero value corresponds to true. Operations on booleans rely on logic gates, extending naturally to bitwise operations that manipulate entire bit strings simultaneously.

◇Key Definitions

Character Encodings ASCII (American Standard Code for Information Interchange): A standard 77-bit (or 88-bit) encoding format supporting at least 128128 characters, commonly used in early and modern systems for English and basic symbols. Unicode: A newer 1616-bit or 3232-bit encoding standard designed to support a vast array of international characters. ASCII is a subset of Unicode. Strings: Complex data types composed of sequential series of character codes. Device Control Codes: Non-printable characters (e.g., Carriage Return CR, Line Feed LF) used for formatting text when communicating with output devices.

Boolean Operations & Logic Gates NOT (Inverter): Y=A′Y = A'. Negates the input. Output is 11 if input is 00, and vice-versa. AND: Y=ABY = AB. Outputs true (11) only if all inputs are true. OR: Y=A+BY = A + B. Outputs true (11) if at least one input is true. XOR (Exclusive-OR): Y=A⊕BY = A \oplus B or Y=A′B+AB′Y = A'B + AB'. Outputs true (11) if the inputs differ (an odd number of 11s).

◇Worked Examples

1. ASCII String Interpretation

Given the hexadecimal value 434349434F4D50434349434\text{F}4\text{D}50, what is the ASCII interpretation?
By parsing every two hex digits: 43h→’C’43\text{h} \to \text{'C'} 43h→’C’43\text{h} \to \text{'C'} 49h→’I’49\text{h} \to \text{'I'} 43h→’C’43\text{h} \to \text{'C'} 4Fh→’O’4\text{F}\text{h} \to \text{'O'} 4Dh→’M’4\text{D}\text{h} \to \text{'M'} 50h→’P’50\text{h} \to \text{'P'}
Result: "CCICOMP"

2. Bitwise Logic Operations Bitwise NOT: NOT F3h  ⟹  NOT 111100112=000011002=0Ch\text{NOT } \text{F}3\text{h} \implies \text{NOT } 11110011_2 = 00001100_2 = 0\text{C}\text{h} Bitwise AND: 23h AND 01h23\text{h} \text{ AND } 01\text{h} (Masking to check if a number is odd)

23h=00100011223\text{h} = 00100011_2
01h=00000001201\text{h} = 00000001_2
Result: 000000012  ⟹  00000001_2 \implies Odd (true) Bitwise OR: 111100112 OR 100001012=11110111211110011_2 \text{ OR } 10000101_2 = 11110111_2 Bitwise XOR: 111100112 XOR 100001012=01110110211110011_2 \text{ XOR } 10000101_2 = 01110110_2

3. Boolean Functions

A single-bit adder can be described by boolean functions: Sum: Y=A′B+AB′Y = A'B + AB' (A XOR BA \text{ XOR } B) Carry: C=ABC = AB (A AND BA \text{ AND } B)

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

Because computers process only bits, how are character data types represented internally?

Q2

Which standard is a 7-bit or 8-bit encoding format commonly used in early systems for English and basic symbols?

Q3

What is the primary advantage of the Unicode standard over ASCII?

Q4

In CPU logic design, how are Boolean true and false values typically represented when conceptualized as integer formats?

Q5

Which logic gate outputs true (1) only if ALL of its inputs are true?

Q6

What is the function of an XOR (Exclusive-OR) logic gate?

Q7

Non-printable characters like Carriage Return and Line Feed are examples of:

Q8

What is the result of performing a Bitwise NOT on the binary value 11110011?

Q9

Which logic gate operation is equivalent to the Boolean sum function Y = A'B + AB' in a single-bit adder?

Q10

When parsing the hexadecimal string 434349434F4D50, what type of data structure is being interpreted?