Computer Internals ECE2036. Lecture 2. ECE2036 Computer Internals Spring / 12

Similar documents
Describing and Implementing Algorithms

Concurrency ECE2893. Lecture 12. ECE2893 Concurrency Spring / 16

The Assembly Language of the Boz 5

Word Bank - questions 1-6. Place the letter of the matching term in the space provided. (2 pts. each)

Introduction to MIPS Processor

Chapter 04: Instruction Sets and the Processor organizations. Lesson 08: Processor Instructions - Part 1

ECE 30 Introduction to Computer Engineering

LAB 1: MC68000 CPU PROGRAMMING DATA TRANSFER INSTRUCTIONS

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

Compiling Techniques

Topic Notes: MIPS Instruction Set Architecture

2.2 THE MARIE Instruction Set Architecture

COMP MIPS instructions 2 Feb. 8, f = g + h i;

I. instruction J. instruction register K. label L. load M. load/store machine N. location counter (loc) O. MAR P. MDR

ECE 372 Microcontroller Design Assembly Programming. ECE 372 Microcontroller Design Assembly Programming

bits 5..0 the sub-function of opcode 0, 32 for the add instruction

We will use the accumulator machine architecture to demonstrate pass1 and pass2.

Machine Architecture and Number Systems CMSC104. Von Neumann Machine. Major Computer Components. Schematic Diagram of a Computer. First Computer?

EE 3170 Microcontroller Applications

Processor design - MIPS

MIPS Architecture and Assembly Language Overview

RISC-V Assembly and Binary Notation

Quiz 2 CSCI 1103 Computer Science I Honors KEY. Tuesday November 8, 2016 Instructor Muller Boston College. Fall 2016

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer

ECE331: Hardware Organization and Design

Chapter 04: Instruction Sets and the Processor organizations. Lesson 18: Stack-based processor Organisation

Lecture 6 Decision + Shift + I/O

MIPS ISA and MIPS Assembly. CS301 Prof. Szajda

Computer Architecture and Assembly Language 11/30/2017

Computer Architecture and Assembly Language

SAM Architecture Reference (Revised)

Chapter 2. Instructions:

Arithmetic for Computers

Computer Architecture Homework #1 Due: September 7, 2007 (F) (4 PM in ITT 305 mailbox or under my office door, ITT 313)

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

Assembler: Basics. Alberto Bosio October 20, Univeristé de Montpellier

Programmable Machines

MIPS Assembly Language

Number Systems and Their Representations

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

General-purpose computers

Quick Review. lw $t0, 4($a0) Registers x Memory. $a0 is simply another name for register 4 $t0 is another name for register (green sheet)

Programming with QtSpim: A User s Manual

MIPS Assembly Language Guide

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2)

Programmable Machines

Introduction to Embedded Microcomputer Systems Lecture 8.1. Computers in the future may weigh no more than 1.5 tons Popular Science, 1949

Machine Architecture and Number Systems

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam One 19 September 2012

EE 3170 Microcontroller Applications

ECE/CS 552: Introduction to Computer Architecture ASSIGNMENT #1 Due Date: At the beginning of lecture, September 22 nd, 2010

MIPS Assembly Programming

Computer Architecture

MIPS Memory Access Instructions

The MIPS Instruction Set Architecture

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2)

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

Cache Organizations for Multi-cores

Chapter 1. Computer Abstractions and Technology

Fast Arithmetic. Philipp Koehn. 19 October 2016

CS232 Final Exam May 5, 2001

Supplement for MIPS (Section 4.14 of the textbook)

Computer Systems Architecture

Computer Architecture 2/26/01 Lecture #

EEC 483 Computer Organization

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 153) Pass Marks: 24

CSCI 402: Computer Architectures. Instructions: Language of the Computer (4) Fengguang Song Department of Computer & Information Science IUPUI

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

MIPS Instruction Format

Chapter 2 Data Manipulation

Contents. Slide Set 1. About these slides. Outline of Slide Set 1. Typographical conventions: Italics. Typographical conventions. About these slides

Integer Arithmetic. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

EE 361 University of Hawaii Fall

Chapter 5: Computer Arithmetic. In this chapter you will learn about:

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Programming the Motorola MC68HC11 Microcontroller

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso

... Executing conditional instructions

ECE232: Hardware Organization and Design

Integer Multiplication and Division

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Sparse Notes on an MIPS Processor s Architecture and its Assembly Language

Lecture 01: Basic Structure of Computers

Course Administration

Computer Science 61C Spring Friedland and Weaver. Instruction Encoding

Computer Systems and Networks

Learning Objectives. Binary over Decimal. In this chapter you will learn about:

Computer Systems and Networks

Components of a Computer System

Programming at different levels

Computer Architecture. The Language of the Machine

ECE468 Computer Organization & Architecture. MIPS Instruction Set Architecture

Assembly language Simple, regular instructions building blocks of C, Java & other languages Typically one-to-one mapping to machine language

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

HW2 solutions You did this for Lab sbn temp, temp,.+1 # temp = 0; sbn temp, b,.+1 # temp = -b; sbn a, temp,.+1 # a = a (-b) = a + b;

361 div.1. Computer Architecture EECS 361 Lecture 7: ALU Design : Division

Assembly Language Programming

TSK3000A - Generic Instructions

Q1: /30 Q2: /25 Q3: /45. Total: /100

Transcription:

Computer Internals ECE2036 Lecture 2 ECE2036 Computer Internals Spring 2016 1 / 12

