Docsity

Understanding the Basics of MIPS Architecture: Instruction Fetch, Decode, and Execution, Lecture notes of Computer Science

Partial preview of the text

Download Understanding the Basics of MIPS Architecture: Instruction Fetch, Decode, and Execution and more Lecture notes Computer Science in PDF only on Docsity!

Computer Fundamentals

6L for CST/NST 1A

Michaelmas 2010

MWF @ 10, Arts School “A”

Aims & Objectives

  • This course aims to:
    • give you a general understanding of how a computer works
    • introduce you to assembly-level programming
    • prepare you for future courses...
  • At the end of the course you’ll be able to:
    • describe the fetch-execute cycle of a computer
    • understand the different types of information which may be stored within a computer memory
    • write a simple assembly language program

Course Outline

  • We’ll cover the following topics:
    • A Brief History of Computing
    • Operation of a Simple Computer
    • Input / Output
    • MIPS Assembly Language
  • This course is new this year, but derives from

Part I of pre-2010 CST 1A “Operating Systems”

  • This will help in finding e.g. past exam questions
  • Feel free to ask questions during the lecture
  • or after it, or via email – see course web page

A Chronology of Early Computing

  • (several BC): abacus used for counting
  • 1614 : logarithms discovered (John Napier)
  • 1622 : invention of the slide rule (Robert Bissaker)
  • 1642 : First mechanical digital calculator (Pascal)
  • Charles Babbage (U. Cambridge) invents:
    • 1812 : “Difference Engine”
    • 1833 : “Analytical Engine”
  • 1890 : First electro-mechanical punched card data- processing machine (Hollerith)
  • 1905 : Vacuum tube/triode invented (De Forest)

The Von Neumann Architecture

  • 1945 : von Neumann drafts “EDVAC” report
    • design for a stored-program machine
    • Eckert & Mauchley mistakenly unattributed

Further Progress…

  • 1947 : “point contact” transistor invented

(Shockley, Bardeen & Brattain)

  • 1949 : EDSAC, the world’s first stored-program

computer (Wilkes & Wheeler)

  • 3K vacuum tubes, 300 square feet, 12 kW,
  • 500KHz, circa 650 IPS, 225 MPS.
  • 1024 17-bit words of memory in mercury ultrasonic delay lines – early DRAM ;-)
  • 31 word “operating system” (!)
  • 1954 : TRADIC, first electronic computer

without vacuum tubes (Bell Labs)

Languages and Levels

  • Computers programmable with variety of different languages.
    • e.g. ML, java, C/C++, python, perl, FORTRAN, Pascal,...
  • Can describe the operation of a computer at a number of different levels; however all levels are functionally equivalent
  • Levels relate via either (a) translation, or (b) interpretation.

Layered Virtual Machines

  • Consider a set of machines M0, M1,... Mn:
    • Machine M i understands only machine language L i
    • Levels 0, -1 covered in Digital Electronics, Physics,
    • Level 2 will be covered in CST 1A Operating Systems
  • This course focuses on levels 1 and 3
  • NB : all levels useful; none “the truth”.

Virtual Machine M5 (Language L5) Virtual Machine M4 (Language L5) Virtual Machine M3 (Language L3) Virtual Machine M2 (Language L2) Virtual Machine M1 (Language L1) “Actual” Machine M0 (Language L0)

High-Level Language, e.g. ML Compiled Language (e.g. C++) Assembly Language Programs Operating System Level Computer Organization Level Digital Logic Level

Software Hardware

A (Simple) Modern Computer

A (Simple) Modern Computer

|

Devices: for input and output

Memory: stores programs & data

Processor (CPU): executes programs

Bus: connects everything together

Memory Hierarchy

  • Use cache between main memory & registers to hide “slow” DRAM
  • Cache made from faster SRAM: more expensive, and hence smaller.
    • holds copy of subset of main memory.
  • Split of instruction and data at cache level:
    • “Harvard” architecture.
  • Cache <-> CPU interface uses a custom bus.
  • Today have ~8MB cache, ~4GB RAM.

Static RAM (SRAM)

  • Relatively fast (currently 5 − 20 ns ).
  • This is the Digital Logic view:
    • Some wires, some gates, and some “D-latches”

SRAM Reality

  • Data held in cross-coupled inverters.
  • One word line, two bit lines.
  • To read :
    • precharge both bit and bit, and then strobe word
    • bit discharged if there was a 1 in the cell;
    • bit discharged if there was a 0.
  • To write :
    • precharge either bit (for “1”) or bit (for “0”),
    • strobe word.

Dynamic RAM (DRAM)

  • Use a single transistor to store a bit.
  • Write : put value on bit lines, strobe word line.
  • Read : pre-charge, strobe word line, amplify, latch.
  • “Dynamic”: refresh periodically to restore charge.
  • Slower than SRAM: typically 50ns − 100ns.