Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 2. How does the computer work? Prof. Sin-Min Lee Department of Computer Science.

Similar presentations


Presentation on theme: "Lecture 2. How does the computer work? Prof. Sin-Min Lee Department of Computer Science."— Presentation transcript:

1 Lecture 2. How does the computer work? Prof. Sin-Min Lee Department of Computer Science

2

3 Practice, Practice, Practice! Use casette tape recorder to listen, practice Try videotaping Seek feedback from friends Use phrases, not sentences Notes separate from slides (don’t read slide) Pick appropriate font, size (~ 24 point to 32 point) Estimate talk length ­ 2 minutes per slide Use extras as backup slides (Question and Answer) Use color tastefully (graphs, emphasis) Don’t cover slides Use overlays or builds in powerpoint

4 ‘Computer” of the day Jacquard loom late 1700’s for weaving silk “Program” on punch cards “Microcode”: each hole lifts a set of threads “Or gate”: thread lifted if any controlling hole punched

5 Card Punch Early “programmers” were well-paid (compared to loom operators)

6 Computer Architecture = Instruction Set Architecture + Machine Organization + …

7

8 Instruction Set Architecture Instruction set architecture is the attributes of a computing system as seen by the assembly language programmer or compiler. This includes –Instruction Set (what operations can be performed?) –Instruction Format (how are instructions specified?) –Data storage (where is data located?) –Addressing Modes (how is data accessed?) –Exceptional Conditions (what happens if something goes wrong?) A good understanding of computer architecture is important for compiler writers, operating system designers, and general computer programmers.

9

10

11

12 Understanding Computer Basics

13 Computer Case- The part of a computer system that houses the microprocessor, the RAM (Random Access Memory), and the Motherboard. This case also houses the disk drives. CPU (Central Processing Unit) - A chip or circuit that interprets and executes programs by processing a list of machine instructions which perform binary operations on data stored in memory. The portion of hardware in a computer which interprets instructions and then executes them. It is the heart of any computer system.

14 Memory- The internal component that the computer uses to temporary store data and programs. There are two kinds of computer memory: RAM (Random Access Memory) and ROM (Read-Only Memory). RAM loses its data if the power is turned off; ROM retains its information whether the computer has power or not. Users are unable to erase ROM. Not to be confused with storage devices such as hard drives, floppy disks, or other such devices. Data is processed in RAM memory; it is stored on a storage device.

15 Motherboard- The main circuit board in the computer.Every device is connected to the Motherboard. Also called planar, system board, or backplane, depending on the architecture of the board.

16 Intel, the world's biggest semiconductor maker, said Monday it built a test chip with a new process that creates faster circuits by packing 10 million transistors into an area the size of the tip of a ballpoint pen. Intel, based in Santa Clara, Calif., has made the first working memory chip that uses so-called 65-nanometer technology to shrink the circuits inside chips, Intel researcher Mark Bohr said during a conference call. Aug. 31, 2004, 12:05AM Big gain in small package Intel test chip boasts technology to add to speed

17 Video Card –This card connects to the Motherboard and the computer monitor connects to the videocard. That is how images are interpreted and displayed to the monitor.

18 Network card- Device connected to the motherboard which is used for communicating on a network to other computers, printers and other electronic devices (ex. Phones, cell phones ect…)

19 Network Card- Device connected to the motherboard which is used for communicating on a network to other computers, printers and other electronic devices (ex. Phones, cell phones ect…) Network Card Driver- A program that instructs the device on how to operate.

20 Hard Drive- A device that is connected to the motherboard and is used for storage of data files. Usually this device is referred to as your c:\ drive. Storage capacity can be measured in Kb, Mb, Gb and Tb.

21 Floppy Drive- A device that is also connected to the motherboard that allows you to use a portable storage media called floppies;which are used to store data. The floppies come 5 ¼’’(which are no longer popular) and 3 ½’’ sizes (which is still the most widely used media up-to-date.). The floppies storage capacity is no where near the storage capacity of a harddrive. ( Ex. 1Gb Harddrive can hold information that is on 695 floppies);Get the point?

22 Bit

23 so a k is... k in computing is short for kb or kilobyte where kilo means the same as anywhere else in our measurement system: 1000 so a k is 1000 bytes how about Mb? b for byte again, and M for mega: megabyte big M for mega, small m means milli, or one thousandth, 1/ 1000 as in mm, thousandths of a metre mega in our measurement system means one million, 1 000 000 or a thousand thousand, so a megabyte is a thousand kilobytes or one million bytes how about GB? you can now buy hard disk drives in Gb, gigabytes, thousands of Mb or thousands of millions of bytes, so a 5Gb HDD holds 5000 Mb of data with some large computers storing up to Tb, terabytes... yup, thousands of Gb... so one terabyte (Tb) = 1000 gigabytes (Gb) = 1000 000 megabytes (Mb) = 1000 000 000 kilobytes (kb) = 1 000 000 000 000 bytes or one thousand billion bytes of information

24

