Introduction. The CPU and Memory. System Block Diagram. Components of a CPU 30/03/2008. In a Computer. Memory is separate from the CPU

Similar documents
CHAPTER 7: The CPU and Memory

MICROPROCESSOR AND MICROCOMPUTER BASICS

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

(Refer Slide Time: 00:01:16 min)

Microprocessor & Assembly Language

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

Computer organization

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Central Processing Unit (CPU)

CPU Organisation and Operation

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-17: Memory organisation, and types of memory

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Computer Organization. and Instruction Execution. August 22

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

PART B QUESTIONS AND ANSWERS UNIT I

TIMING DIAGRAM O 8085

The Central Processing Unit:

Central Processing Unit

Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Chapter 4 System Unit Components. Discovering Computers Your Interactive Guide to the Digital World

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

1 PERSONAL COMPUTERS

1 Classical Universal Computer 3

MACHINE ARCHITECTURE & LANGUAGE

Discovering Computers Living in a Digital World

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Parts of a Computer. Preparation. Objectives. Standards. Materials Micron Technology Foundation, Inc. All Rights Reserved

Let s put together a Manual Processor

BASIC COMPUTER ORGANIZATION AND DESIGN

A3 Computer Architecture

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Chapter 02: Computer Organization. Lesson 04: Functional units and components in a computer organization Part 3 Bus Structures

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions

Chapter 13. PIC Family Microcontroller

Summary of the MARIE Assembly Language

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

Chapter 1 Computer System Overview

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

Computer Systems Structure Input/Output

Here is a diagram of a simple computer system: (this diagram will be the one needed for exams) CPU. cache

Chapter 2 Logic Gates and Introduction to Computer Architecture

MULTIPLE CHOICE FREE RESPONSE QUESTIONS

Building a computer. Electronic Numerical Integrator and Computer (ENIAC)

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Notes on Assembly Language

CSCA0102 IT & Business Applications. Foundation in Business Information Technology School of Engineering & Computing Sciences FTMS College Global

Introduction to Microcontrollers

Lecture N -1- PHYS Microcontrollers

CPU Organization and Assembly Language

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design

1 Computer hardware. Peripheral Bus device "B" Peripheral device. controller. Memory. Central Processing Unit (CPU)

Basic Computer Organization

An Introduction to MPLAB Integrated Development Environment

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

Administrative Issues

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

8085 INSTRUCTION SET

PC Build and Manual Part 1

Systems I: Computer Organization and Architecture

VMWare Workstation 11 Installation MICROSOFT WINDOWS SERVER 2008 R2 STANDARD ENTERPRISE ED.

Primary Memory. Input Units CPU (Central Processing Unit)

Computer Systems Structure Main Memory Organization

================================================================

An Overview of Stack Architecture and the PSC 1000 Microprocessor

Lecture 2: Computer Hardware and Ports.

The 104 Duke_ACC Machine

Computer Components Study Guide. The Case or System Box

Chapter 3: Computer Hardware Components: CPU, Memory, and I/O

CSCI 4717 Computer Architecture. Function. Data Storage. Data Processing. Data movement to a peripheral. Data Movement

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

Z80 Microprocessors Z80 CPU. User Manual UM Copyright 2014 Zilog, Inc. All rights reserved.

EC 362 Problem Set #2

Computer Basics: Chapters 1 & 2

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Computer Organization and Components

OVERVIEW OF MICROPROCESSORS

An Introduction to the ARM 7 Architecture

Module 1 Introduction to Information and Communication Technologies

RAM & ROM Based Digital Design. ECE 152A Winter 2012

Microprocessor or Microcontroller?

BIOS and CMOS. Overview. The Function of BIOS. The Bus

Chapter 1. The largest computers, used mainly for research, are called a. microcomputers. b. maxicomputers. c. supercomputers. d. mainframe computers.

İSTANBUL AYDIN UNIVERSITY

Memory Basics. SRAM/DRAM Basics

