TA ICT 1st Revison Guide IGCSE Venkata Dasi

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Revision guide for first CS TA:

1. Binary, Denary, Hexadecimal,


2. Binary addition and subtraction, Overflow,
3. 1s and 2s Compliment,
4. Logical binary shifts,
5. Program Development life cycle,
6. Decomposition,
7. Algorithms
8. ASCII and Unicode,
9. Images.

Binary

 Base 2: Uses only 0s and 1s.

 Digits: Bits.

 Examples: 0, 1, 10, 11, 100, 101

Denary (Decimal)

 Base 10: The everyday number system we use.

 Digits: 0-9.

 Examples: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Hexadecimal

 Base 16: Uses 0-9 and A-F.

 Digits: Hexits.

 Examples: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Binary to Decimal

 Place Value: Each digit has a place value based on its position.

 Calculation: Multiply each digit by its place value and add the results.

 Example: 1011 (binary) = 12^3 + 02^2 + 12^1 + 12^0 = 8 + 0 + 2


+ 1 = 11 (decimal)
Decimal to Binary

 Repeated Division: Divide the decimal number by 2 repeatedly until


the quotient is 0.

 Remainders: The remainders from each division, read in reverse


order, form the binary equivalent.

 Example: 13 (decimal) = 13 / 2 = 6 R1, 6 / 2 = 3 R0, 3 / 2 = 1 R1, 1 /


2 = 0 R1. Binary equivalent: 1101

Binary to Hexadecimal

 Grouping: Group the binary digits into groups of 4, starting from the
least significant bit.

 Conversion: Convert each group to its corresponding hexadecimal


digit.

 Example: 10110101 (binary) = 1011 0101 (grouped) = B5


(hexadecimal)

Hexadecimal to Binary

 Conversion: Convert each hexadecimal digit to its corresponding 4-bit


binary equivalent.

 Example: A3 (hexadecimal) = 1010 0011 (binary)

Hexadecimal to Denary

 Place Value: Each digit has a place value based on its position.

 Calculation: Multiply each digit by its place value and add the results.

Example:

 Convert A3 (hexadecimal) to decimal:

o A = 10, 3 = 3

o A3 = 10 * 16^1 + 3 * 16^0 = 160 + 3 = 163 (decimal)

Denary to Hexadecimal

 Repeated Division: Divide the decimal number by 16 repeatedly until


the quotient is 0.

 Remainders: The remainders from each division, read in reverse


order, form the hexadecimal equivalent.
Example:

 Convert 255 (decimal) to hexadecimal:

o 255 / 16 = 15 R15

o 15 / 16 = 0 R15

o Hexadecimal equivalent: FF

Remember:

 Hexadecimal digits are 0-9 and A-F.

 The place values in hexadecimal are powers of 16.

Binary addition and subtraction

Addition

 Align: Ensure that the least significant bits (LSBs) of the numbers being
added are aligned. This means that the units place of each number should be
lined up.

 Add: Add the corresponding bits of the two numbers, starting from the
LSBs. If the sum of two bits is 1, write down 1. If the sum is 2, write down 0
and carry over 1 to the next bit.

 Carry: If a carry-over occurs from the previous bit, add it to the current bit
before adding the corresponding bits of the two numbers.

 Continue: Repeat steps 2 and 3 until all bits have been added. The final
result is the binary sum of the two numbers.

Subtraction

 Align: Ensure the least significant bits (LSBs) of the numbers are aligned.

 Subtract: Subtract the corresponding bits, borrowing 1 from the previous


bit if necessary.

 Borrowing: If a bit needs to borrow from the previous bit, the previous bit
becomes 0, and the current bit becomes 15 (in binary).
Overflow

In binary subtraction, an overflow error occurs when the result of a


subtraction operation exceeds the range of values that can be represented
by the number of bits being used.

1st and 2nd compliment

1's Complement

 Method: To find the 1's complement of a binary number, simply invert


all the bits (change 0s to 1s and 1s to 0s).

 Example:

o 5 (decimal) = 0101 (binary)

o 1's complement of 5: 1010 (binary)

2's Complement

 Method: To find the 2's complement of a binary number, find its 1's
complement and then add 1.

 Example:

o 5 (decimal) = 0101 (binary)

o 1's complement of 5: 1010 (binary)

o 2's complement of 5: 1010 + 1 = 1011 (binary)

Both uses to represent negative numbers but the 2 nd’s complement is much
more efficient and used in modern computer compare to first one lots of
drawback and are commonly found in much older computer

Logical binary shift

Left Shift (<<)

 Operation: Moves all bits to the left, inserting 0s at the right


end.

 Effect: Multiplies the number by 2 for each position shifted.


Right Shift (>>)

 Operation: Moves all bits to the right, discarding the rightmost


bit.

 Effect: Divides the number by 2 for each position shifted.

Program developing cycles

. Analyzing

 Understanding the problem: Clearly define the purpose of the


software and the goals it needs to achieve.

 Gathering requirements: Collect detailed information about the


desired features, functionalities, and constraints. This can involve
interviews, surveys, and workshops with stakeholders.

 Identifying constraints: Determine any limitations or restrictions


that might impact the development process, such as budget, timeline,
or technical constraints.

