Week 3 - Topic 3 - How the Computer Works (PDF)

Summary

These notes detail the workings of computers, covering topics like computer architecture, machine instructions, and memory.

Full Transcript

Topic 3: How the Computer Works? © 2015 Pearson Education Limited 2015 Topic 3: How the Computer Works? What are Computers? How the Computer Works?! Computer Architecture Machine Instruction Terminology Machine Instruction Types Hexadecimal Notati...

Topic 3: How the Computer Works? © 2015 Pearson Education Limited 2015 Topic 3: How the Computer Works? What are Computers? How the Computer Works?! Computer Architecture Machine Instruction Terminology Machine Instruction Types Hexadecimal Notation Program Execution Cycle: CPU’s Main functions Main Memory Cells Main Memory Addresses Memory Terminology Mass Storage Measuring Storage Capacity © 2015 Pearson Education Limited 2015 1-2 3 What are Computers? ❑ A Computer is a programmable, digital device ❑ 2 Digits Only ❑ Hardware and Software CSCE101-Computer and Information Skills 4 How the Computer Works?! Input Output Processing Storage CSCE101-Computer and Information Skills How the Computer Works?! Contd. 5 Computer Architecture Computer Architecture Central Processing Unit (CPU) or processor: Main Component of a computer – Arithmetic/Logic unit – Control unit ALU Control Unit – Registers Registers General purpose: holds instructions/data during processing Special purpose: holds status of a program, ex. Program counter Bus: transfers data between different components Motherboard: hold the main electronic parts and let different pieces of the computer work together © 2015 Pearson Education Limited 2015 2-6 Figure 2.1 CPU and main memory connected via a bus A program can be encoded as bit patterns and stored in main memory. From there, the CPU can then extract the instructions and execute them. Computer Architecture © 2015 Pearson Education Limited 2015 2-7 Machine Instruction Terminology Machine instruction: An instruction (or command) encoded as a bit pattern recognizable by the CPU Machine language: The set of all instructions recognized by a machine © 2015 Pearson Education Limited 2015 2-8 Machine Instruction Types Data Transfer: copy data from one location to another Arithmetic/Logic: use existing bit patterns to compute a new bit patterns Control: direct the execution of the program © 2015 Pearson Education Limited 2015 2-9 Parts of a Machine Instruction Op-code: Specifies which operation to execute Operand: Gives more detailed information about the operation – Interpretation of operand varies depending on op-code – Example © 2015 Pearson Education Limited 2015 2-10 Hexadecimal Notation (review) Hexadecimal notation: A shorthand notation for long bit patterns – Divides a pattern into groups of four bits each – Represents each group by a single symbol Example: 10100011 becomes A3 © 2015 Pearson Education Limited 2015 1-11 Figure 2.6 Decoding the instruction 35A7: Identifying the operation type, source, destination © 2015 Pearson Education Limited 2015 2-12 Figure 2.2 Adding values stored in memory DT DT A/L DT © 2015 Pearson Education Limited 2015 C 2-13 14 Program Execution Cycle: CPU’s Main functions 1. Fetch 4. Increment 2. Decode 3. Execute Program Execution Cycle Controlled by two special-purpose registers – Program counter: address of next instruction – Instruction register: current instruction Machine Cycle – Fetch – Decode – Execute © 2015 Pearson Education Limited 2015 2-15 Figure 2.10 The program from Figure 2.7 stored in main memory ready for execution © 2015 Pearson Education Limited 2015 2-16 Figure 2.11 Performing the fetch step of the machine cycle © 2015 Pearson Education Limited 2015 2-17 Figure 2.11 Performing the fetch step of the machine cycle (continued) c. In the decoding step, CPU interprets the instruction and determines what operation needs to be performed. This involves identifying the opcode and any operands. d. In the execute step, The instruction in the ins. Register is executed by the CU/ALU © 2015 Pearson Education Limited 2015 2-18 Main Memory Memory Cell: A unit of main memory (typically 8 bits which is one byte) Memory Address: A “name” that uniquely identifies one cell in the computer’s main memory – The names are actually numbers. – These numbers are assigned consecutively starting at zero. – Numbering the cells in this manner associates an order with the memory cells. © 2015 Pearson Education Limited 2015 1-19 Figure 1.8 Memory cells arranged by address © 2015 Pearson Education Limited 2015 1-20 21 Memory Terminology Primary Storage Secondary Storage ❑ RAM (Random Access Memory) ❑ Magnetic (Hard disk) ❑ ROM (Read Only Memory) ❑ Optical (CD, DVD, Blu-ray) ❑ Solid state (Flash Storage) CSCE101-Computer and Information Skills 22 Storage 1. RAM ❑ Temporary Storage (volatile) ❑ Holds Data and Instructions waiting to be processed ❑ Memory in which individual cells can be easily accessed in any order CSCE101-Computer and Information Skills 23 Storage 2. ROM ❑ Permanent Storage (non-volatile) ❑ Read-only ❑ Holds Bootstrap Instructions CSCE101-Computer and Information Skills Mass Storage Additional devices: – Magnetic disks – Magnetic tape – CDs – Flash drives – DVDs – Solid-state disks Advantages over main memory – Less volatility – Larger storage capacities – Low cost – In many cases can be removed © 2015 Pearson Education Limited 2015 1-24 25 Storage 3. Hard Disk ❑ Permanent Storage (non-volatile) ❑ Mechanical Movement to Read/Write ❑ Stores Programs and Files CSCE101-Computer and Information Skills Figure 1.9 A magnetic disk storage system © 2015 Pearson Education Limited 2015 1-26 27 Storage 4. CD / DVD / Blu-ray ❑ Permanent Storage (non-volatile) ❑ Optical Pulses to Read/Write ❑ Portable storage for programs and files CSCE101-Computer and Information Skills Figure 1.10 CD storage © 2015 Pearson Education Limited 2015 1-28 29 Storage 5. Flash Storage ❑ Permanent Storage (non-volatile) ❑ Electrical Pulses to Read/Write ❑ Portable storage for programs and files ❑ Mass storage of choice for: Digital cameras, Smart Phones ❑ SD Cards provide GBs of storage CSCE101-Computer and Information Skills Measuring Storage Capacity Kilobyte: 210 bytes = 1024 bytes – Example: 3 KB = 3 times1024 bytes Megabyte: 220 bytes = 1,048,576 bytes – Example: 3 MB = 3 times 1,048,576 bytes Gigabyte: 230 bytes = 1,073,741,824 bytes – Example: 3 GB = 3 times 1,073,741,824 bytes © 2015 Pearson Education Limited 2015 1-30 End of Chapter © 2015 Pearson Education Limited 2015

Use Quizgecko on...
Browser
Browser