Professional Documents
Culture Documents
BY RONALD GOLOOBA
What is ICT?
ICT Information Communications Technology It is defined as the use of electronic computers, communication devices and software application to convert, store, protect, process, transmit and retrieve information from anywhere and anytime. No formal definition because of rapid change in ICT innovations. Consider all the uses of digital technology that already exist to help individuals, businesses and organisations use information ICT is concerned with the storage, retrieval, manipulation, transmission or receipt of digital data. Importantly, it is also concerned with the way these different uses can work with each other.
2
INFORMATION
Information refers to the knowledge obtained from reading, investigation, study or research. We need information to make decision and to predict the future. The tools to transmit information are the telephone, television and radio. Information is knowledge and helps us to fulfil our daily tasks. Mention some the tasks that we fulfil with info.
3
COMMUNICATION
Communication is an act of transmitting messages. It is a process whereby information is exchanged between individuals using symbols, signs or verbal interaction. How did people communicate before? (symbols, signs, performing drama and poetry, ) In modern days people use Internet, email or video conferencing Communication is important in order to gain knowledge so that we express our thoughts.
4
TECHNOLOGY
Telephone and fax machines are the devices used in extending communication. Spreading Information to broadcast information such as news or weather reports effectively. Radio, television, satellites and the World Wide Web (WWW) are powerful tools that can be used from spreading to broadcasting information .
5
Pre-mechanical
Writing and Alphabets--communication. Paper and Pens--input technologies. Books and Libraries: Permanent Storage Devices. The First Numbering Systems. The First Calculators: The Abacus. One of the very first information processors.
10
It had maintenance and labor problems and was not all that accurate
11
12
Charles Babbage (1822) Mathematician. He designed the first computers to perform mul-tistep operations automatically, i.e. without human intervening in every step. This was the first programmable machine called the difference Engine. It was intended to compute and print mathematical tables automatically Then he came up with the idea of Analytic engine after failing with first engine. This device, large as a house and powered by 6 steam engines, would be more general purpose in nature because it would be programmable, using punched card technology of Jacquard . It had modern structure of I/O, Storage, and ALU
13
In an electronic computer the moving parts are electrons, which can be transmitted and processed at almost the speed of light (300000 kms-1). In early 1900 vacuum tubes or electronic valve were developed to permit the processing and storage of digital signals at a much higher speed. Read about the generation of computers
14
CPU Design
16
Control Unit
The Control Unit -- controls the fetching of instructions from the main memory and the subsequent execution of these instructions. Among other tasks carried out are the control of input and output devices and the passing of data to the Arithmetic/Logical Unit for computation.
17
ALU
The Arithmetic/Logical Unit (ALU) -- carries out arithmetic operations on integer (whole number) and real (with a decimal point) operands. It can also perform simple logical tests for equality and greater than and less than between operands.
18
Components of a CPU
Registers are temporary storage area inside a CPU
It is a high-speed memory which holds only data for immediate processing and results of this processing Two types: General purpose and Specific purpose.
19
HISTORY OF CPU
In 1971, a small unknown company, Intel, for the first time combined multiple transistors to form a central processing unit - a chip called Intel 4004. However, it was 8 years before the first PC was constructed. PC's are designed around different CPU generations
20
CPU manufacturers
Two best known makers of CPUs that is AMD and Intel. AMD's current line of processors includes Athlon, Phenom, Sempron and Turion processors Intel's current line of processors includes: the Celeron, Pentium, Core 2, Centrino and Centrino 2 processors.
21
CPU manufacturers
Today, Intel is the best-known manufacturer of computer CPUs. Most CPUs conform to the von Neumann architecture, which says that the CPU must fetch, decode, execute, and writeback the data in a fairly rapid succession.
22
What is a CPU?
The CPU is centrally located on the system board. It continually receives instructions to be executed, each instruction is a data processing order. The work itself consists mostly of calculations and data transport:
Data from CPU to other systems passes through a system Bus whish is a data pathway.
23
Type of Data
1. 2. The CPU is fed long streams of data via the system bus. It receives at least two types of data: Instructions on how to handle the other data. Data, which must be handled according to the instructions. What we call instructions is program code. That includes those messages, which we continuously send to the PC from the mouse and keyboard. Like print, save, open, etc. Data are typically user data. Think about the letter, which are writing. The contents, letters, images, etc., are user data, but then you say "print," you are sending program code (instructions):
24
Algorithm
Algorithm Is a set of unambiguous instructions for solving a problem or sub-problem in a finite amount of time using a finite amount of data. Or An algorithm is a set of rules that precisely defines a sequence of operations. An algorithm is a way of solving a type of problem, and an algorithm is applicable to many particular instances of the problem. A good algorithm is a tool that can be used over and over again.
27
Developing An Algorithm
Algorithm to Convert base-10 number to other bases While ( the quotient is not zero ) Divide the decimal number by the new base Make the remainder the next digit to the left in the answer Replace the original decimal number with the quotient
28
29
Developing An Algorithm
Euclids algorithm for finding the GCD (greatest common Denominator) of any two numbers A and B. Repeat: If B is zero, the GCD is A. Otherwise: find the remainder R when dividing A by B replace the value of A with the value of B replace the value of B with the value of R
30
31
Definition of an Algorithm.
More formally, an algorithm is a sequence of computations that operates on some set of inputs and produces a result in a finite period of time In the example of finding the GCD of two numbers, the inputs are the two numbers, and the result is the GCD.
32
Representing Algorithms
Algorithms can be expressed in: Natural languages, Pseudocode, Flowcharts, Programming languages or Control tables (processed by interpreters). Natural language expressions of algorithms tend to be verbose and ambiguous, and are rarely used for complex or technical algorithms. Pseudocode, flowcharts and control tables are structured ways to express algorithms that avoid many of the ambiguities common in natural language statements. Programming languages are primarily intended for expressing algorithms in a form that can be executed by a computer, but are often used as a way to define or document algorithms.
33
EXAMPLE OF A Pseudocode
GCD ( a, b )
While b ! = 0 {
Function name and arguments ! = means not equal indentation shows what to do while b ! = 0
r <-- a modulo b set r = a modulo b ( = remainder a/b) a <-- b set a = original b b <-- r set b = r (i.e., the remainder) } border of the while repetition return a when b = 0, return value of a as the GCD
35
CHARACTERIZING ALGORITHMS
To illustrate how different algorithms can have different performance characteristics, we will discuss a variety of algorithms that computer scientists have developed to solve common problems in computing.
36
Sequential search
Suppose one is provided with a list of people in the class, and one is asked to look up the name Debbie Drawe. A sequential search is a brute force algorithm that one can use. With a sequential search, the algorithm simply compares each name in the list to the name for which we are searching. The search ends when the algorithm finds a matching name, or when the algorithm has inspected all names in the list. Next is pseudocode for the sequential search. The double forward slash // indicates a comment. Note, too, the way we use the variable index to refer to a particular element in list_of_names. For instance, list_of_names[3] is the third name in the list.
37
Sequential_Search(list_of_names, name) length <-- length of list_of_names match_found <-- false index <-- 1 // While we have not found a match AND // we have not looked at every person in the list, // (The symbol <= means "less than or equal to.") // continue ... // Once we find a match or get to the end of the list, // we are finished while match_found = false AND index <= length { // The index keeps track of which name in the list // we are comparing with the test name. // If we find a match, set match_found to true if list_of_names[index] = name then match_found <-- true index <-- index + 1 } // match_found will be true if we found a match, and // false if we looked at every name and found no match
38
Pseudocode Functionality
Variables Names of places to store values They include quotient, decimalNumber, newBase Assignment Storing the value of an expression into a variable e.g. Set quotient to 64 quotient <-- 64 quotient <-- 6 * 10 + 4
39
Pseudocode Functionality
Output Printing a value on an output device we use terms like; Write, Print Input Getting values from the outside word and storing them into variables. Get, Read
40
Pseudocode Functionality
Repetition Repeating a series of statements for example
Set count to 1 While ( count < 10)
Write "Enter an integer number" Read aNumber Write "You entered " + aNumber Set count to count + 1
41
Pseudocode Functionality
Selection Making a choice to execute or skip a statement (or group of statements) Read number If (number < 0)
Write number + " is less than zero."
Pseudocode Functionality
Selection Choose to execute one statement (or group of statements) or another statement (or group of statements) If ( age < 12 ) Write "Pay children's rate" Write "You get a free box of popcorn" else If ( age < 65 ) Write "Pay regular rate" else Write "Pay senior citizens rate"
43
Top-Down Design Problem-solving technique in which the problem is divided into subproblems; the process is applied to each subproblem Modules Self-contained collection of steps, that solve a problem or subproblem Abstract Step An algorithmic step containing unspecified details Concrete Step An algorithm step in which all details are specified
44
Top-Down Design
Process continues for as many levels as it takes to make every step concrete Name of (sub)problem at one level becomes a module at next lower level
45
A General Example
Planning a large party
A Computer Example
Problem Create a list that includes each persons name, telephone number, and e-mail address
This list should then be printed in alphabetical order The names to be included in the list are on scraps of paper and business cards
47
Example solved
Main Enter names and numbers into list Put list into alphabetical order Print list Enter names and numbers into list
While ( more names) Enter name Enter telephone number Enter email address Insert information into list
48
Level 0
Level 1
A Computer Example
Enter names and numbers into list (revised) Level 1 Set moreNames to true While (moreNames) Prompt for and enter name Prompt for and enter telephone number Prompt for and enter email address Insert information into list Write "Enter a 1 to continue or a 0 to stop." Read response If (response = 0) Set moreNames to false
49
Prompt for and enter name Level 2 Write "Enter last name; press return." Read lastName Write "Enter first name; press return." Read firstName Prompt for and enter telephone number Level 2 Write "Enter area code and 7-digit number; press return." Read telephoneNumber Prompt for and enter email address Level 2 Write "Enter email address; press return." Read emailAddress
50
NUMBER SYSTEM
Why Learn The Number Systems? When humans are speaking to one another, they speak in a particular language made up of words and letters. Although we type words and letters in the computer, the computer does not understand the words and letters, rather, those words and letters are translated into numbers that computers talk and understand. As a computer programmer or an IT professional, you need to understand the three most common number systems that are frequently used in computers. Decimal Hexadecimal Binary
51
positive basis or radix N, there are N different individual symbols that can be used to write numbers in the system. The values of these symbols range from 0 to N-1
53
55
56
57
Example
1101.1 is equivalent to: 1 23 + 1 22 + 0 21 + 1 20 + 1 21 8 + 4+0+1+1/2 = 13.5 Thus 1101.12 is equivalent to 13.510
Exercises
59
For fractions, the most significant bit of the result is the top bit obtained from the integer part of multiplication by 2. The least significant bit of the result is the bottom bit obtained from the integer part of multiplication by 2. Thus 0.62510 =0.1012
60
Problems
1. Convert 0.4062510 to a binary number. 2. Convert 58.312510 to a binary number. Hint convert the whole number to binary and then the decimal part. i.e. 58.312510 =111010.01012
61
set the value of i = 0, call Ni the given decimal number Step2 Divide Ni by the new basis, obtain the quotient qi and the remainder ri Step3 Check the value of the quotient qi if qi is zero continue with step 4 otherwise continue with step 5 Step4 Increase the value of i by 1. Set Ni equal qi-1 and go back to step 2 Step5 The equivalent number to the decimal number is obtained by concatenating the remainder ri obtained in opposite order in which they were obtained. i.e. the equivalent number is ri ri-1ri-2..q0 Example: Use the algorithm to convert 2510 to Octal and binary
62
Hexadecimal Number
A hexadecimal numbering system has a radix of 16 and uses the following 16 distinct digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,A, B, C, D, E and F A corresponds to 10 in the denary system, B to 11, C to 12, and so on.. To convert 1A16 =1161 +A160 =1161 +101=16+10=26 i.e. 1A16 =2610 Similarly, 2E16 = 2161 +E160 = 2161 +14160 =32+14=4610
Convert the following hexadecimal numbers into their decimal equivalents: (a) C916 (b) BD16
63
64
Overflow
An 8 bit number can represent 256 (216 ) distinct numeric values and the range is typically considered to be 0-255 Any number larger than 255 cant be represented using 8 bits. A 16 bit number represents 65536 and the range is 065535. An overflow occurs when the result of a calculation cant be represented with the number of bits available. For example when adding the two 8 bit quantities: 150 + 170, the result is 320 which is outside the range therefore the result has overflowed. The low order bit remains and the high order bit will be lost. Smaller value will be lost.
68
71
Two Compliment
Example.
Decimal number 1 2 3 4 5 6 7 Binary Equivalent 0001 0010 0011 0100 0101 0110 0111 Negative Number -1 -2 -3 -4 -5 -6 -7 Binary Equivalent of a negative number 1110 +1 = 1111 1101+1 = 1110 1100 +1 = 1101 1011+1 = 1100 1010 +1 = 1011 1001 + 1 = 1010 1000 + 1 = 1001
8 9
1000 1001
-8 -9