1 / 47

COSC1078 Introduction to Information Technology Lecture 11 Machine Processing

James Harland james.harland@rmit.edu.au. COSC1078 Introduction to Information Technology Lecture 11 Machine Processing. Introduction. Who is this bloke?. Introduction. Introduction to IT. 1 Introduction 2 Images 3 Audio 4 Video WebLearnTest 1

delila
Download Presentation

COSC1078 Introduction to Information Technology Lecture 11 Machine Processing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to IT James Harland james.harland@rmit.edu.au COSC1078 Introduction to Information TechnologyLecture 11Machine Processing

  2. Intro to IT Introduction Who is this bloke?

  3. Intro to IT Introduction

  4. Intro to IT Introduction to IT 1 Introduction 2Images 3Audio 4Video WebLearnTest 1 5 Binary Representation Assignment 1 6 Data Storage 7Machine Processing 8 Operating Systems WebLearn Test 2 9 Processes Assignment 2 10 Internet 11Internet Security WebLearn Test 3 12Future of IT Assignment 3, Peer and Self Assessment

  5. Intro to IT Overview • Questions? • Assignments 1 & 2 • Machine Processing • Questions?

  6. Assignments The only way to submit it is via Blackboard If you have not done this, do so now! Assignment 2 will be in groups of 2 or 3 Get group set up (or changed) on Blackboard now Assignment 2 will be released later this week Lecture 11: Machine Processing Intro to IT

  7. Binary Codes “Meet me at Fred’s” 234 12.43434343 -620 0 1 1 0 0 1 1 0 Lecture 10: Binary Representation Intro to IT

  8. ASCII • American Standard Code for Information Interchange • 7-bit patterns to represent • letters (upper and lower case) • numbers • , . , ; “ $ % @ * & ! ? < > … • Total of 128 different characters Lecture 10: Binary Representation Intro to IT

  9. ASCII 01001000 H 01100101 e 01101100 l 01101100 l 01101111 o 00101110 . Hello! Unicode: uses 16 bits, can do Chinese, Japanese & Hebrew characters Lecture 10: Binary Representation Intro to IT

  10. Numbers Represented in binary notation 25 in ASCII is 00110010 00110101 8 bits per digit seems too much! Can represent 256 different numbers in 8 bits … Don’t want to add, multiply etc. in ASCII … Remember that 1 + 1 = 10 … Lecture 10: Binary Representation Intro to IT

  11. Two’s Complement How do you store negative numbers? Lecture 10: Binary Representation Intro to IT

  12. Two’s Complement 0 first means +ve (sign bit) 1 first means –ve +ve: Count from 0 up to 01n-1 -ve: Start from 1n down to 10n-1 3 is 011, -3 is 101 2 is 010, -2 is 110 1 is 001, -1 is 111 Lecture 10: Binary Representation Intro to IT

  13. Two’s Complement 1 + 2: add in obvious way 3 – 1: calculate as 3 + (-1) 011 + 111 = 1010 Answer is 010, ie 2. Can add and subtract with the same circuits Lecture 10: Binary Representation Intro to IT

  14. Excess Notation A different encoding of the numbers “naive” bit pattern encodes 4 more than actual value 100 (looks like 4) encodes 0 101 (looks like 5) encodes 1 110 (looks like 6) encodes 2 Lecture 10: Binary Representation Intro to IT

  15. Floating Point exponent Mantissa sign bit 1 bit for sign 3 bits for exponent 4 bits for mantissa 100.101 Lecture 10: Binary Representation Intro to IT

  16. Floating Point • Mantissa: digit sequence (1st digit always 1) • Exponent: where to put the . • This is generally given in ‘excess’ notation • Binary form of 2.423 x 104 01011001 means +ve 0.1001 shifted 101 place = 1.001 Lecture 10: Binary Representation Intro to IT

  17. Truncation Errors Beware adding small numbers to large ones! Finite length of encoding means that sometimes digits are lost Not often a problem, but can be … Lecture 10: Binary Representation Intro to IT

  18. Parity Bits • Add a ‘parity bit’ to each byte • Odd parity: make total of 1s in all 9 bits odd • Even parity: make total of 1s in all 9 bits even • If parity is wrong, then an error has occurred Lecture 10: Binary Representation Intro to IT

  19. Intro to IT What do computers do? • Compute! • Input/Output • Processing • Memory

  20. Intro to IT Moore’s Law “Processor speed doubles about every 18 months” -- Gordon Moore, Intel co-founder, 1965 • Intended for period 1965-1975 • Held true ever since 1965! • Must end sometime …

  21. Intro to IT Moore’s Law

  22. Intro to IT Moore’s Law

  23. Intro to IT Memory • Memory differs in performance and cost • Processor is typically much faster than memory

  24. Intro to IT Memory • Arranged as a hierarchy of cache Level 1 Level 2 Level 3 Main Memory

  25. Processing ALU MEMORY CPU BUS REGISTERS Lecture 11: Machine Processing Intro to IT

  26. Machine Instructions “Divide two numbers” Move first value from memory into register 1 Move second value from memory into register 2 If register 2 is zero, go to Step 6 Divide register 1 by register 2 & store result in register 3 Store register 3 value in memory Stop Lecture 11: Machine Processing Intro to IT

  27. Machine Instructions LOAD register 1 from memory LOAD register 2 from memory JUMP to Step 6 if register 2 is zero Divide register 1 by register 2 and store result in register 3 STORE register 3 value in memory Stop Lecture 11: Machine Processing Intro to IT

  28. Instructions in Binary? 01010100001010101010100110100010101001101001010010100011100010101010100101111001001010… 10101100 10110011 00010010 00110011 00111111 MEMORY LOAD register 1 LOAD register 2 JUMP …. STORE …. Lecture 11: Machine Processing Intro to IT

  29. One Scheme 16-bit operation codes(simple example) Operation Code (4 bits) Operand (12 bits) Represent as 4 Hexadecimal numbers (0-9,A-F) Each instruction is two bytes long Lecture 11: Machine Processing Intro to IT

  30. One Scheme 156C LOAD register 5 from memory 6C 166DLOAD register 6 from memory 6D 5056ADD register 5 & 6 & store in register 0 306ESTORE register 0 to memory 6E C000HALT .... (up to 216 = 65,536 different instructions) Lecture 11: Machine Processing Intro to IT

  31. Fetch Decode Execute FETCH Machine cycle EXECUTE DECODE Lecture 11: Machine Processing Intro to IT

  32. Two special registers Instruction register:holds current instruction Program counter:address of next instruction Fetch: Put instruction specified by program counter into instruction register Increment program counter by two Decode: Work out what to do Execute: Perform the instruction Lecture 11: Machine Processing Intro to IT

  33. Processing Address Contents A0 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 Program Counter Instruction Register Lecture 11: Machine Processing Intro to IT

  34. Processing A0 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 FETCH Program Counter 156C Instruction Register Lecture 11: Machine Processing Intro to IT

  35. Processing A2 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 FETCH Program Counter 156C Instruction Register Lecture 11: Machine Processing Intro to IT

  36. Processing A2 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 6C 2B DECODE Program Counter 156C Instruction Register Lecture 11: Machine Processing Intro to IT

  37. Processing A2 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 6C 2B Program Counter EXEC 156C Instruction Register 5 2B Lecture 11: Machine Processing Intro to IT

  38. Processing A2 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 FETCH Program Counter 166D Instruction Register Lecture 11: Machine Processing Intro to IT

  39. Processing A4 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 FETCH Program Counter 166D Instruction Register Lecture 11: Machine Processing Intro to IT

  40. Processing A4 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 DECODE Program Counter 166D Instruction Register Lecture 11: Machine Processing Intro to IT

  41. Processing A4 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 6D FF EXEC Program Counter 166D Instruction Register 6 FF Lecture 11: Machine Processing Intro to IT

  42. Processing A6 A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 FETCH Program Counter 5056 Instruction Register Lecture 11: Machine Processing Intro to IT

  43. Processing A0 15 A1 6C A2 16 A3 6D A4 50 A5 56 A6 30 A7 C0 A8 C0 A9 00 … Program Counter Instruction Register Lecture 11: Machine Processing Intro to IT

  44. Processing B4 EXEC Program Counter B258 Instruction Register Lecture 11: Machine Processing Intro to IT

  45. Processing 58 EXEC Program Counter B258 Instruction Register Lecture 11: Machine Processing Intro to IT

  46. Processing • Jump instructions change program counter • Can load any memory address into program counter (!!!) • Often use pipelining for efficiency • Fetch next instruction while executing • Processor doesn’t wait for fetch to complete • Can do more than one instruction … Lecture 11: Machine Processing Intro to IT

  47. Intro to IT Conclusion • Assignment 2 specified sometime this week • Finish reading book!

More Related