Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Introduction to Computer Systems
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Objectives Students should: Be familiar with computer components and understand their main functionalities. Be able to conceptually explain how to solve problems using computers.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Computers A machine capable of automatically processing data according to instruction lists given. Computer
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Data Processing Arithmetic Operations Logical Comparison Transmitting Info. Receiving Info. Storing Info. and etc ……
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Benefits work fast. work consistently. remember a lot of stuffs. are loyal. work hard. Computers
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY But… Computers DO NOT THINK!!. Computers work as instructed. Right on, sir! Programs are needed!
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Many Forms of Computers Desktop ComputerNotebook ComputerTablet Embedded Computer PDA Game Console
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY What Computers Do InputOutputMemory Processor data
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Computer Components Hardware: Electronic devices and mechanical parts. Software: Instructions Information or messages that do not directly control computer hardware are considered “Data”.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Hardware 3 groups according to functionalities: Central Processing Unit (CPU) Memory Input/Output (I/O)
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY CPU The “brain” of a computer. responsible for execute given instructions. arithmetic & logical processing control other hardware Intel Pentium M, Intel Core TM Solo, Intel Core TM Duo, Intel Core TM 2 Duo, AMD Athlon TM 64, AMD Opteron TM, Sun UltraSPARC, PowerPC etc.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Memory store data and program. 2 types: –Main memory Temporary storage (e.g. current program) Faster More expensive –Secondary storage Store data Slower Cheaper
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Memory Main Memory: RAM Secondary Storage: – Floppy disks – Hard Disk Drives – Compact Disc (CD) such as CD-ROM, CD-R, CD-RW, etc. – Digital Video Disc (DVD) such as DVD-ROM, DVD-R, DVD+R, DVD-RW, etc. – flash memory devices
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY I/O Input devices take data into computer systems. –Keyboard, mouse, joystick etc. Output devices provide data to outside of the systems. –Monitor, printer etc. Some devices act as both. –Touch-screen monitor, etc. Devices that transmit data are also considered I/O.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Data of Many Forms mechanical output sound input/output
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Software a set of instructions that used for controlling computer hardware. Hardware System software Application software User
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Applications vs. System SWs Application software is a program that helps user in accomplishing specific tasks productively. – word processors – spreadsheet – games – instant messenger – etc.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Applications
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Applications vs. System SWs System software is a program that is not directly intended to help accomplishing the user’s task but supports other application software. – operating systems – system tools (e.g. antivirus, archiving tools, disk defragmenter) – software development tools (e.g. compiler, debugger, integrated development environment suite).
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Binary Code Programs and data are represented using “ binary code ” String of binary digits For example: Each binary digit = one bit eight bits = one byte The simplest building block of a computer is a switch. ‘on’ / ‘off’ state
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Binary Decimal Conversion 2 0 = =9 n2n2n n2n2n :: :: :: :: ::
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Decimal Binary Conversion n2n2n n2n2n :: :: :: :: :: = =1 2 0 =
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Units of Measure PrefixPower of twoValue kilo (K)2 10 1,024 mega (M)2 20 1,048,576 giga (G)2 30 1,073,741,824 tera (T)2 40 1,099,511,627,776 E.g.: The capacity 1 gigabyte (Gb) equals to 1,073,741,824 bytes
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Problem Solving using Comp. Problem Defining Analysis Design Implementation Testing
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Problem Solving using Comp. Problem Defining Analysis Design Implementation Testing Understand what to be solved.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Problem Solving using Comp. Problem Defining Analysis Design Implementation Testing Determine inputs, outputs, and relevant factors.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Problem Solving using Comp. Problem Defining Analysis Design Implementation Testing Provide detailed process from inputs to outputs.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Problem Solving using Comp. Problem Defining Analysis Design Implementation Testing Write code.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Problem Solving using Comp. Problem Defining Analysis Design Implementation Testing Make sure the program deliver correct result. Fix “ bugs”.
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Example Problem defining: Find the amount of electrical current flowing through a resistant of R ohm when the circuit is driven a power source of 220 volts. V volts R I
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Example Analysis: R is input by the user via keyboard. The voltage is fixed at 220 volts. The resulting current I will be shown on screen. Design: The current can be calculated from I = V / R
Department of Computer Engineering Computer Programming for International Engineers I NTERNATIONAL S CHOOL OF E NGINEERING C HULALONGKORN U NIVERSITY Example Implementation: Write the code. Testing: