Lecture01 Ho
Lecture01 Ho
Topics
• Introduction
• Hardware and Software
CN101 • How Computers Store Data
• How a Program Works
Lecture 1
• Using Python
Introduction to Computers and
Programming
3 4
5 6
The CPU
• Central processing unit (CPU): the part of the computer
that actually runs programs
• Most important component
• Without it, cannot run software
• Used to be a huge device
• Microprocessors: CPUs located on small chips
7 8
9 10
11 12
15 16
17 18
21 22
23 24
From Machine Language to
High-Level Languages
Assembly Language
• Impractical for people to write in machine language • Low-level language: close in nature to machine language
• Assembly language: uses short words (mnemonics) for • Example: assembly language
instructions instead of binary numbers • High-Level language: allows simple creation of powerful
• Easier for programmers to work with and complex programs
• Assembler: translates assembly language to machine • No need to know how CPU works or write large number of
instructions
language for execution by CPU
• More intuitive to understand
25 26
Key Words, Operators, and Syntax:
Python Key words
an Overview
• Key words: predefined words used to write program in
high-level language
• Each key word has specific meaning
• Operators: perform operations on data
• Example: math operators to perform arithmetic
• Syntax: set of rules to be followed when writing
program
• Statement: individual instruction used in high-level
language
27 28
29 30
33 34