Professional Documents
Culture Documents
1 HowComputerWorks
1 HowComputerWorks
1 HowComputerWorks
Computer Programming for Engineers
How does a computer work?
What is a computer?
Computer
A computer is a general purpose device that can be
programmed to carry out a set of arithmetic or logical
operations automatically. (Wikipedia)
Computer = Hardware + Software
• “Hardware” refers to the
physical components of
the computer
• “software” refers to the
code that runs on the
computer
Like piano and a piano score
Computer Hardware consists of
the IPO (Input, Processing, Output)
Structure
• Persistent storage
"Non volatile" .. Stored information is preserved when
the power is out
• Hard disk drive (HDD) - stores bytes as a magnetic
pattern on a spinning disk
• Flash drive - stores bytes as electrons in a chip -SD
card, flash chips built into a phone or tablet
3학년 과목 “전자재료”에서 자세하게 다룸.
Chips and Transistors
• Computers use tiny electronic components (i.e., chip)
which can be etched on silicon
• A Chip (or an integrated circuit) can contain billions
of transistors
• A Transistor is a semiconductor device used to
amplify and/or switch electronic signals and
electrical power
On: 1, Off: 0
2 bit
00 01 10 11
8 bit gray‐scale
00000000 11111111
10101000
24 bit Red‐Green‐Blue (RGB)
• Encoding is the process of converting analog signal (e.g., letters,
characters, and other symbols) to digital formats
• Decoding is the process of converting digital signal to the original analog
signal
– Number
– Text
– Sound
– Image
Text
• ASCII code table
– ‘A’ would become 65
– ‘a’ would become 97
– ‘0’ ~ ’9’ would become
48 ~ 57 in base 10 numbers
Text
• When any key on a keyboard is pressed, it needs to be
converted into a binary number
Alan Turing is called “the father of
computer science” (1936)
Compiler
• Transforms a high‐level source code directly
into machine code
– C, C++, Java
– E.g., Compiler takes in Firefox C++ source code,
produces Firefox.exe
firefox.exe
1) Translate
2) Run 25/35
Interpreter
• An Interpreter is a program which "runs" other code
• The interpreter carries out a single line of the source
code while reading it and proceeds to the next line
– Python, Javascript
A=1234
B=4321 translates
C=A+B Translate and Run
line by line
26/35
A program example
• Programs for adding 1234 and 4321
A=1234
B=4321
C=A+B
27/35
http://www.dspguide.com/ch4/5.htm