Introduction to the Architecture of Computers

Slides:



Advertisements
Similar presentations
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Advertisements

1 Seoul National University Logic Design. 2 Overview of Logic Design Seoul National University Fundamental Hardware Requirements  Computation  Storage.
David O’Hallaron Carnegie Mellon University Processor Architecture Logic Design Processor Architecture Logic Design
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
The Logic Machine We looked at programming at the high level and at the low level. The question now is: How can a physical computer be built to run a program?
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
CS:APP CS:APP Chapter 4 Computer Architecture Control Logic and Hardware Control Language CS:APP Chapter 4 Computer Architecture Control Logic and Hardware.
CS 1308 – Computer Literacy and the Internet. It’s Not Magic  The goal of the next series of lectures is to show you exactly how a computer works. 
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
HCL and ALU תרגול 10. Overview of Logic Design Fundamental Hardware Requirements – Communication: How to get values from one place to another – Computation.
1 Seoul National University Logic Design. 2 Overview of Logic Design Seoul National University Fundamental Hardware Requirements  Computation  Storage.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Chapter 3 Digital Logic Structures. 3-2 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex:
Randal E. Bryant Carnegie Mellon University CS:APP CS:APP Chapter 4 Computer Architecture SequentialImplementation CS:APP Chapter 4 Computer Architecture.
Computer Architecture Carnegie Mellon University
CS 1308 – Computer Literacy and the Internet Building the CPU.
1 Sequential CPU Implementation. 2 Outline Logic design Organizing Processing into Stages SEQ timing Suggested Reading 4.2,4.3.1 ~
CS/COE0447 Computer Organization & Assembly Language
CS:APP3e CS:APP Chapter 4 Computer Architecture Logic Design CS:APP Chapter 4 Computer Architecture Logic Design CENG331 - Computer Organization Murat.
Logic Design / Processor and Control Units Tony Diep.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
1 Processor Architecture. 2 Topics Write Y86 code Basic Logic design Hardware Control Language HCL Suggested Reading: 4.1, 4.2.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 CS/COE0447 Computer Organization & Assembly Language Logic Design Appendix C.
Abstraction. Not real, not concrete A view that is removed from the reality Definitely has a "base" in reality – the "base" may be non-intuitive and not.
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
REGISTER TRANSFER AND MICROOPERATIONS
Computer Science 210 Computer Organization
Invitation to Computer Science, C++ Version, Fourth Edition
Combinational Circuits
CS161 – Design and Architecture of Computer Systems
REGISTER TRANSFER AND MICROOPERATIONS
Computer Architecture & Operations I
Instructor:Po-Yu Kuo 教師:郭柏佑
Lecture 12 Logic Design Review & HCL & Bomb Lab
Homework Reading Machine Projects Labs
Appendix B The Basics of Logic Design
CS231: Computer Architecture I
Seoul National University
Morgan Kaufmann Publishers The Processor
Basics of digital systems
Morgan Kaufmann Publishers
Computer Science 210 Computer Organization
Invitation to Computer Science, Java Version, Third Edition
An Introduction to Microprocessors
Processor (I).
Design of the Control Unit for Single-Cycle Instruction Execution
Latches and Flip-flops
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Instructors: Randy H. Katz David A. Patterson
Computer Science 210 Computer Organization
5. Combinational circuits
Digital Logic Structures Logic gates & Boolean logic
Lecture 15 Logistics Last lecture Today HW4 is due today
Instructor:Po-Yu Kuo 教師:郭柏佑
Lecture 11: Hardware for Arithmetic
Recap: Performance Comparison
Homework Reading Machine Projects Labs
CS231: Computer Architecture I
Combinational Circuits
CSC3050 – Computer Architecture
CS231: Computer Architecture I
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
Digital Circuits and Logic
An Introduction to Microprocessors
Instructor: Michael Greenbaum
Presentation transcript:

