EE209 24F 1IntroB
EE209 24F 1IntroB
Electrical Engineering
EE209:Programming Structures for Electrical Engineering
Lecture 1. Introduction
Overview
Logistics
3
Logistics
When: Mon & Wed 10:30 AM – 11:50 AM
Where: E11 #302 (we will sometimes have Zoom classes)
https://ee209.kaist.ac.kr/ : for course announcements, assignments,
submissions, lecture notes, class videos, etc.
https://campuswire.com/p/G48E4589B for Q&A, discussions, etc.
KLMS is used only for assignment submission.
kaist.ee209.ta.fall24@gmail.com : email to Professors and TAs –
please use this instead of individual emails or kakao talk
Emails or kakao messages to individual staff will be ignored
4
EE209A/B
What is shared?
Content, exams, assignments, policies, lecture time
Grading
TAs
Campuswire
What is different?
Instructors and classroom
In case one of the professors can’t teach on a certain day (e.g., travel,
vaccine side effects, etc.), the other professor will give the live lecture that
day to the merged EE209A/B via Zoom
5
In-person Lectures, but sometimes Zoom
6
Guidelines on Using Zoom
Set user name as your KAIST ID and name (e.g., 20210000 Phil Kim)
Turn the camera on; we want to match your name and appearance
7
HELLO!
I am Insu Han
BS - PhD in EE, KAIST (2021)
Became a professor at KAIST in 2024
Research in approximate algorithms
for machine learning
8
Teaching Avengers
9
Office Hours
Professor:
By appointment; put [EE209] on email subject
We can chat via Zoom or visit to my office in N1
10
TA office hours & EE485
11
Campuswire
https://campuswire.com/p/G48E4589B
12
Textbooks (Highly Recommended)
13
Textbooks (Recommended)
14
Manuals
15
Programming Environment
Users guide:
https://ee.kaist.ac.kr/student-
facilities-02/
16
Programming Environment (cont.)
eelab5.kaist.ac.kr, eelab6.kaist.ac.kr
More information regarding your login ID and password will be uploaded this
week on Campuswire
17
Programming Environment (cont.)
EE485 is meant to replace the precept materials in the past, and we no longer
provide “precept” materials from this course
First thing to do
Log in with your account, and change your password
You only need to change once – all machines will be automatically updated
18
Programming Environment (cont.)
One Option (highly recommended)
19
Programming Environment: Notes
– Cannot give grade if your program works on your local machine but
does not run on our Lab machines
Our recommendation:
20
Grading
Midterm 20%
Final 20%
Contribution 5%
21
Programming Assignments
2. String manipulation
5. A Unix shell
Assignment #5: team of two members allowed; a single member team gets
20% extra credit
22
Grading: Assignments
Assignment grading
Working code
23
Grading: Contribution
If you greatly contribute to the class discussion, you could get extra credit
24
Attendance
But if you don’t attend, you won’t be able to contribute to the class
If you have a legitimate reason for not attending a class, provide me with
the reason and proof in advance
25
Asking for Help
2. Consult with the professor (office hour) and/or TAs (Q&A session) directly
Good: figure out the symptoms of your problem first, and explain to the
TAs in detail what you want
Bad: just give your code to TAs by email, and ask them to figure out what
the problem is – we can’t help you this way
26
Getting a Good Grade for EE209
27
Course Policies
Don’t test your luck, we have caught many students in the past
Don’t copy the code from your predecessors or across the sessions (we have
all the code)
28
Course Policies
Students can use two late submission tokens which can be late up to one
day with penalty for the programming assignments.
That is, you can use your tokens for a total of two assignments. Your token
will be used automatically, i.e., the token is applied to the first two
assignments you submit late. With your tokens, you can submit your
assignment with the following penalty.
95% of the full credit up to 1 hour late,
Important:
Any late submission without token will result in zero credit.
We not accept late submission for the last assignment (assignment 5).
29
What is cheating?
Allowing anyone to view your work during, before, or after the assignment time
period
Coaching
Helping your friend to write a lab, line by line
30
What is NOT cheating?
Whenever you are not sure, ask TAs or the professor (don’t guess)
31
Why should I take this course?
32
Why should I take this course?
Data structures
33
Course Goal 1: Large-scale Programming
34
Course Goal 2: “Under the Hood”
35
Course Goal 2: “Under the Hood”
36
We’ll use C Programming Language
A (Long):
C is a lower-level language:
Linux is written in C
37
We’ll use C Programming Language
38
We’ll use Linux OS
39
Topics in this course
Basic C programming
C is a flexible, expressive, low-level programming language
Low-level programming
How is your C code translated and run?
Systems environment
What services underlying systems provide?
40
Tentative Schedule
Total: 16 weeks
Midterm: 1 week
Final: 1 week
41
Today’s Class
Staff
Resources
Grading
Policies
42
What does a computer look like today?
43
Trend#1: Smaller and more powerful
ENIAC (1945)
The first computer
Millions of
times faster
Smartphones today
44
Trend#2: Ubiquitous, everywhere
45
Trend#3: Growing to a larger scale
46
Google’s Datacenters
Machines
Rack
47
Internet-based Services
Servers
Cloud
Clients
Smart Devices
Hierarchical Structure
of Internet-based Services
48
Endless applications using cloud
49
Understanding Computer Systems and Software
Software industry
Automobile industry
50
Today’s Class
Staffs
Resources
Grading
Policies
51
Design goals of C
Implications for C
Low-level
53
C Overview (by Dennis Ritchie)
Dennis Ritchie
Creator of C and Unix
Turing Award Winner (1983)
54
C Overview (by Dennis Ritchie)
Make applications
55
Hello World
Include
information about
standard library
hello.c:
main()
function:
#include <stdio.h> entry point
of execution
int main(void) {
printf("Hello, world\n");
return 0;
}
Statements of
main are
enclosed in
braces
56
What is Programming?
57
C Variable Types
Variable
Name given to a memory area that a program manipulates
Generic type
void * (64 bit on 64-bit OS)
58
Constants, Array, Pointer Type
#define MAX 10
const int MAX = 10;
enum {MAX = 10};
char c[10];
double pi[5][2];
int *p;
59
Variables and Pointers
Memory
Variable: int x
1 100
2 102
Pointer: int* p
3 ‘a’
4 ‘b’
5 3.5
6 420
60
Strings and Structures
struct student {
int id;
char *name;
};
61
Arithmetic and Logic Operations
Arithmetic operators
+, -, *, /, %, unary -
Logic operators
&&, ||, !
Relational operators
==, !=, >, <, >=, <=
Bitwise operators
>>, <<, &, |, ^
Assignment operators
=, *=, /=, +=, -=, <<=, >>=, =, ^=, |=, %=
https://www.tutorialspoint.com/cprogramming/c_operators.htm
62
Statements
Statement
Statements are fragments of the C program that are executed in sequence.
63
Loop Statements (1)
for statement
int i = 0
for (int i = 0; i < 10; i++){
statement 1;
statement 2; No
i < 10?
}
statement 3; Yes
statement 1
statement 2
i=i+1
statement 3
64
Loop Statements (2)
while statement
i < 10?
No
while (i < 10){
statement 1; Yes
statement 2; statement 1
} statement 2
statement 3;
statement 3
do while statement
statement 1
do { statement 2
statement 1;
statement 2; Yes
} while (i < 10) i < 10?
statement 3;
No
statement 3
65
Loop Statements (3)
goto SomeLabel;
66
Function Definition and Call
Function Call
67
Other Statements
Compound Statements
{
statement1;
statement2;
}
/*
multiple
line
comment
*/
68
Example C Program (w.o/ comments)
1 #include <stdio.h>
2
3
4 int main(void)
5 {
6 float a, b;
7 int c, d, e;
8
9 c = 0;
10 d = 300;
11 e = 20;
12
13 for (a = c; a <= d; a = a + e) {
14 b = (5.0 / 9.0) * (a – 32.0);
15 printf(“%3.0f %6.1f\n”, a, b);
16 }
17 return 0;
18 }
69
Example C Program (w/ comments)
1 #include <stdio.h>
2 /* print Fahrenheit-Celsius table for
3 fahr = 0, 20, …, 300 */
4 int main(void)
5 {
6 float fahr, celsius;
7 int lower, upper, step;
8
9 lower = 0;
10 upper = 300;
11 step = 20;
12
13 for (fahr = lower; fahr <= upper; fahr = fahr + step) {
14 celsius = (5.0 / 9.0) * (fahr – 32.0);
15 printf(“%3.0f %6.1f\n”, fahr, celsius);
16 }
17 return 0;
18 }
70
Summary
Low-level programming
71
Action items after class
72
73