Anda di halaman 1dari 56

THE AMERICAN UNIVERSITY IN CAIRO

Computers
(7% of questions)
By
Georges Antoun,
July 11th 2009
 Computer Terminology
◦ Memory Types
◦ CPU
◦ Baud rates
◦ Internet
 Spreadsheets
◦ Addresses
◦ Interpretation
◦ Conditions
◦ Formulas Copying
 Structured Programming
◦ Assignments
◦ Loops
◦ Branches
◦ Function Calls

2
3
 Bit 0 or 1
 Nibble 4 bits
 Byte 8 bits
 Word 16 bits (processor dependent)

4
 Even parity <makes
number of 1’s even>
using XOR

 Odd parity <makes


number of 1’s odd>
using XNOR
 Used to measure symbol rate per second.

 A baud rate of 1 kBd = 1,000 Bd is equivalent


to a symbol rate of 1,000 symbols per
second.

 Different from bits per second (bps).

 Named after Emile Baudot.

6
 The Global Worldwide Network that does
connect among all people in all countries.

 Also referred to be the network of networks.

7
 Devices attached to host computer used to
input or output data.

8
 Tele: from distance.

 Computer service by means of terminals


remote from the central computer.

 Connectivity medium varied in nature among


twisted pair, telephone line, Ethernet cable,
optical fiber, RF or even satellite connection.

9
10
11
12
# of Gates

SSI Small-Scale Integration < 10

MSI Medium-Scale Integration < 1000

LSI Large-Scale Integration > 1,000

VLSI Very Large-Scale Integration > 10,000

SOC System On Chip > 1,000,000

13
 1-ALU Arithmetic & Logic Unit
performs mathematical operations
 2-CU Control Unit
 3-Memory
 4-BUS Interconnect network
 5-Input & Output CPU I/O devices

CPU = ALU + CU
Bus (Interconnect)

Central Processing Unit
Main Memory

14
 RAM (Random Access Memory)
◦ Access time is independent of the location in the
store.
◦ Volatile.
◦ Mostly used in Computers.

 ROM (Read-Only Memory)


◦ Access time is independent of the location in the
store.
◦ Contents are permanent, and cannot be changed.
◦ Non Volatile.

15
Registers
in CPU

Cache
(RAM, 100sKB, ~10ns)

Main memory
(RAM, 100sMB~GB, ~50ns)

Magnetic disk
(Hard disk, 10sGB-100sGB, ~10ms)

Optical disk Magnetic tape


(CD-ROM, GB, ~100ms) (Tape, 100sMB, sec-min)

16
 CISC (Complex Instruction Set Computers)
◦ Lots of machine level instructions
◦ Few Registers
◦ Best for Multimedia applications

 RISC (Reduced Instruction Set Computers)


◦ Limited instructions
◦ More Registers
◦ Best for processing

17
 An operating program responsible for
controlling inputs & outputs for a certain
computer.
◦ Examples are MS Windows, Linux, Solaris, Mac etc…

18
 Real Time
◦ Has interaction with user at run time.
◦ Suitable for tasks that does have Graphical User
Interface.

 Batch Processing
◦ Task is configured, parameterized & launched in an
open loop manner with no control on run time.
◦ Suitable for long jobs that might run overnight
without any supervision or user input.

19
 Multi-tasking
◦ Tasks are allocated different parts of system
memory, so that more than 1 task run in the same
time.
◦ Supported by hardware & operating system.

 Time-sharing
◦ Time division multiplexing of memory among tasks.
◦ Slower low end solution.

20
 Foreground Processing
◦ Most likely an interactive job that does require
user’s attention.
◦ Takes higher priority at runtime.

 Background Processing
◦ Most likely a batch job that does not require input
from user.
◦ Takes lower priority at runtime (unused CPU cycles).

 Run on a multitasking environment.

21
22
 Machine language
◦ Lowest level. Basic operation codes in binary or
(Hexadecimal) format that are understood by CPU.

 Assembly language
◦ Higher level. Used by assembler, allow use of
variables

23
 Easier to program.
 Easier to debug.
 More suitable for large applications.
 Compilers or interpreters can warn about
semantic errors.

24
25
 BASIC
◦ Beginners All Purpose Symbolic Instruction Code
 COBOL
◦ Common Business Oriented Language
 Fortran
◦ FORmula Translation
 C / C++
◦ High level compiled language
 Java
◦ High level interpreted language

26
 Please refer to FE exam handouts to get the
function list.

27
Language Level Description Format Interface Limitations Examples

Errors can
Machine Lowest Hex. Operation Binary or (Hexadecimal)
CPU lock Op Codes
language level codes format
machine

Assembly Medium Readable basic Hard to


Instructions Assembler Assembly
language level instructions debug