Introduction to the Architecture of Computers Professor Hugh C. Lauer CS-2011, Machine Organization and Assembly Language (Slides shamelessly adapted from Bryant & O’Hallaron, with additional materials from Patterson & Hennessey, “Computer Organization & Design,” revised 4th ed. and from Patt & Patel, Introduction to Computer Systems,” 2nd, ed.) CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Today Before electronic computers Logic and gates Latches and Registers CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Before electronic computers Data values represented by positions of beads Arithmetic by manual algorithm Data values represented by rotational positions of wheels and dials Arithmetic by rotating wheels and gears CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Charles Babbage “engines” Difference engine Analytical engine Data values represented by rotational positions of wheels and dials CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Jacquard Loom Punched cards for controlling patterns of woven cloth Punched cards were part of Babbage’s design for data entry and program control CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Punched card tabulating equipment Mid 20th century Late 19th century Data stored in trays (i.e., “files”) of punched cards algorithms coded into plug-boards to operate on data, punch new cards, etc. CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Today Before electronic computers Logic and gates Latches and Registers CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Overview of Logic Design Fundamental Hardware Requirements Communication How to get values from one place to another Computation Storage Bits are Our Friends Everything expressed in terms of values 0 and 1 Low or high voltage on wire Compute Boolean functions Store bits of information CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Digital Signals Voltage Time 1 Use voltage thresholds to extract discrete values from continuous signal Simplest version: 1-bit signal Either high range (1) or low range (0) With guard range between them Not strongly affected by noise or low quality circuit elements Can make circuits simple, small, and fast CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Computing with Logic Gates b out out = a && || out = ! And Or Not Outputs are Boolean functions of inputs Respond continuously to changes in inputs With some, small delay a && b Rising Delay Falling Delay b Voltage a Time CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Combinational Circuits Acyclic Network Primary Inputs Outputs Acyclic Network of Logic Gates Continously responds to changes on primary inputs Primary outputs become (after some delay) Boolean functions of primary inputs CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Bit Equality and Exclusive OR Xor Generate 1 if a and b are equal Generate 1 if a and b are not equal CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Word Equality Word-Level Representation b31 Bit equal a31 eq31 b30 a30 eq30 b1 a1 eq1 b0 a0 eq0 and Eq = B A Eq 32-bit word size May be adapted to any word size CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Bit-Level Multiplexor s Bit MUX b out a bool out = (s&&a)||(!s&&b) Control signal s Data signals a and b Output a when s=1, b when s=0 CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Word Multiplexor Word-Level Representation b31 s a31 out31 b30 a30 out30 b0 a0 out0 s B A Out MUX Select input word A or B depending on control signal s CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Decoder Opposite of Multiplexor Selects one of 2n outputs from n inputs =1 if and only if AB = 00 =1 if and only if AB = 01 =1 if and only if AB = 10 =1 if and only if AB = 11 CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Single-bit adder A B Carry In Carry Out Sum 0 + 0 + 0 = 002 1 0 + 0 + 1 = 012 0 + 1 + 0 = 012 0 + 1 + 1 = 102 1 + 0 + 0 = 012 1 + 0 + 1 = 102 1 + 1 + 0 = 102 1 + 1 + 1 = 112 + A B Carry In Carry Out Sum CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Single-bit adder (cont.) Carry In Carry Out Sum 0 + 0 + 0 = 002 1 0 + 0 + 1 = 012 0 + 1 + 0 = 012 0 + 1 + 1 = 102 1 + 0 + 0 = 012 1 + 0 + 1 = 102 1 + 1 + 0 = 102 1 + 1 + 1 = 112 Cin B A Cout Sum CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Multi-bit adder An-1 Bn-1 + Cn-1 Sn-1 A3 B3 + C3 S3 A2 B2 + C2 S2 A1 B1 + C1 S1 A0 B0 + C0 S0 CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Arithmetic Logic Unit (single-bit example) Y X X + Y A L U Y X X - Y 1 A L U Y X X & Y 2 A L U Y X X ^ Y 3 A B A B A B A B OF ZF CF OF ZF CF OF ZF CF OF ZF CF Combinational logic Continuously responding to inputs Control signal selects function computed Corresponding to 4 arithmetic/logical operations in Y86 Also computes values for condition codes Figure 4.15 CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Modern Arithmetic-Logic Unit (ALU) Combines Add Subtract And Or Not Xor Equality < > << >> … Outputs Result CF — Carry flag ZF — Zero flag SF — Sign flag OF — Overflow flag Result developed within one cycle (300 ps) Conspicuously absent:– multiplication! CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Questions? CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Today Before electronic computers Logic and gates Latches and Registers CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Storing 1 Bit Bistable Element Q+ Q– q !q q = 0 or 1 Vin V1 V2 CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Storing 1 Bit (cont.) Bistable Element Q+ Q– q !q q = 0 or 1 Stable 1 Vin V1 V2 Vin = V2 Vin V1 V2 Metastable Stable 0 CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Physical Analogy Stable 1 Metastable Stable 0 Metastable Stable left Stable right . . . CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Storing and Accessing 1 Bit Bistable Element Q+ Q– q !q q = 0 or 1 Q+ Q– R S R-S Latch Resetting 1 Setting 1 Storing !q q CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I 1-Bit Latch D Latch Q+ Q– R S D C Data Clock Latching 1 d !d Storing d !d q !q CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Register Structure D C Q+ i7 i6 i5 i4 i3 i2 i1 i0 o7 o6 o5 o4 o3 o2 o1 o0 Clock I O Clock Stores word of data Different from program registers seen in assembly code Collection of edge-triggered latches Loads input on rising edge of clock CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Register Operation State = x  State = y Output = y y Rising clock  x Input = y Output = x Stores data bits For most of time acts as barrier between input and output As clock rises, loads input CS-2011, D-Term 2013 Introduction to Computer Architecture – I

(Finite) State Machine A register or latch of n bits representing the “state” of the circuit An acyclic network of combinatorial logic to compute a new value of n bits based on the existing value of n bits A clock signal to effect the update of the “state” to a new “state” Combinational Logic Circuit Storage Element output input AND clock S MUX CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Finite State Machine Example DETOUR grp 1,2 on all off grp 1 on 1 0,1 01 10 11 00 all on Three groups of lights to be lit in a sequence: group 1 on, groups 1 & 2 on, all groups on, all off. The lights are on only if the main switch is on. Four states: so we need two bits to identify each state. Combinational Logic Circuit Two bit Storage switch clock 2 out1 out2 out3 S d[1:0] CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Register File Register file A B W dstW srcA valA srcB valB valW Read ports Write port Clock Stores multiple words of memory Address input specifies which word to read or write Register file Holds values of program registers %eax, %esp, etc. Register identifier serves as address ID 15 (0xF) implies no read or write performed Multiple Ports Can read and/or write multiple words in one cycle Each has separate address and data input/output CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Summary Data values stored as bits On wires, in memory cells, etc. Gates are logic elements that combine values of bits to produce other bits And, Or, Xor, addition, subtraction, comparison, etc. Latches capture bit values on wires and keep them until reset So long as power stays on Setting of latches is triggered by a clock, which allow data into the latches only when the results of combinatorial logic elements has stabilized. CS-2011, D-Term 2013 Introduction to Computer Architecture – I

Introduction to Computer Architecture – I Questions? CS-2011, D-Term 2013 Introduction to Computer Architecture – I