Topics covered Computers Fundamentals: Classification of Computers, Application of Computers, Basic organization of computer, Input and Output Devices, Binary Number System, Computer
memory, Computer Software. Algorithms and Programming Languages: Algorithm, Flowcharts, Pseudo code, Generation of Programming Languages.
Classification of computers Computers can be classified based on historical, purpose, technology and size/capability Basis of purpose
Binary number system Negative binary numbers: 2s
complement Flip zeros and ones and add 1 1101 into unsigned and signed
Unsigned (+): So 1101 = 13 in decimal Signed (+/-): If the most significant bit (MSB) is 1 then number is negative. So 1101 means a negative number. Then find its 2s complement to find its value which is 0011.
So 1101 = -3. Find signed decimal values for 10100101 and 01111111. So the answer is 5A in hexadecimal
Memory classification Software
classification Compiler, assembler, interpreter Compilers are used to convert high level languages (like C, C++ ) into machine code.
Example - GCC Assembler are used to convert assembly language code into machine code. Examples - X86 assemblers An interpreter is a computer program which
executes a statement directly at runtime Examples: Python Program life cycle
Malware malacious software Adware (short for advertising-supported software)
Bots automatically perform specific operations such as video gamings, online contests Bugs are human errors in programming Ransomware - displaying messages to demand money while locking the computer programs
Rootkit malicious remote access to computer Spyware peeping Tom Trojan horse password stealer Worm exploits host computer resources Spam Mass of unsolicited (unwanted) emails
Algorithm Finite sequence of explicit and unambiguous instructions, which when provided with a set of input values produces an output and then
terminates. Flowchart It is a pictorial form of an algo
Boxes represent operations and arrows represent sequence in which the operations are executed Pseudo code (1) Pseudo code is a generic way of
describing an algorithm without using any specific programming language-related notations. (2) It is an outline of a program, written in a form, which can easily be converted into
real programming statements. 5 generations of languages First - machine language Second - assembly language
Third - high-level programming languages, such as C, C++, and Java. Forth more close to human language, etc SQL FIND ALL RECORDS WHERE NAME IS "SMITH
Fifth - languages used for artificial intelligence and neural networks. 1-4 generation examples
Programming paradigms (models) Optional (1) Unstructured (2) Structured
(3) Object oriented Unstructured programming Writing small and simple programs consisting of only one main function in the program.
Uses goto statement to jump from any statement to any other statement (spagetti code)
Structured programming A program is broken down into small independent tasks that are small enough to be understood easily, without having to understand the whole
program at once.
When these tasks are completed, they are combined together to solve the problem. Example C language
Object oriented programming A style of computer programming which focuses
on objects (actors) and their private funcionality. Objects are variables of user defined data types known as classes which contain functions and
variables. Objects interact by using message passing. C++ and Java are examples of OOP.
IEEE-754 32-bit floating-point - optional How floating numbers are stored in 4 bytes? Consider 5.2
5->101 and 0.2 -> .00110011 (record carry for 0.2x2=0.4,0.4x2=0.8, 0.8x2=1.6, 0.6x2=1.2) So 5.2 = 101.00110011 = 1.010011E+2 Conventional trick 127+2=129=10000001 0 10000001 01001100110011001100110
SignBit 8-bit Expo 23-bits mantisa C code to find the Float storage main(){ int i;
float f=5.2f; //5.2 is double by default char *p=(char *)&f; for(i=0;i<4;i++) printf("%d ",*p++); }
Output: 102 102 -90 64 (which are decimal values of the 4th 3rd 2nd and 1st bytes) Example 1: Suppose that IEEE-754 32-bit floating-point representation pattern is 0
10000000 110 0000 0000 0000 0000 0000 Sign bit S = 0 positive number positive number E = 1000 0000B = 128D (in normalized form) Fraction is 1.11B (with an
implicit leading 1) = 1 + 12^-1 + 12^-2 = 1.75D The number is +1.75 2^(128-127) = +3.5D