Transcription:

The CPU and Memory Introduction In a Computer Memory is separate from the CPU All data is in binary (not decimal) Central Processing Unit Text: Chapter. 7 Rev for 3 rd Ed June 2003 Rev/ System Block Diagram Input/output interface CPU ALU Control unit Program counter Highest Address Memory Lowest Address Page 150 Components of a CPU ALU (arithmetic and logic unit) Perform arithmetic and logic operations Arithmetic: add, subtract, multiply, divide, etc. Logic: AND, OR, NOT, Shift, etc. Control unit Interprets instructions Controls the flow of information within the CPU Works with a program counter (address of next instruction) Input/output interface Provides mechanism for input and output of data Many variations possible Page 150 1

Program Counter Sometimes called instruction pointer. Contains address of current or next instruction. Usually increased automatically at end of instruction cycle, but may be changed deliberately by program. Changes in PC create branches in program. ( See also: Slide # 22 ) Page 151 Registers A register is a storage location within the CPU Unlike memory, which is outside the CPU Examples of registers: Accumulator (ACC) Program counter (PC) Instruction register (IR) Memory address register (MAR) Memory data register (MDR) Status register General purpose registers (R0, R1, ) Included on some CPUs Used for high-speed temporary storage Page 151 Memory Unit Memory Capacity n bits Me emory address regis ster Memory cell bit 0 0 bit 1 1 2 3 4 Address decoder bit n - 1 2 n -1 0 1 2 m -1 Memory data register m bits Page 154 2 n x m n address bits = 2 n addresses m data bits m is the width of the data path Typical values: n: 16, 17, 18, 19, 20, 21, 22, etc. m: 8, 16, 32, 64 Page 157 2

Question Q: How many bits of memory are contained in a memory unit with 512KB of memory? A: 512 = 2 9, K = 2 10, B = byte = 8 = 2 3 Exercise Memory Capacity Q: How many bits of memory are contained in a memory unit with 2MB of memory? A: 2 9 x 2 10 x 2 3 = 2 22 = 4,194,304 Skip answer Answer Exercise Memory Capacity Answer Q: How many bits of memory are contained in a memory unit with 2MB of memory? A: 2 = 2 1, M = 2 20, B = byte = 8 = 2 3 2 1 x 2 20 x 2 3 = 2 24 = 16,777,216 Memory Implementations RAM random access memory Static RAM Dynamic RAM ROM read-only memory EPROM erasable programmable ROM Flash ROM Pages 158 to 160 3

Program Counter ( PC ) A dedicated register in the CPU. Contains the address in memory of the current instruction being executed. Incremented automatically after each instruction. May be forced to change: eg jump instruction. Usually initialize to zero when machine starts, or is reset. Instruction Register ( IR ) A dedicated register in the CPU which contains the actual current instruction. Op Code + Address What To Do Location of Data Simple 16-bit example: 1101 101101100100 Memory Address Register (MAR) Contains Address in memory to find or place data. Memory Data Register (MDR) Contains Actual Data to be placed in location given in MAR, or which has been retrieved from location given in MAR. Accumulator A dedicated register (or set of registers) in the CPU used for the actual manipulation of data. Default source (or destination) register. Usually contains results of arithmetic or logical operations. 4

Generic CPU With Registers Program Counter ( PC ) Instruction Register ( IR ) Memory Address Register ( MAR ) Memory Data Register ( MDR ) Accumulator ( A or Acc ) Memory Fetch-Execute Cycle Two steps, or cycles, in the execution of every instruction Fetch fetch the code for the instruction from memory and place it in the IR (instruction register) Execute execute the instruction A pretty picture sometimes helps Fetch Execute time The Store Instruction The Add Instruction Fetch PC MAR MDR IR Fetch PC MAR MDR IR Execute IR[address] MAR A MDR time Execute IR[address] MAR A + MDR A time PC + 1 PC PC + 1 PC Text: Pages 160-162, 3 rd Ed. 5

Fetch-Execute Example: Load Accumulator CPU Before PC increments Assume: Simple Eight bit system. Thirty-two two memory locations (0 to 31). Load instruction is 010. Value in location 15 is ten (ie: binary 00001010) PC: 00101 IR: (previous) PC is at 5, about to increment. The instruction, 01001111, is in location 6. MAR: (previous) MDR: (previous) Then... Increment PC: PC = PC + 1 MAR loaded with PC: PC -> MAR IR: (previous) IR: (previous) MAR: (previous) MAR: 00110 MDR: (previous) MDR: (previous) 6

Memory 0110 Accessed and Contents Placed in MDR: Memory 0110 Accessed and Contents Placed in MDR: IR: (previous) IR: (previous) MAR: 00110 MAR: 00110 MDR: (previous) MDR: 01001111 MDR copied to IR: MDR -> IR IR [ address part ] -> MAR MAR: 00110 MAR: 01111 MDR: 01001111 MDR: 01001111 7

Location in MAR (01111) Accessed Contents of 01111 loaded into MDR MAR: 01111 MAR: 01111 MDR: 01001111 MDR: 00001010 IR [op code] executed: MDR -> A Finished! MAR: 01111 MAR: 01111 MDR: 00001010 MDR: 00001010 8

PC = PC + 1 Now: Assume: Value in location 7 is 10110010. Add instruction is 101. Value in location 18 is seventy-one (ie: binary 01000111) Everything else is as we left it! MAR: 01111 Then... MDR: 00001010 PC -> MAR MAR Accesses 0111 MAR: 00111 MAR: 00111 MDR: 00001010 MDR: 00001010 9

Contents of 00111 -> MDR MDR -> IR IR: 10110010 MAR: 00111 MAR: 00111 MDR: 10110010 MDR: 10110010 IR [address] -> MAR Location 10010 [MAR] Accessed IR: 10110010 IR: 10110010 MAR: 10010 MAR: 10010 MDR: 10110010 MDR: 10110010 10

Contents of [10010] -> MDR IR [opcode] executed: A = A + MDR IR: 10110010 IR: 10110010 MAR: 10010 MAR: 10010 MDR: 01000111 MDR: 01000111 A: 01010001 Buses To Continue: If the next instruction were to load the Accumulator contents into an area of memory reserved for screen output (for example), then the number 81 should appear on the screen. The process continues in the same fashion, more or less, until a stop or halt instruction is encountered. Definition: a collection of electrical conductors (eg: (g wires, traces) with a common purpose Each wire or trace is called a line Typically, buses carry information from one place to another Page 163, ff From our first lecture Ed: k c 11

Printer Mouse Keyboard Modem Ports CPU RAM bus Disk controller Graphics card Sound card Network card Monitor Speakers Computer Types of Buses (1 of 3) Point-to-point Serial port Control unit Modem ALU Types of Buses (2 of 3) Buses Inside a Computer Multipoint Computer Computer Data bus Address bus Control bus Computer CPU Memory Computer CPU Memory I/O Module Motherboard Many configurations possible Disk controller Video controller I/O Device 12

Data Bus Carries data between the CPU and memory or I/O devices Bi-directional Data transferred out of the CPU for write operations Data transferred into the CPU for read operations Typical sizes: 8, 16, 32, 64 lines Signal names: D0, D1, D2, D3, etc. Address Bus Carries an address from the CPU to Memory or I/O devices Unidirectional The address is always supplied by the CPU (There is one exception to this, which we ll discuss later.) Typical sizes: 16, 20, 24 lines Signal names: A0, A1, A2, A3, etc. Control Bus Collection of signals for coordinating CPU activities Each signal lhas a unique purpose Typical sizes: 10-20 lines Signals are output, input, or bi-directional Typical signals /RD (read) /WR (write CLK (clock) /IRQ (interrupt request) etc. 13