Less C++,
Programming High Classes, blocks, High level constructs,
Compiler optimizatio Fortran,
language level subroutines functions, loops etc..
n Pascal

28
 Structured
 Top down
 Bottom up
 Object Oriented

29
 The structure of a product must conform to
the structure of its data.
 Modules are arranged hierarchically.
 There is only one root (or top level) module.
 Execution begins with this root module.
 Program control must enter a module at its
entry point and leave at its exit point.
 Control returns to the calling module when
the lower level module completes execution.
 Good programmer might not use any goto
statement, he may use loops instead.

30
 An overview of the system is first formulated,
specifying but not detailing any first-level
subsystems.
 Each subsystem is then refined in yet greater
detail.
 Often specified in terms of "black boxes" that
got explained as we go down in the
abstraction level.
 Targeting meeting a global purpose.
 Methodology leading to modular design.

31
 Basic blocks are first defined in detail.
 As we go higher in abstraction, bigger blocks
are formed up in term of basic blocks and so
on.
 Targeting global optimization.

32
 Design product in terms of objects.
 4 steps
◦ Construct interaction diagrams for each scenario
 Sequence diagrams showing objects & messages
◦ Construct the detailed class diagram
 Class diagrams hiding information
◦ Design the product in terms of clients of objects
 Define client relationships among objects
◦ Proceed to the detailed design
 Algorithms & Data Structures

33
 Subroutines are small pieces of code that are
called repeatedly to perform specific
functions.
◦ For ex. ReportViolation(); //where ReportViolation is
the subroutine

 Functions are a form of subroutines but


returning values, so might be involved in
statements with its return value.
◦ For ex. X = factorial (Y); //where factorial () is the
function

34
35
 A huge 2-dimensional matrix containing a
large number of cells.
 Each cell is specified by an intersection of a
row (number) an a column (alphabet).
 For ex. Cell C23 is laying in 3rd column, and
row #23 and so on.
 One of the most developed spreadsheets is
MS Excel.

36
37
 Relative
◦ The formula is referring to cell(s) in relative
locations.
◦ If we copy the cell containing the formula to a new
cell, then it will act on cell(s) relative to its new
location.
◦ Ex. C1=A1+B1
◦ If we copy cell C1 to location C2, then
C2 = A2 + B2

38
 Absolute
◦ The formula is referring to a specific cell(s).
◦ If being copied, it will still point to the same cell(s).
◦ Ex. D1=C1*$A$9
◦ $ is used to refer to a static location
◦ If we copy cell D1 to D2, then
D2 = C2*$A$9
◦ $A$9 will fix both the column & row of the cell.
◦ $A9 will only fix the column of the cell.
◦ A$9 will only fix the row of the cell.
◦ Toggle among all these choices by pressing F4
while editing.

39
35

30

25

20 Input1

15 Input2

Sum
10

0
1 2 3 4 5 6 7 8 9 10

40
41
42
 Data Structures
◦ Array & Structures
◦ Stacks & Queues
◦ Linked Lists
◦ Binary Trees

 Algorithms
◦ Searching
◦ Sorting

43
 First in First out (FIFO)
◦ Ex. Queue

 Last in First out (LIFO)


◦ Ex. Stack
◦ Fixed origin
◦ Variable size

44
45
46
47
48
49
 Fields
◦ Kind of information you would like to store.
◦ For ex. First name, Last name, Age, Sex.
◦ Type of each field has to be defined, “text, text,
number, flag”.
 Records
◦ Specific entry in the database.
◦ For ex. “Alan, Parker, 33, M” is a record.
◦ Total number of records in the database is a
measure of its size.

50
 Files
◦ Files are the entire database.

 Sequential Files
◦ Must read all the records until reaching the desired
one
◦ Ex. Magnetic Tapes

 Random Access Files


◦ Can locate records immediately

51
52
 Sort Records based on certain criteria of one
or more fields.
 For ex. Sort ascending by age, then sort
alphabetically by Last name.
 Many algorithms like: Bubble sort & insertion
sort.
 More on sorting algorithms @
http://www.topcoder.com/tc?module=Static&
d1=tutorials&d2=sorting

53
 Searching must return the set of records that
match a certain search criteria for report or
potential future modifications.
 For ex. I would like to get all employees that
are over 30 years, whose salaries are below
certain amount and are working for the
company at least for 3 years.
 Searching might be accelerated using
Hashing.

54
 Hashing is common accessing records from
databases.
 Hash functions are formulas to translate text
into unique numbers easy to manipulate, sort
etc..
 For ex. “Alan Parker” might be translated to
“321876123”.
 For more information on hashing, please goto
http://searchsqlserver.techtarget.com/sDefin
ition/0,,sid87_gci212230,00.html

55
56

Anda mungkin juga menyukai