25 CD-ROM DRIVE- means Compact Disk - this drive uses a laser to read (read-only) the information in the tiny but complex pattern stamped permanently onto computer compact disks. Read Only Memory CD's are much tougher than floppies, and hold more than 600Mb of information CD-writer drives are now available,so people can burn their own CDs, e.g. to backup files permanently established computer shops or print shops now have their own CD-writers, and will backup your files by burning them.You can also record your music CD.

26 What is a Computer? Data Primitive Operations Sequence Control Data Access Storage Management Operating Environment May be actual hardware computer or software- simulated computer. Most computers a combination of the two.

27 In mathematics you don't understand things. You just get used to them. John von Neumann

28

29

30

31 Typical Machine Layout Two cycles: Fetch cycle - get instruction Execute cycle - do operation

32

33

34 Typical Machine Execution Typical fetch cycle: (M(x) means contents of x) 1.M(IC)  MAR [Memory Address register] 2.IC +1  IC [Instruction Counter] 3.Read memory into MDR [Memory Data Register] 4.MDR  IR [Instruction Register for decoding]

35 Typical Machine Execution (continued) Typical execute cycle: (OP R,X, DISP is instruction) 1.IR decoded into OP R, EA –OP is operation code (e.g., 8 bits) –R is register (e.g., 4 bits -- 16 registers) –EA is effective address (e.g., 20 bits) 2.M(X)+DISP  MAR (EA  MAR) 3.Read memory into MDR 4.M(R)  ALU; M(MDR)  ALU 5.Do operation OP in ALU; ALU  R For 500 MHZ: Each instruction 9-10 cycles (50 MIPS) By overlapping fetch and execute cycles, get 60-70 MIPS

36 Typical Machine Translation For example: As we see later, memory for data in blocks of storage pointed to by a register: X = Y + Z could be translated as: load R1, R2, 28[Location of Y] add R1, R2, 40 [Location of Z] store R1, R2, 24[Location of X] Instruction format: Opcoderegister, index, offset load R1, R2, 24

37 Ways to Construct a Computer Hardware Realization –Any precisely defined algorithm or data structure may be realized in hardware. Firmware Realization –Microprogramming or emulation Virtual Machine –Provided by a language environment Combination

38

39

40

41

42 Von Neumann Model of Execution Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction Obtain instruction from program storage Determine required actions and instruction size Locate and obtain operand data Compute result value or status Deposit results in storage for later use Determine successor instruction Almost all Modern Computers are Von Neumann machines

43

44

45

46

47

48

49

50

51

52

53

54

55 Decimal system, base 10 History -- we have 10 fingers 253 means 2*100 + 5*10 + 3*1 1,10,100 (from R to L) are the “weights” 10 digits, values 0 through 9 After 9 comes 10 (double digits) Grade school learn by rote 7*9 = 63 Nothing magic -- we are trained on it

56 Octal system, base 8 Mickey Mouse has 8 fingers 253 means 2*64 + 5*8 + 3*1 1, 8, 64 are the weights 8 digits, values 0 through 7 After 7 comes 10 Used to display memory addresses in some older computers e.g., 177462

57 Hexadecimal system, base16 16 digits, values 0 - 9 and A-F 3B6 means 3*256 + B*16 + 6*1 1, 16, 256 are the weights After F comes 10 Used to display memory addresses in most modern computers e.g., 3C0F 95EA

58 Binary system, base 2 2 digits, values 0 and 1 1011 means 1*8 + 0*4 + 1*2 + 1*1 1, 2, 4, 8 are the weights After 1 comes 10 Count 0 1 10 11 100 101 110 111 1000

59 Binary system, base 2 Used to do calculations in all computers Used to store values in memory and on disk Not practical for people 100101011101 = 4701

60 Best way to use number systems Binary system inside the computer (storage and calculations reduce to simple logic, the main subject of Comp 120) Input-Output done in decimal for user Software translates in both directions

61 Convert Binary to Decimal Binary Value 10101 1*16 + 0*8 + 1*4 + 0*2 + 1*1 = 21 Convert these: 1100 = ? 1001 = ? 0111 = ?

62 Convert Decimal to Binary Given decimal value 53 53 21 5 1 64 32 16 8 4 2 1 1 1 0 1 0 1 18 = ? 31 = ?

63 Decimal notation with fractions 72.53 means: 7*10 + 2*1 + 5*.1 + 3*.01 The “.” is the decimal point Weights are 100 10 1 “.”.1.01.001 This is not scientific notation This is not floating point storage

64 Binary notation with fractions 110.10 binary means: 1*4 + 1*2 + 0*1 + 1*.5 + 0*.25 = 6.5 dec The “.” is the binary point Weights are 8 4 2 1 “.” 1/2 1/4 1/8 This is not scientific notation This is not floating point storage 11.11 binary = ? decimal

65 Memorize dec, hex, binary counts 00000881000 11001991001 2201010A1010 3301111B1011 4410012C1100 5510113D1101 6611014E1110 7711115F1111

66 Convert Binary to Power 2 base Very easy -- convert digit-by-digit A27F 1010 0010 0111 1111 (Hex-Bin) 327 011 010 111 (Octal-Binary) B4C5 = ? 1010 0110 1001 = ?


Download ppt "Lecture 2. How does the computer work? Prof. Sin-Min Lee Department of Computer Science."

Similar presentations


Ads by Google