2. Designing

 Creating a blueprint: Develop a high-level overview of the software's


architecture, components, and how they will interact.

 Designing the user interface: Plan the look and feel of the software,
considering user experience and usability.

 Creating algorithms: Determine the logical steps or procedures that


the software will follow to accomplish its tasks.

3. Coding

 Implementing the design: Write the actual code using a


programming language.

 Following coding standards: Adhere to best practices and


guidelines to ensure code quality, readability, and maintainability.

 Testing units: Test individual components or modules of the code to


verify their correctness.
4. Testing

 Identifying and fixing bugs: Conduct thorough testing to find and


address any errors or defects in the software.

 Ensuring quality: Verify that the software meets the specified


requirements and performs as expected.

 Test data is the input data in order to test a system

o Abnormal Data

 Purpose: To test the software's ability to handle


unexpected or invalid input.

 Examples:

 Invalid data formats (e.g., entering text into a numeric


field)

 Out-of-range values (e.g., entering a negative value for a


quantity that should be positive)

 Missing or corrupted data

o Normal Data

 Purpose: To test the software's core functionality and


ensure it works as expected under typical conditions.

 Examples:

 Valid input values within the expected range

 Typical usage scenarios

o Boundary Data

 Purpose: To test the software's behavior at the edges of


its input range.

 Examples:

 Minimum and maximum values

 Empty strings or empty lists

 Special characters or symbols

o Extreme Data
 Purpose: To test the software's ability to handle extreme
or unusual conditions. (on edge of what being allowed )

 Examples:

 Very large or very small numbers

 Long strings or large datasets

 Stress testing to simulate heavy loads

 Extreme and boundary data can be considered as normal data in some


scenarios

Decomposition in Software Development

Decomposition is a fundamental technique in software development that


involves breaking down a complex problem into smaller, more manageable
subproblems. This approach makes the problem easier to understand, solve,
and maintain.

1. Structure Diagrams

 Purpose: Visualize the hierarchical structure of a system or program.

 Components:

o Modules: Represent the subproblems or functions.

o Arrows: Show the relationships and dependencies between


modules.

 Types:

o Hierarchical structure diagram: Depicts a top-down


breakdown of a system.

o Data flow diagram: Illustrates the flow of data through a


system.

Example:

Consider a hierarchical structure diagram for a company:


Company

|-- Department A

| |-- Team 1

| |-- Team 2

|-- Department B

| |-- Team 3

| |-- Team 4

|-- Department C

| |-- Team 5

2. Flowcharts

 Purpose: Represent the sequence of steps or decisions in a process.

 Symbols: Use various shapes (e.g., rectangles, diamonds, ovals) to


represent different types of actions or decisions.

 Flow: Connect symbols with arrows to show the flow of control.

 flowchart LR

 A(Start) --> B{Input number}

 B --> C[Calculate factorial]

 C --> D{Output result}

 D --> E(End)

3. Pseudocode

 Purpose: Provide a semi-formal language to describe an algorithm or


process.
 Structure: Uses keywords and indentation to represent different
control structures (e.g., if-else, loops).

 Clarity: Pseudocode is often easier to understand than actual code,


making it useful for planning and communicating algorithms.

function factorial(n): if n == 0:

return 1

else:

return: n * factorial(n-1)

7. Algorithm

Tips to understand algorithm

Tips to Understand Algorithms

Understanding algorithms can be challenging, but with the right approach, it


becomes easier. Here are some tips to help you grasp algorithms:

1. Break it Down:

 Divide and Conquer: Break down complex algorithms into smaller,


more manageable steps.

 Visualize: Use diagrams, flowcharts, or pseudocode to visualize the


algorithm's flow.

2. Trace the Execution:

 Step-by-Step: Follow the algorithm's instructions line by line, keeping


track of variable values.

 Use Examples: Test the algorithm with different input values to see
how it behaves.

3. Understand the Data Structures:

 Know Your Tools: Familiarize yourself with data structures like arrays,
linked lists, stacks, queues, trees, and graphs.

 Analyze Efficiency: Understand how different data structures impact


an algorithm's performance.
ASCII and Unicode

ASCII (American Standard Code for Information Interchange)

 Character set: A standard encoding for text characters used in


computers and telecommunications.

 Range: 128 characters (0-127) representing letters (uppercase and


lowercase), numbers, punctuation marks, and control characters.

 Bits: Each character is represented by 7 bits (a binary number).

 Limitations: Only supports English and other Western European


languages.

Unicode

 Character set: A universal character encoding standard that supports


a vast range of characters from different languages, scripts, and
symbols.

 Range: Over 1.4 million characters, including characters from almost


all known writing systems.

 Bits: Uses variable-length encoding, with characters typically


represented by 16 bits (UTF-16) or 32 bits (UTF-32).

 Advantages:

o Supports a wide range of languages and scripts.

o Avoids character encoding issues that can occur with ASCII.

o Provides a unified standard for text representation.

Note: Uppercase letters start with num 65 and end with 90

Lowercase start with 97 and end with 122

Images , sound representation

Images:
 Images are made of pixels ( a very small dots of colour
displayed on the screen with other dots forming the images )
 Each pixel can be converted into binary

You might also like