lec02-cs110 computational engineering

Download Lec02-CS110 Computational Engineering

Post on 22-May-2015

44 views

Category:

Education

0 download

Embed Size (px)

DESCRIPTION

A keynote on Problem Solving using Computers

TRANSCRIPT

  • 1. CS110: Models of Computing Lecture 2 V. Kamakoti 3rd January 2008

2. What IS a computer? A computer is a machine Something that operates mechanically But it is a flexible machine Its behaviour is controlled by a program A program is like a spell cast on a machine Programmers are like wizards Programs reside in the memory of the machine Charles Babbage (1791-1871) The stored program concept 3. Early Computing HardwareThe Slide ruleThe gear replaced the beads in early mechanical calculators History of computing hardware From Wikipedia, the free encyclopediaThe Chinese Abacus 4. Jaquard loomsUsed punched cards to weave different patterns 5. The Difference Engine Part of Babbage's difference engine, assembled after his death by Babbage's son, using parts found in his laboratory.The London Science Museum's replica Difference Engine, built from Babbage's design. 6. The First Programmer Augusta Ada King, Countess of Lovelace (December 10, 1815 November 27, 1852), born Augusta Ada Byron, is mainly known for having written a description of Charles Babbage's early mechanical general-purpose computer, the analytical engine.The programming language ADA is named after her. 7. ENIAC the first electronic computer Physically, ENIAC was massive compared to modern PC standards. It contained 17,468 vacuum tubes, 7,200 crystal diodes, 1,500 relays, 70,000 resistors, 10,000 capacitors and around 5 million hand-soldered joints. It weighed 30 short tons (27 t), was roughly 8 feet (2.4 m) by 3 feet (0.9 m) by 100 feet (30 m), took up 1800 square feet (167 m), and consumed 150 kW of power. 8. 2000: Intel Pentium 4 Processor Clock speed: 1.5 GHz # Transistors: 42 million Technology: 0.18m CMOS 9. High Level Prog.Assembly Language Structured Computer Operating SystemsDigital HardwareOrganization 10. A typical PC Specification from todays Newspaper Intel Core 2 Duo 6550 2.33GHz 2x2MB L2 Cache/ 1333MHz FSB Intel DG31PR Motherboard 2GB DDR2 RAM 667MHz 160GB SATA 3Gbps HDD Onboard Intel Graphics Controller Onboard 10/100Mbps Ethernet Onboard Sound card 19 Widescreen TFT Monitor (Viewsonic) Logitech Keyboard and Optical Mouse DVD Writer Creative 2.0 Speakers 500VA UPS 11. The computing machine PROCESSORMEMORY 01234.(say) 256 MEGABYTESThe computer is made up of a processor and a memory. The memory can be thought of as a series of locations to store information. 12. The computing machine PROCESSORMEMORY 01234.program256 MEGABYTESdataThe processor treats part of the information in memory as instructions, and a part of it as data. A program is a sequence of instructions assembled for some given task. Most instructions operate on data. Some instructions control the flow of the operations. It is even possible to treat programs as data. By doing so a program could even modify itself. 13. Variables Each memory location is given a name. The name is the variable that refers to the data stored in that location. Variables have types that define the interpretation data. e.g. integers (1, 14, 25649), or characters (a, f, G, H) All data is represented as binary strings. That is, it is a sequence of 0s and 1s, of a predetermined size word. A byte is made of 8 bits. 14. Instructions Instructions take data stored in variables as arguments. Some instructions do some operation on the data and store it back in some variable. The instruction XX+1 on integer type says that Take the integer stored in X, add 1 to it, and store it back in (location) X.. Other instructions tell the processor to do something. For example, jump to a particular instruction next, or to exit 15. Programs A program is a sequence of instructions. Normally the processor works as follows, Step A: pick next instruction in the sequence Program Counter Step B: Decode the instruction Step C: get data for the instruction to operate upon Step D: execute instruction on data (or jump) Step E: store results in designated location (variable) Different parts of the processor are responsible for the above steps. 16. Test Your Understanding Please copy in your notebook Name at least 20 important electronic circuitry/peripherals inside/connected to a PC. What are the four prominent levels in a Structured Computer Organization? What are the five steps taken by the processor to execute an instruction? 17. Test Your Understanding Please copy in your notebook Suppose each stage takes one millisecond, then each instruction takes five milliseconds to complete execution. Then 10000 instructions shall take 50000 milliseconds. Is there a way to improve this? 18. Answers 19. 20 components 1) 2) 3) 4) 5) 6) 7) 8)Motherboard Processor Chip Cache Bus Memory Printer USB pen drive External Disk 20. 20 components 9) CD/DVD Drive 10) Monitor 11) Webcam 12) Keyboard 13) Mouse 14) Graphics Card 15) Speaker 16) Mic 21. 20 components 17) Network Card - Wired 18) Wireless Network card 19) Power Supply 20) Floppy drive Four levels: High level, Assembler lang. level, Operating Systems and Digital Hardware 22. Making it fast Fetch + Inc. PCI5 I4 I3 I2 I1 I4 I3 I2 I1Decode Instrn Fetch Data Execute Instrn Store DataI3 I2 I1 I2 I1 I1First Instruction completes at end of 5th unit With Pipelining Second instruction 10000 Instructions th unit at end of 6 No pipelining takes 10000th instruction 50000 Units. Each at end of 10004 hardware is units independent. 23. The concept Instruction Level Parallelism You can use more than one CPU - Multicore 24. Creative Problem - 1 The Towers of Hanoi: Move from peg 1 to peg 3, such that a larger disk is not on top of a small one.Src: wikipedia 25. One disk - one move 26. One disk - one move 27. Two disks - three moves 28. Two disks - Move 1 29. Two disks - Move 2 30. Two disks - Move 3 31. Three disks - 7 moves 32. Three disks - move 1 33. Three disks - move 2 34. Three disks - move 3 35. Three disks - move 4 36. Three disks - move 5 37. Three disks - move 6 38. Three disks - move 7 39. The problem No. of Disks 1No. of Moves 12337nHow many? Prove it. 40. Thank You Monday Lab starts on Monday RF-ID 1 to 60 - Monday batch RF-ID 61 to 120 - Tuesday RF-ID 121 to 180 - Wed RF-ID 181 to 240 - Thurs RF-ID 241 to 300 - Fri Lab details + solution to Towers of Hanoi