MCA · MCA C1001
Introduction to computers: data and computation
Build the foundations: programmable systems, input and output, data representation, encoding, and numerical correctness.
On this page
Before you begin: the foundations you need
This chapter assumes no prior programming experience. You need basic arithmetic and a willingness to trace a sequence of steps. This chapter explains bits, instructions, state, encodings, and data contracts. Processor organisation and performance have their own linked chapters. Read the worked examples rather than memorising definitions in isolation.
The ideas apply to computer-science and computing students internationally. The course and unit labels locate the chapter in this library; they do not change the underlying technical explanations. History and networking are separate chapters within the same unit, not topics you should infer from this introduction.
Four questions to carry through the chapter
- Representation: how is a real-world quantity encoded?
- Transformation: which operations change that representation?
- State: what must the system remember between operations?
- Evidence: how can you tell whether the result is correct and the design is suitable?
A calculation is a small example. Suppose you must calculate a percentage. Marks and maximum marks are inputs. Addition and division are transformations. A running total is state. Boundary examples, valid ranges, and an independently calculated result provide evidence. The same questions scale to databases, networks, and distributed applications.
1. What is a computer?
A computer is a programmable system that represents and processes data according to instructions. Most computers we use are electronic and digital: they operate on discrete representations, usually binary values. They can receive inputs, perform arithmetic and logical operations, maintain state, and produce outputs.
The word programmable matters. The same laptop can calculate a result, edit an image, or run a database because its instructions can change. A device that performs one fixed electronic function is not automatically a general-purpose computer. Embedded computers may serve a narrow purpose while still executing software.
A definition is only the starting point. At MCA level, ask: What is being represented? Which instructions operate on it? Where is the state stored? What assumptions make the result meaningful?
2. Input, processing, output, and storage
The input–process–output model describes a task from the user's perspective. Storage allows information to be retained for later use. It is a useful model, not a claim that every computation has exactly four separate physical boxes or follows a single straight path.
Worked example: a marks report
- Input: a student's identifier and marks, obtained from a form or a file.
- Validation: check that marks are numbers within the permitted range and that all required subjects are present.
- Processing: calculate the total and percentage using the actual assessment rules.
- Output: display a report. A printer or another application could also receive it.
- Storage: save a record so it can be retrieved. A displayed result is not necessarily a saved result.
Input is not limited to keyboards, and output is not limited to screens. A sensor supplies input; an actuator receives output. A network interface can both receive and transmit data. A disk operation may read data into a program or write results back to storage.
3. Data, information, and representation
Data is a representation that a system records or processes. Information is the meaning a person or another system obtains by interpreting that data in context. The distinction depends on use: the output of one process can become the input data of another.
The value 75 is ambiguous without context. It might mean a mark, a temperature, or a percentage. Knowing that it is 75 marks out of 100 changes what can be inferred. Units, valid ranges, field names, and data types are part of the interpretation.
Bits do not carry their own meaning
A bit has two possible values. An eight-bit pattern has 256 possible combinations. The pattern 01000001 can denote unsigned integer 65 or, under ASCII, the character A. An encoding or type tells the system how to interpret the pattern. Text, images, and instructions use different interpretation rules.
A byte is eight bits in modern systems. More bits allow more distinct patterns, but do not automatically make the data accurate or useful. A number format may have a limited range or precision. Number systems and overflow are studied in detail in Unit 2.
Accuracy starts before calculation
If a marks program accepts 750 instead of 75, arithmetic may be performed exactly and the report may still be wrong. Check data validity, algorithm correctness, numerical representation, and the rules used to interpret the result. This is the practical meaning of garbage in, garbage out.
Derive the number of representable values
For each bit there are two choices. With two independent bits there are 2 × 2 = 4 patterns: 00, 01, 10, 11. With n bits there are 2 raised to n patterns. If all patterns encode non-negative integers starting at zero, the largest is 2 raised to n minus 1. Eight bits therefore represent unsigned values from 0 through 255.
This is a count of patterns, not a universal rule for every data type. A signed representation allocates patterns differently. A character encoding assigns patterns to symbols or sequences. A floating-point format divides bits into fields with its own interpretation. Never derive a type’s range from the word “byte” alone.
Worked example: interpret one byte
In 01000001, the set bits have place values 64 and 1. The unsigned integer is therefore 65. Under ASCII it represents A. Add one to the integer and you get 66; concatenate the character A with another character and you create a string. Operations depend on meaning, not just on the physical pattern.
Data quality and a usable contract
A contract specifies valid inputs, expected outputs, and behaviour on errors. For a marks calculator, say whether absent marks are allowed, whether fractional marks are valid, whether different subjects have different maxima, and whether rounding occurs only for display. Missing data and zero are not interchangeable.
Check completeness, range, type, consistency, and origin where relevant. A field can be syntactically valid yet wrong: 75 is a permitted mark but may belong to a different student. Validation catches specified invalid cases; it does not establish that every accepted fact is true.
Numerical accuracy and representation limits
Many decimal fractions have no exact finite binary fractional representation. Common floating-point operations therefore use nearby representable values. Rounding the displayed result does not make the stored value exact. A suitable representation and comparison rule depend on the problem.
Do not use approximate arithmetic where the specification requires exact equality without considering alternatives. Integer minor units, decimal arithmetic, and rational arithmetic each have costs and limits. This distinction is part of system correctness, not merely a formatting issue.
Questions and answers
Easy: explain the idea. Medium: apply or compare it. Hard: analyse assumptions and trade-offs. Tags describe the question’s purpose; interview questions are original practice, not claims about a specific employer.
A computer performs operations on represented data under the control of instructions. Being electronic is not enough: an amplifier can alter a signal without being a general-purpose programmable computer. A laptop changes tasks by running different programs. An embedded controller may run only a small set of programs but still contains a processor, stored instructions, and state.
In an exam, give the definition, explain programmability, and illustrate input, processing, state, and output with one task. Avoid defining every computer as a desktop PC.
Interpretation provides context. The value 75 could describe marks, temperature, or a count. The record “75 marks out of 100 in Algorithms” allows a meaningful inference. Processing alone does not guarantee useful information: summing unrelated quantities produces a number without a useful interpretation.
Preserve units, field definitions, timestamps, and origin when those affect meaning. The result of one system may become another system’s input data.
Two distinguishable logical states are practical to implement with electronic switching circuits. Real voltages are continuous; a circuit interprets ranges as logical values and tolerates some noise. Ten reliably separated states would require tighter discrimination under comparable conditions.
This is an engineering choice, not a law saying computation must use binary. Decimal and other computing designs exist. Binary also does not mean every transistor is always either perfectly at zero volts or perfectly at one volt.
Yes. The pattern does not contain its interpretation. An encoding, type, instruction set, or file format defines what it means. The byte 01000001 is unsigned integer 65 or ASCII A. Treating arbitrary bytes as executable instructions is a separate interpretation with different validity rules.
This is why reading a binary file as text can produce nonsense, and why a program must know a field’s type before operating on its bytes.
UTF-8 encodes a Unicode scalar value using one to four bytes. ASCII characters use one byte; other characters can use more. A user-perceived character may also consist of multiple code points, such as a letter followed by a combining mark.
Distinguish encoded bytes, code points, and grapheme clusters. A field limit of 20 bytes is not necessarily a limit of 20 visible characters. Define which measure an application needs instead of assuming every character occupies one byte.
Common binary floating-point formats cannot exactly represent many decimal fractions, including 0.1. Values and operations can be rounded to nearby representable numbers. Display formatting can hide that difference without removing it.
Choose an appropriate representation and comparison rule. Integer minor units may suit bounded money calculations; decimal or rational arithmetic may suit other requirements. A tolerance must reflect the domain, not an arbitrary large constant that conceals mistakes.
Revision checkpoints
Explain the main mechanisms in your own words, reproduce the worked examples without looking, and answer the tagged questions before expanding their solutions. When an answer depends on assumptions, state them explicitly.
References and further reading
The supplied MCA syllabus defines the topic placement (Fundamentals of Computers, PDF page 9). The chapter explains its prerequisites and worked examples directly; the references support verification and optional further study. The explanations, examples, diagrams, and practice questions here are original teaching material.
- Harvard CS50, Lecture 0: introductory problem solving and binary representations.
- Operating Systems: Three Easy Pieces, Introduction to Operating Systems, by Remzi and Andrea Arpaci-Dusseau: processes, resource management, and persistence.
- Python documentation: floating-point limitations: representation error and numeric comparisons.
- Unicode Consortium: UTF encodings: bytes, code points, and encodings.
- Cornell computer architecture lecture: performance: performance metrics and Amdahl’s law.
- OSTEP: I/O devices: polling, interrupts, and DMA.
- MIT: automata, computability, and complexity: the boundaries of algorithmic computation.
Spot an error? Report it to Study Shelf with this page link.