Top Banner
Computer Science 516 Week 3 Lecture Notes
25

Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Jan 03, 2016

Download

Documents

Winfred Fields
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Computer Science 516

Week 3 Lecture Notes

Page 2: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Computer Architecture - Common Points

• This lecture will cover some common things which characterize computer architectures

• We will also look at two computer families in this lecture

• Two or three more to cover next week• First, the basics…

Page 3: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Von Neumann Architecture

Also called Princeton or IAS (Institute For Advanced Studies)

Page 4: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Harvard Architecture

Based on 1944 Mark I computer

• Note separate memories for data and for instructions

Page 5: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

And the winner is...

• Many designs today use a modified Harvard design– Single memory rather than separate data and

instruction memories– Separate data and instruction caches

• Generally not a programmer-visible feature

Page 6: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Arithmetic

• Generally Binary arithmetic– Arithmetic performed in registers– Many designs offer decimal arithmetic– Decimal may be performed in storage rather than

registers

Page 7: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Registers

• Very high speed storage area• Input to/Output from Adder circuit, etc.• Defines word size

Page 8: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Word size

• The number of bits in the basic binary arithmetic unit

• Many sizes– Generally 16, 32, 64 bits– Some older machines used different sizes

Page 9: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Memory

• May be word addressable or byte/character addressable

• Actual size of transfers to/from memory is called Data Path Size– Generally not a programmer visible feature

• Memory size generally limited to largest number a register holds– May be smaller– May be bigger

Page 10: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Programmer Visible Features

• Programmer Visible means a program can see or change it

• Typical Programmer Visible Features– Registers– Storage contents– Program counter (current instruction address)– Status bits (Zero, Overflow, Negative, Carry)

Page 11: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Many Features Not Visible To Programmers

• Storage Address Register (SAR - also MAR)• Storage Data Register (SDR - also MBR)• Storage Parity Bits• Instruction Register• Many others

Page 12: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Instruction Result Status

• When an instruction completes, status may be set

• Status used to implement if statements• Status carried in status bits– AKA status flags– AKA condition code

Page 13: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Instruction Result Status Example

C++ Example:• // if (a = 1)• // b = 1;• // else• // b = 2;

In assembler, might be : LDA a CMP 1 JNE E1 MOV b,1 J I3E1 MOV b,2I3 NOP

Page 14: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Typical Status Bits

• Many variations among architectures• Some commonly used status bits:– Zero = last result was zero– Carry = last result was larger than word size– Negative - last result less than zero– Overflow - last result was larger than word size– Equal - may be Zero renamed

• May be others• IBM System/360 – status in “condition code”

Page 15: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Interrupts

• How do you know an outside event is finished?

• Examples:– I/O operation– Interval timer– Other external source

Page 16: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Interrupts versus Polling

• Polling simpler– ...but much slower– Example:

Picking up your telephone every minute to see if you have a call

• Interrupt– Outside event hardware tells CPU it is done– Example:

Doing your homework while waiting for a phone call

Page 17: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Exception Interrupts

• Interrupts may also signal a problem– Example: storage parity error

• Interrupts may also signal internal event– program exception (overflow, underflow, etc.)– Generally program related

• Interrupts may also signal service request– Some instructions are restricted– Require state change from normal to executive, etc.– Example: opening a file

Page 18: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Operation Code

• Part of each instruction• Tells the control unit what to do next• May be fixed size:– six bits (CDC 3300)– eight bits (IBM System/360)– Often longer

• May be multiple bytes, split into two or more sections, et cetera

Page 19: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Instruction Set• Set of low-level operations the computer can perform• Sometimes called Instruction Repetoire• Categories:– Arithmetic– Control and branching– Bit manipulation– Character operations– Floating-point arithmetic– Decimal arithmetic– …and more

• Instruction set grows over time

Page 20: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Instruction Format

• Most machines have several formats• Generally one word in simpler designs• CDC 3300 – one word• May be multibyte:– IBM System/360 - 2, 4, or 6 bytes– Intel x86 - 1 to 15 bytes

• As designs mature, instruction formats may be added

Page 21: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Addressing Modes• How does an instruction specify what memory location holds

the data to be used?• Examples:

– Direct – actual memory address carried as part of the instruction• More prevalent in older, smaller designs

– Indexed – adds a value in an index register to formulate the actual address

– Indirect – Memory location has the address of the data rather than the actual data

– Register – address is in a register– Register with displacement – instruction holds a value added to a

register value to arrive at the actual data address– Program-counter relative addressing – instruction holds the offset

(difference) from the current instruction address• Common for jump/branch instructions

Page 22: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Examples Of Computer Architecture

• CDC 3300 - simple accumulator architecture– Typical 1960s design– Used at CSUN – early 1970s– Typical CDC – both positive and negative zero

• - IBM System/360 - multiple register design– Introduced 1964– 8-bit characters– Still in production 50 years later – “the

mainframe”

Page 23: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

CDC 3300

Page 24: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

IBM System/360

Page 25: Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.

Pep-8 Architecture

• Defined in course text• Simulated architecture• Similar to DEC PDP-8• See book for details