l08 cpu function

Upload: loc-nguyen-huynh

Post on 03-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 L08 CPU Function

    1/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    L08-CS8421-9-15-08

    Class

    Wil l

    Start

    Momentari ly

    CS8421

    Computing Systems

    Dr. Ken Hoganson

    CPU Functions

  • 7/29/2019 L08 CPU Function

    2/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Topics

    Simple Memory PLA

    Half-Adder

    Exclusive-OR Topics from Chapter 3, Stallings:

    CPU Internal Components

    Instruction Cycle DiagramA Simple Example Computer

    Tracing Instruction Execution

  • 7/29/2019 L08 CPU Function

    3/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Simple Memory with NANDs

    Initial State?

    Show single bit memory from multiplexor. Build from selector+multiplexor+feedback..

    BABABAAB

    =+

    +=

  • 7/29/2019 L08 CPU Function

    4/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Programmable Logic Array

    Implementing

    boolean functions

    in hardware.

    (Combinations ofboolean variables)

    Initially, all lines connected. Programmed by blowing fusable links with large voltage. Some details abstracted.

  • 7/29/2019 L08 CPU Function

    5/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Half-Adder

    CPU must do (at a minimum) ADD, AND, COMPLEMENT. Allother operations can be made from these fundamentals (butslow).

    Half-Adder: adds two bits together without a carry-in.

    Show TT: I1, I2, Sum, Carry. Draw with AND, OR, Invertor. Show symbol for HA.

  • 7/29/2019 L08 CPU Function

    6/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Exclusive-OR

    Easy way to do the SUM part of the H-A.

    Introduce X-OR. TT and gates. Show HA with X-OR for SUM, and AND for carry.

  • 7/29/2019 L08 CPU Function

    7/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    CPU Functions

    At a minimum, the CPU must do: Addition AND COMPLEMENTAll other operations can be done with combinations: Subtraction is performed by complementing and

    adding NAND is a NOT AND NAND is a complete set of operations, so can be

    used to do all other Boolean operationsComputers actually build separate logic for other ops

    for better performance.We know how to build AND and NOT gates

    Need to explore how to do Addition

  • 7/29/2019 L08 CPU Function

    8/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Chapter 3 Computer Function

    CPU has three major componentsRegister Bank - a set of registers

    Temporary storage of values in the CPUwhile processing

    ALU - Arithmetic Logic Unit

    Control Unit - controls the sequence of eventsMemory stores data and programs (secondarystorage is disk)

    Memory is an array of storage locations

    Each location has an address, numbered

    sequentially

  • 7/29/2019 L08 CPU Function

    9/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Microcomputer Architecture

    Main

    Mem

    I/O

    DevSecondaryStore Disk

    Op Sys

    Bus

    CPU

    Cache

    on MB

    Inst

    Cache

    Inst

    Cache

    H-S

    I/O

    BridgeH-S Bus

    Focus on the CPU today.Assume cache works invisibly

    behind the scenes, w ill beignored for this discussion.

  • 7/29/2019 L08 CPU Function

    10/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    ALU

    ALU operates on registers Comparisons Math operations manipulating bits

    Implemented with logic gates (AND, NAND) Operates on values stored in registers, sometimes

    with memory values Takes data in registers, manipulates, outputs

    results back to registers which operation is performed is determined by the

    bits in the computer instruction. The process ofdetermining which operation to perform is calleddecoding

  • 7/29/2019 L08 CPU Function

    11/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Control Unit

    Controls the sequence of events Implemented with gates and clocks

    generates control signals, like the one that

    determines read or write on a register of D flip-flop

    One traditional computer system, the control unit

    takes up most of the available transistor-space onthe CPU chip

  • 7/29/2019 L08 CPU Function

    12/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    CPU Internals

  • 7/29/2019 L08 CPU Function

    13/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Instruction Cycle State Diagram

    Interrupt

    Check

    Also Illustrates the Bus/Mem Bottleneck

    Pg 63 in Stallings

  • 7/29/2019 L08 CPU Function

    14/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    CPU Operation Walk-Through

    A Simple Example Computer,

    Continued next page.

  • 7/29/2019 L08 CPU Function

    15/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    4-bits first Hex

    digit is Opcode:

    0001 Load AC from

    Mem

    0010 Store AC toMem

    0101 Add Mem to

    ACPg 62 in Stallings

    IF

    IF

    IF

    Load

    Add

    Store

    +

    +

    +

  • 7/29/2019 L08 CPU Function

    16/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Homework

    Extend/continue the program fragment: Write instructions (starting at location 303) thatwill:

    subtract the contents of memory location 942from the contents of the accumulator

    Store the result in memory location 943

    We will choose 3 to be the opcode for subtractmemory from the accumulator

  • 7/29/2019 L08 CPU Function

    17/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    End of Lecture

    End Of

    Todays Lecture.

    l k l d

  • 7/29/2019 L08 CPU Function

    18/18

    CS 8421 Computing Systems, Dr. Hoganson

    Copyright 2004, 2006, Dr. Ken Hoganson

    Blank Slide