Information Technology Essentials Lecture 03 PDF Fall 2024
Document Details
The National School of Artificial Intelligence
2024
Dr. Karim Lounis
Tags
Summary
This document is a lecture on Information Technology Essentials, focusing on computer concepts, notions, and terminologies, covering topics such as algorithms and complexity Fall 2024.
Full Transcript
Information Technology Essentials — Lecture 03 Dr. Karim Lounis Fall 2024 Dr. Karim Lounis Information Technology Essentials Fall 2024 1 / 36 Concetps, notions, and terminologies in Computers Computer Systems Recap Last session:...
Information Technology Essentials — Lecture 03 Dr. Karim Lounis Fall 2024 Dr. Karim Lounis Information Technology Essentials Fall 2024 1 / 36 Concetps, notions, and terminologies in Computers Computer Systems Recap Last session: Information Technology. Computer. Computer system. Algorithm. Computability and Decidability. Uncomputability and undecidability. Complexity. Dr. Karim Lounis Information Technology Essentials Fall 2024 2 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We Algorithms analyze and & understand the problem. Complexity: 2 We Complexity propose a solution studiesto thethe problem. difficulty of solving comptational prob- 3 We lems writeby thelooking solutionatastheir a setsolvability, of finite steps, called algorithm. requirements (space and 4 time), efficiency, and classification. We translate the algorithm into a program by rewriting all the steps using a programming Space complexitylanguage. looks at how much memory I need to solve 5 Feed thethe computer problem, with the whereas timewritten program complexity with looks at any howrequired intput. much time 6 I need to solve the problem (focusing on wost case scenario). The computer, may use another program to translate the written pro- gram intonotation: a sequence of instructions √ Big-O O(1), O(log (n)), — O(known as machine n), O(n), O(n·logcode. (n)), 7 TheO(n 2 ), O(nautomatically computer 3 ),..., O(2n ),executes and O(n!). the produced machine code and rapidly solves the problem. If my algorithm takes less than a second to execute 8 The computer outputs the results (output). (once it is a program) and does not require space, then should I claim that my algorithm has a good complexity? Dr. Karim Lounis Information Technology Essentials Fall 2024 3 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We Algorithms analyze and & understand the problem. Complexity: 2 We Complexity propose a solution studiesto thethe problem. difficulty of solving comptational prob- 3 We lems writeby thelooking solutionatastheir a setsolvability, of finite steps, called algorithm. requirements (space and 4 time), efficiency, and classification. We translate the algorithm into a program by rewriting all the steps using a programming Space complexitylanguage. looks at how much memory I need to solve 5 Feed thethe computer problem, with the whereas timewritten program complexity with looks at any howrequired intput. much time 6 I need to solve the problem (focusing on wost case scenario). The computer, may use another program to translate the written pro- gram intonotation: a sequence of instructions √ Big-O O(1), O(log (n)), — O(known as machine n), O(n), O(n·logcode. (n)), 7 TheO(n 2 ), O(nautomatically computer 3 ),..., O(2n ),executes and O(n!). the produced machine code and rapidly solves the problem. No. Time and space complexity focuse on the worst 8 The computer outputs the results (output). case scenario, i.e., time and space when n → ∞ Dr. Karim Lounis Information Technology Essentials Fall 2024 4 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers (Exercise) Assign the correct time complexity to the following algorithms: Searching for a specific number in a list of numbers. Computing the product of two natural numbers. Computing the sum of numbers in a list. Checking for palindromes. Compute the product of two matrices. Brute-forcing password of length n with m possible characters. Search for a specific element in a sorted list. √ Possible time complexity: O(1), O(log (n)), O( n), O(n), O(n · log (n)), O(n2 ), O(n3 ),..., O(2n ), and O(n!).. Dr. Karim Lounis Information Technology Essentials Fall 2024 5 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze and Let Algorithm understand us solve the problem. another problem. 2 We propose a solution to the problem. Problem statement 4. We want to display the numbers from 1 to 3 We write 100, the but solution as aofset3,ofprint for muliples finite steps, “EN” calledofalgorithm. instead the number, for 4 We translate the algorithm multiples of 5, printinto a program “SIA”, and for bytherewriting numbers allthatthearesteps using a programming language. multiples of both 3 and 5, print “ENSIA”. 5 Feed the computer with the written program with any required intput. 6 The Let us writemay computer, an algorithm use another thatprogram solves the problem. the to translate For written consistency, pro- let us use the following algorithm template: gram into a sequence of instructions — known as machine code. 7 The Input: computer...automatically executes the produced machine code and rapidly Body: solves the... problem. 8 The computer outputs the results (output). Output:... Dr. Karim Lounis Information Technology Essentials Fall 2024 6 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Algorithmand Letunderstand us solve the problem. another problem. 2 We propose a solution to the problem. Problem statement 5. Consider two variables, X and Y. Each 3 We writevariable the solution as a set is assigned of finite a value, ansteps, integercalled (i.e.,algorithm. in Z). Using 4 We translate arithmeticthe algorithm operations,into a program write by rewriting an algorithm all thethe that permutes steps using values a programming language. of the two variables using a exactly 3 steps, and without 5 using a thirdwith Feed the computer variable Z. For example, the written program if X=5 with anyand Y=9, then required intput. after running the algorithm, the result will be X=9 and Y=5. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. For consistency, let us use the following algorithm template: 7 The computer automatically executes the produced machine code and Input: rapidly solves..the. problem. 8 Body:.outputs The computer.. the results (output). Output:... Dr. Karim Lounis Information Technology Essentials Fall 2024 7 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze and understand the problem. 2 We propose a solution to the problem. 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 8 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyzeProgram and understand (A.k.a.,the problem. program) Computer 2 We propose a solution to the problem. l×. AKQK. 3 We write theIt solution is a finite as sequence of instructions a set of finite steps, calledwritten in a algorithm. programming language to solve a problem. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes (1815-1852) Ada Lovelace the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 9 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Computerand program: understandLet theusproblem. put our product calculation algorithm 2 into a computer context: We propose a solution to the problem. 1 Read (Input) the complete list of numbers (keybaord). 3 We write the solution as a set of finite steps, called algorithm. 2 Use a memory location X to store the 1st number. 4 We translate the algorithm into a program by rewriting all the steps using a3 programming language. Take the content of X and multiply it with the next number 5 on the list then save Feed the computer with the writtenthe result on X. program with any required intput. 4 Repeat Step 3 until numbers there is no number left. 6 The computer, may use another program to translate the written pro- gram into a sequence 5 Display (output) the content—ofknown of instructions X (onasthe machine code. monitor). 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 10 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Computerand program: understandLet theusproblem. put our product calculation algorithm 2 into a computer context: We propose a solution to the problem. 1 Read (Input) the complete list of numbers (keybaord). 3 We write the solution as a set of finite steps, called algorithm. 2 Use a memory location X to store the 1st number. 4 We translate the algorithm into a program by rewriting all the steps using a3 programming language. Take the content of X and multiply it with the next number 5 on the list then save Feed the computer with the writtenthe result on X. program with any required intput. 4 Repeat Step 3 until numbers there is no number left. 6 The computer, may use another program to translate the written pro- gram into a sequence 5 Display (output) the content—ofknown of instructions X (onasthe machine code. monitor). 7 The computer automatically executes the produced machine code and Then, we use a Programming Language to rewrite this steps rapidly solves the problem. and create our program. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 11 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyzeProgramming and understandLanguage the problem. 2 We propose a solution to the problem. ém.× QK. éªË 3 We write theIt solution is a language (i.e., as a set of set of steps, finite alphabets, calledwords, grammar, algorithm. and semantics) used to write computer programs. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 12 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyzeProgramming and understandLanguage the problem. 2 We propose a solution to the problem. ém.× QK. éªË 3 We write theIt solution is a language (i.e., as a set of set of steps, finite alphabets, calledwords, grammar, algorithm. and semantics) used to write computer programs. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). E.g., C, Java, C++, Python, Ruby, Ada, Pascal, etc. Dr. Karim Lounis Information Technology Essentials Fall 2024 13 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze and understand Programming the problem. Language: Let us use a programming language, 2 We propose a solution to the problem. calculation program: e.g., Pascal, to rewrite our product 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 14 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze and understand Programming the problem. Language: Can be classified into two categories, 2 declarative and imperative (& some support both styles of use): We propose a solution to the problem. 3 We write Declarative. the solution as You a set express of finitethe desired steps, calledresult or outcome algorithm. rather than specifying the step-by-step process to achieve that 4 We translate the algorithm into a program by rewriting all the steps result. E.g., SQL, HTML, CSS, Prolog, Haskell, etc. using a programming language. Imperative You explicitly list the sequence of commands or 5 Feed the computer with the written program with any required intput. steps to perform and achieve a specific task. E.g., C, C++, 6 The computer, mayPython, C♯, Java, use another Ruby,program to translate Perl, Fortran, the written Assembly, etc. pro- gram into a sequence of instructions — known as machine code. Programming language are also classified into high-level and low- 7 The level computer automatically programming executes language. Thethe produced more machine we get closer codehard- to the and rapidly solves ware the problem. the lower is the level of the programming language. 8 The computer outputs the results (output). Low-level programming languages are hardware (architecture) de- pendant. E.g., Assembly and binray. High-level PLs are not. Dr. Karim Lounis Information Technology Essentials Fall 2024 15 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze and understand Programming Language:the problem. Can be classified into three other cat- 2 egories, complied, interpreted, We propose a solution to the problem.and hybrid: 3 We write Compiled. the solutionThe as aentire set ofsource code iscalled finite steps, compiled into a binary algorithm. for execution (compiled once). E.g., C, C++, D, OCaml, Go, 4 We translate the algorithm into a program by rewriting all the steps Haskell, Pascal, Fortran, Ada, COBOL, Rust, etc. using a programming language. Interpreted In the source code, instructions are interpreted 5 Feed the computer with the written program with any required intput. and then executed line by line (by an interpreter). E.g., 6 The computer, may use JavaScript, another HTML, program Ruby, to translate PHP, Bash, MATLAB, the written python, pro- etc. gram into a sequence of instructions — known as machine code. Hybrid. The entire source code is compiled into an interme- 7 The computer diary automatically executes the code (a.k.a., bytecode), andproduced machinefurther then interpreted code and for rapidly solves the problem. execution. E.g., C♯, Java, Scala, objective-C, Ruby, Python, 8 The computer outputs Kotlin, theSwift, Groovy, results (output). etc. Dr. Karim Lounis Information Technology Essentials Fall 2024 16 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Machine andcode understand (A.k.a.,the problem. binary code) 2 We propose a solution to the problem. éJ KAJJË@ èQ®Ë@ 3 It is the We write the solution languageasthat theofcomputer a set understands. finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves theis problem. Everything encoded in binary (0 | 1) and every sequence of bits 8 has a(output). The computer outputs the results semantics. Dr. Karim Lounis Information Technology Essentials Fall 2024 17 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Machineandcode understand (A.k.a.,the problem. binary code): Our product computation 2 code would look like this: We propose a solution to the problem. 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 18 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: We analyze Binary 1 andComputers System: understandoperate the problem. on the binary system (i.e., Base 2): 2 WeThe propose a solution unit element to the problem. is called, a bit, which value is 0 or 1. 3 WeThe write bitthe 0 issolution as a set given voltage v , of finitev steps, where called algorithm. ∈ [0 30%vdd] and the bit 1 is 4 Wegiven a voltage translate ∈ [75%vdd the valgorithm intovdd] (vdd being a program the suppiled by rewriting all voltage). the steps using a programming language. A sequence of 8 bits is called a Byte (or Octet). 5 Feed the the When computer with number of bits is 210 =1024, the written program we with any (Kilo). say 1Kb required intput. 6 The computer, When may use the number another of bits 20 is 2 program , we sayto1Mb translate the written pro- (Mega). gram into a sequence of instructions 30 — known When the number of bits is 2 , we say 1Gb (Giga).as machine code. 7 The computer When automatically the number of bits isexecutes 240 , wethe sayproduced machine code and 1Tb (Tera). rapidly solves the problem. We can use power of 2 (i.e., 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 8 The computer 1024, 2048, outputs thetoresults 4096, etc) express(output). all natural numbers. Dr. Karim Lounis Information Technology Essentials Fall 2024 19 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Binary System: andComputers understandoperate the problem. on the binary system (i.e., Base 2): 2 WeComputers propose a use solution to thesystem the binary problem. because of its simplicity and com- patibility with electronic components. 3 We write the solution as a set of finite steps, called algorithm. 4 WeIt translate simplifiesthethealgorithm design of into electronic components. a program by rewriting all the steps using a programming language. Binary signals are less susceptible to noise and errors. 5 Feed Manythe electronic computer components, with the written e.g.,program withand transistors anylogic required intput. gates, can 6 operate reliably with binary singals. The computer, may use another program to translate the written pro- gram into data Binary a sequence can beofstored instructions — known as using electronic machine code. components that can 7 Themaintain computer twoautomatically distinct states. executes the produced machine code and rapidly We use solves thethe problem. system (base 16) to express large binary hexadecimal 8 The computer outputs theform: numbers in a compact 10(output). results is A (0xa),..., and 15 is F (0xf). Dr. Karim Lounis Information Technology Essentials Fall 2024 20 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: We analyze Binary 1 andComputers System: understandoperate the problem. on the binary system (i.e., Base 2): 2 We propose a solution to the problem. 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 21 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: We analyze Binary 1 andComputers System: understandoperate the problem. on the binary system (i.e., Base 2): 2 We propose a solution to the problem. 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 22 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: We analyze Binary 1 andComputers System: understandoperate the problem. on the binary system (i.e., Base 2): 2 We propose a solution to the problem. 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language. 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written pro- gram into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 23 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Binary System: andThe understand system isthe problem. used to implement the ASCII (American 2Standard We propose a solution to the problem. — 1960) character encoding Code for Information Interchange standard. It encodes characters on 7 bits. E.g., ‘A’ is 65. 3 We write the solution as a set of finite steps, called algorithm. ASCII 4 was extended We translate to 8 bits to the algorithm allow into more possible a program encoding by rewriting all (1981). the steps using a programming language. While ASCII was suitable for representing English text, it lacked support 5forFeed manythenon-English computer with the written languages program with any required intput. and characters. 6 The(and Used computer, mayused) still being use another program for encoding to translate characters thefiles. of text written pro- gram into a sequence of instructions — known as machine code. It is backward compatible and used in various networking protocols (e.g., 7 The computer automatically executes the produced machine code and HTTP) and programming languages. It is also used in character devices. rapidly solves the problem. 8HowThewould a computer computer encode outputs the resultsthe term ensia in ASCII-128? (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 24 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Binary System: andThe understand system isthe problem. used to implement the ASCII (American 2Standard We propose a solution to the problem. — 1960) character encoding Code for Information Interchange standard. It encodes characters on 7 bits. E.g., ‘A’ is 65. 3 We write the solution as a set of finite steps, called algorithm. ASCII 4 was extended We translate to 8 bits to the algorithm allow into more possible a program encoding by rewriting all (1981). the steps using a programming language. While ASCII was suitable for representing English text, it lacked support 5forFeed manythenon-English computer with the written languages program with any required intput. and characters. 6 The(and Used computer, mayused) still being use another program for encoding to translate characters thefiles. of text written pro- gram into a sequence of instructions — known as machine code. It is backward compatible and used in various networking protocols (e.g., 7 The computer automatically executes the produced machine code and HTTP) and programming languages. It is also used in character devices. rapidly solves the problem. 8HowThewould a computer computer outputs theencode resultsthe term ensia in ASCII-128? (output). 10110 11010 11510 10510 9710 Dr. Karim Lounis Information Technology Essentials Fall 2024 25 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Binary System: andThe understand system isthe problem. used to implement the ASCII (American 2Standard We propose a solution to the problem. — 1960) character encoding Code for Information Interchange standard. It encodes characters on 7 bits. E.g., ‘A’ is 65. 3 We write the solution as a set of finite steps, called algorithm. ASCII 4 was extended We translate to 8 bits to the algorithm allow into more possible a program encoding by rewriting all (1981). the steps using a programming language. While ASCII was suitable for representing English text, it lacked support 5forFeed manythenon-English computer with the written languages program with any required intput. and characters. 6 The(and Used computer, mayused) still being use another program for encoding to translate characters thefiles. of text written pro- gram into a sequence of instructions — known as machine code. It is backward compatible and used in various networking protocols (e.g., 7 The computer automatically executes the produced machine code and HTTP) and programming languages. It is also used in character devices. rapidly solves the problem. 8HowThewould a computer computer encode outputs the resultsthe term ensia in ASCII-128? (output). 011001012 011011102 011100112 011010012 011000012 Dr. Karim Lounis Information Technology Essentials Fall 2024 26 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Binary System: andThe understand system isthe problem. used to implement the ASCII (American What Standard about other languages (e.g., Semitic languages), 2 We propose a solution to the problem. — 1960) character encoding Code for Information Interchange standard. It math encodessymbols, Greek characters onsymbols, emojies, 7 bits. E.g., ‘A’ isetc? 65. 3 We write the solution as a set of finite steps, called algorithm. ASCII 4 was extended We translate to 8 bits to the algorithm allow into more possible a program encoding by rewriting all (1981). the steps using a programming language. While ASCII was suitable for representing English text, it lacked support 5forFeed manythenon-English computer with the written languages program with any required intput. and characters. 6 The(and Used computer, mayused) still being use another program for encoding to translate characters thefiles. of text written pro- gram into a sequence of instructions — known as machine code. It is backward compatible and used in various networking protocols (e.g., 7 The computer automatically executes the produced machine code and HTTP) and programming languages. It is also used in character devices. rapidly solves the problem. 8HowThewould a computer computer encode outputs the resultsthe term ensia in ASCII-128? (output). 01000001 01001110 01010011 01001001 Dr. Karim Lounis Information Technology Essentials Fall 2024 27 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze Binary andThe System: understand system isthe problem. used to implement the UNICODE (UNI- 2versal CODE — 1990s) character encoding We propose a solution to the problem. standard. It assigns unique codes [U+0000 to U+10FFFF] to each character. I.e., from 0 to 3 We write the solution as a set of finite steps, called algorithm. 1,114,111. E.g., ‘A’ is U+0041, which corresponds to 65 in decimal. 4 We translate the algorithm into a program by rewriting all the steps UNICODE aims to encode using a programming all the world’s written scripts and characters language. (e.g., symbols, emojis, mathematical symbols, etc). 5 Feed the computer with the written program with any required intput. It The 6 defines 3 different computer, mayencoding schemes: use another UTF-8, program UTF-16, to translate theand UTF-32, written pro- to gram encode allaUNICODE into code sequence of points (Unicode instructions — knownTransformation Format). as machine code. 7TheThe computer most automatically commonly executes the produced machine code and used is UTF-8. rapidly solves the problem. It has played a crucial role in enabling the globalization and internation- 8 The computer outputs the results (output). alization of digital content and applications. Dr. Karim Lounis Information Technology Essentials Fall 2024 28 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze and understand the problem. 2 We propose a solution to the problem. 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using a programming language (producing the source code). 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written program into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 29 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers To solve a problem using a computer, the following steps are performed: 1 We analyze and understand the problem. 2 We propose a solution to the problem. 3 We write the solution as a set of finite steps, called algorithm. 4 We translate the algorithm into a program by rewriting all the steps using How do we call a programming the program language used (producing in Step the source 6? code). 5 Feed the computer with the written program with any required intput. 6 The computer, may use another program to translate the written program into a sequence of instructions — known as machine code. 7 The computer automatically executes the produced machine code and rapidly solves the problem. 8 The computer outputs the results (output). Dr. Karim Lounis Information Technology Essentials Fall 2024 29 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers Definition Compiler. It is a program used to translate a computer program written in a programming language into another computer program written in a lower-level (or same-level) programming language. Among various tasks, the compiler does the following: Syntax Analysis. Checks for syntax errors — perform parsing. Semantics Analysis. Checks the semantics of the code. Optimization. This would improve the efficiency of the code. Code Generation. Generate the lower-level code. Actually, the overall process of compilation goes through three main stages: (1) Compilation, (2) Assembly, and (3) Linking. Dr. Karim Lounis Information Technology Essentials Fall 2024 30 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers Definition Compiler.Compilation: Theused It is a program overall to process translategoes through: program written a computer in a programming language into 1 Compilation. another Translate computer high-level program source code written (e.g., *.cin ora lower-level (or *.cpp) same-level) programming into low-level code,language. generally, assembly (i.e., *.asm). Among various tasks, the compiler 2 Assembly. Translatedoes the following: the generated assembly code into ma- chine code (object files — *.obj). It also translate all refer- Syntax Analysis. Checks enced library filesfor syntax into objecterrors files. — perform parsing. Semantics Analysis. Checks the symantics of the code. 3 Linking. Combine multiple object files and libraries to create Optimization. This would improve the efficiency of the code. the executable file, i.e., *.exe or *.out. Code Generation. Generate the lower-level code. Actually, the overall process of compilation goes through three main stages: (1) Compilation, (2) Assembly, and (3) Linking. Dr. Karim Lounis Information Technology Essentials Fall 2024 31 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers How do I write my proper program? The following steps would generally make it: 1 Understand the problem for which you want to write a program. 2 Design and write an algorithm that solve the problem. 3 Choose a programming language and a text editor. 4 Writre your code by translating the algorithm using the choosen pro- gramming language’s syntax and grammar. 5 Compile the program you wrote using a compiler to generate the binary file, while making sure that all used libraries are available in ur pc. 6 Execute (or Debug) ur program for some input & retrieve the results. There exist some tools that gather the text editor, the compiler, and the executer, all in one software application, called IDE (Integrated Devel- opment Environment). E.g., Eclipse, Visual Studio, PyCharm, NetBeans, Visual Studio Code, and Code::Blocks. Dr. Karim Lounis Information Technology Essentials Fall 2024 32 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers How do I write my proper program? The following steps would generally make it: Text editor: It is an application software that is used to write 1 Understand the problem for which you want to write a program. plain text files. E.g., Notepad++, gedit, nano, vim, bluefish, etc. 2 Design and write an algorithm that solve the problem. 3 Choose a programming language and a text editor. You could also use some online web applications that allow you to 4 Writre your code by translating the algorithm using the choosen pro- write code, compile, and execute. E.g., gramming language’s syntax and grammar. 5 Compile the program https://www.onlinegdb.com/ you wrote using a compiler to generate the binary file, while making sure that all used libraries are available in ur pc. https://www.tutorialspoint.com/codingground.htm 6 Execute (or Debug) urhttps://onecompiler.com/ program for some input & retrieve the results. Another There exist some option, not gather tools that recommanded the textfor novicethe editor, coders, is to use compiler, andgen- the executer, erative AI systems all in one softwaresuch as ChatGPT. application, called Such IDE systems can generate (Integrated Devel- the code you want opment Environment). in Eclipse, E.g., a matterVisual of fewStudio, seconds. PyCharm, NetBeans, Visual Studio Code, and Code::Blocks. Dr. Karim Lounis Information Technology Essentials Fall 2024 33 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers How do I write my proper program? The following steps would generally make it: Let’s write our 1st “You are a great student” using HTML: 1 Understand the problem for which you want to write a program. 2 Design 1and write an algorithm that solve the problem. Algorithmically, we want to display a message. 3 Choose2 a programming language and a text editor. Open a text editor, e.g., notepad. 4 Writre your code by translating the algorithm using the choosen pro- 3 Write the following lines of code: gramming language’s syntax and grammar. 5 Compile the program you wrote using a compiler to generate the binary file, while making sure that all used libraries are available in ur pc. 6 Execute (or Debug) ur program for some input & retrieve the results. There exist 4some Savetools your that gather file with the text.html extension editor, or the compiler, and the.htm. executer, all5 in one software application, called IDE (Integrated Devel- Use your Internet Browser (Gooogle Chrome, IE, Safari, Fire- opment Environment). E.g., Eclipse, Visual Studio, PyCharm, NetBeans, fox, etc) to open your file. Visual Studio Code, and Code::Blocks. Dr. Karim Lounis Information Technology Essentials Fall 2024 34 / 36 Concetps, notions, and terminologies in Computers Computer Systems Computers (Exercise) Read the following definitions and find the right term that fits with each definition: A numbering system used to generate machine code. A language that computers understand and use to execute programs. A language that is used to write computer programs. A set of instructions written in a programming language. A program that translate user’s computer programs into machine code. A set of instruction written in natural language to solve a problem. Cannot be solved (computed) by a computer in a finite amount of time. Program, algorithm, uncomputable problem, machine code, programming language, compiler, and binary. Dr. Karim Lounis Information Technology Essentials Fall 2024 35 / 36 End of Presentation End. Dr. Karim Lounis Information Technology Essentials Fall 2024 36 / 36