Components of a Computer 1 Central Processing Unit (CPU) 2 Memory 3 Input/Output Devices The computer actually has a number of other components, such as a power supply, case, cables, PCI bus, AGP bus, and many more. For the purposes of this class, we can safely ignore all of these and focus on the three components listed above. ECE2036 Computer Internals Spring 2016 2 / 12

Central Processing Unit 1 The CPU is the brains of the computer. 2 Step by step execution (think steps in an Algorithm) 3 Very simple operations (called Instructions) 1 Add, Subtract, Multiply, Divide two numbers 2 Compare two numbers 3 Advance to the next instruction 4 Conditionally Branch to a different instruction 5 Read or write a memory location 6 Read or write an input/output device 4 Instructions are stored in memory 5 After executing an instruction, the CPU automatically advances to the next instruction and executes that, unless the previous instruction was a Branch. ECE2036 Computer Internals Spring 2016 3 / 12

Memory Memory has two conceptually different attributes 1 Address 1 The Address identifies a particular memory location. 2 Similar to a page number identifying a particular page in a book, but does not identify what is written on that page. 3 Addresses are numbered sequentially from zero to N 1, where N is the size of the memory installed in the computer. For example, if you have 1GB (Giga-Byte) of memory, the locations are numbered from zero to 1,073,741,823. 2 Contents 1 The contents of a memory location is the number stored (Remembered) in a given address. 2 Each memory location has only a limited range of values that can be stored. For example, a typical integer value can only store values in the range of zero to 4,294,967,295. There is quite a bit more to the story about memory addresses and the range of values mentioned above that we will discuss later in class. For now, the above discussion is sufficient. ECE2036 Computer Internals Spring 2016 4 / 12

Input/Output Devices 1 Keyboard 2 Mouse 3 Monitor 4 Disk Drives 5 CD/DVD Drives 6 Network interface (Internet) 7 Audio Output (speakers, headphones) 8 Audio Input (microphone) 9 Universial Serial Bus (USB) devices In general, it is not possible for programs that you write to access any of these devices directly. Rather, the operating system (Windows, Linux, Mac OSX) is responsible for doing this on behalf or your program. ECE2036 Computer Internals Spring 2016 5 / 12

Computer Conceptual Model ECE2036 Computer Internals Spring 2016 6 / 12

Computer Conceptual Model (More Realistic) ECE2036 Computer Internals Spring 2016 7 / 12

CPU Registers All modern CPU s have built-in Registers. Usually just a small number (our sample CPU in the previous slide had 8). The registers are just memory locations, conceptually identical the to the main memory discussed earlier. The difference is that the CPU can read and write registers much much faster than reading and writing main memory. For example, register access usually takes a few nano-seconds, as opposed to a few tens of nano-seconds to access main memory. All arithmetic and comparision operations are register to register All memory read operations are memory to register All memory write operations are register to memory ECE2036 Computer Internals Spring 2016 8 / 12

CPU Instruction Set, Loads and Stores LDM R d, C Load Memory Read memory location C and store contents in register R d. LDM R d, R i, C Load Memory Read memory location C + R i and store contents in register R d. LDI R d, C Load Immediate Store the value C in register R d. LD R d, R s Load Copy the value of register R s into register R d. STM R s, C Store Memory Store the contents of register R s into memory location C. STM R s, R i, C Store Memory Store the contents of register R s into memory location C + R i. ECE2036 Computer Internals Spring 2016 9 / 12

CPU Instruction Set, Arithmetic Operations ADD R d, R s, R t Add Compute R s + R t, store results in R d ADDI R d, R s, C Add Immediate Compute R s + C, store results in R d SUB R d, R s, R t Subtract Compute R s R t, store results in R d SUBI R d, R s, C Subtract Immediate Compute R s C, store results in register R d MUL R d, R s, R t Multiply Compute R s R t, store results in R d DIV R d, R s, R t Divide Compute R s /R t, store results in R d (Integer quotient) MOD R d, R s, R t Modulus Compute R s MODULO R t, store results in R d (Integer remainder) ECE2036 Computer Internals Spring 2016 10 / 12

CPU Instruction Set, Branching Operations BLT R s, R t, I Branch if Less Than Branch to instruction at address I if R s < R t. BLE R s, R t, I Branch if Less Than or Equal Branch to instruction at address I if R s R t. BGT R s, R t, I Branch if Greater Than Branch to instruction at address I if R s > R t. BGE R s, R t, I Branch if Greater Than or Equal Branch to instruction at address I if R s R t. BEQ R s, R t, I Branch if Equal To Branch to instruction at address I if R s = R t. BNE R s, R t, I Branch if Not Equal To Branch to instruction at address I if R s R t. HLT Halt Stop Processing. Note No real processor has a HLT instruction ECE2036 Computer Internals Spring 2016 11 / 12

Averaging Algorithm, Assembly Code # Program t o compute average o f an a r r a y o f numbers LDI, R0,0 # Index i n t o d LDM, R1, Length # Get value of l ength LDI, R2,0 # I n i t a l i z e Sum to zero Loop : LDM, R4, R0, d # Read next element ADD, R2, R2, R4 # Add to sum STM, R2,Sum # Store r e s u l t i n Sum ADDI, R0, R0,1 # Increment index BLT, R0, R1, Loop # Repeat while index < length DIV, R0, R2, R1 # Sum / n STM, R0, Avg # Store r e s u l t i n Avg HLT # Done ECE2036 Computer Internals Spring 2016 12 / 12