Professional Documents
Culture Documents
and Programming
Topic 1: Getting Started
Reading: [Guttag, Chapter 1]
Slides prepared by Louay Bazzi for EECE 230C, Fall 2018-19, MSFEA, AUB.
Updated with minor edits during the offerings of EECE 230, Spring 2018-19, and Fall 2020-21, MSFEA, AUB
Updated in 2020-21 in preparation for EECE 230X, MSFEA, AUB
Some of the material in these slides is taken from [Guttag, Chapter 1]
Search for x = 7
Search for x = 10
start:0
mid:5
• Faster than sequential search end:10
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 7
Search for x = 10
start:0
mid:5
• Faster than sequential search end:4
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 7
Search for x = 10
start:0
mid:2
• Faster than sequential search end:4
• Example: start
end
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 7
Search for x = 10
start:3
mid:2
• Faster than sequential search end:4
• Example: mid
start
end
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 10
• Example: start
end
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 10
Search for x = 10
Search for x = 10
• Example: start
mid
end
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 10
• Example:
start end
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 10
• Example: mid
start end
List:
1 4 5 7 11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
Search for x = 10
• Example: start
end
List:
1 4 5 7 []11 20 57 66 67 81 92
0 1 2 3 4 5 6 7 8 9 10
start:4
mid:4
end:3
• History:
Turing machines, 1936
Von Neumann architecture, 1945
EECE 230X - Introduction to Computation and Programming
Computer Architecture Overview
Main memory
Central Processing
Unit (CPU) Data Input
Control Unit e.g., list of
numbers and
Instruction Register:
Instruction 2 Output
Program Counter Program:
… e.g.,
Instruction 1
Arithmetic Logic Unit Instruction 2 Keyboard
performs operations such Instruction 3 Display
as addition, ….
Disk drive
multiplication, AND, OR
…
EECE 230X - Introduction to Computation and Programming
Computer Architecture Overview
• Everything in memory is represented in binary, i.e.,
zeros and ones
• Computer circuitry process binary values
• Low-level instructions, i.e., machine-level
programing language
• More on computer architecture and machine-level
languages in second year courses EECE 320 and
EECE 321
Binary representation
Programming languages
• Python Syntax
• Static semantics
• Logical errors
• Spyder: recommended Python IDE
• References and useful links