CS:APP3e CS:APP Chapter 4 Computer Architecture Logic Design CS:APP Chapter 4 Computer Architecture Logic Design CENG331 - Computer Organization Murat.

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

Introduction to Sequential Logic Design Latches. 2 Terminology A bistable memory device is the generic term for the elements we are studying. Latches.
Computer Science 210 Computer Organization Clocks and Memory Elements.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /23/2013 Lecture 7: Computer Clock & Memory Elements Instructor: Ashraf Yaseen DEPARTMENT OF MATH &
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Introduction to Sequential Logic Design Bistable elements Latches.
CP208 Digital Electronics Class Lecture 11 May 13, 2009.
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
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
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
ENGIN112 L20: Sequential Circuits: Flip flops October 20, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 20 Sequential Circuits: Flip.
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
Chapter Five The Processor: Datapath and Control.
State Machines Used to Design Sequential Circuits.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
CS61CL Machine Structures Lec 8 – State and Register Transfers David Culler Electrical Engineering and Computer Sciences University of California, Berkeley.
CS:APP CS:APP Chapter 4 Computer Architecture Control Logic and Hardware Control Language CS:APP Chapter 4 Computer Architecture Control Logic and Hardware.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Sequential Networks Two major classes of Sequential Circuits 1.Fundamental Mode – A sequential circuit where: Only one input is allowed to change at any.
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
HCL and ALU תרגול 10. Overview of Logic Design Fundamental Hardware Requirements – Communication: How to get values from one place to another – Computation.
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
1 Seoul National University Logic Design. 2 Overview of Logic Design Seoul National University Fundamental Hardware Requirements  Computation  Storage.
Chapter 4: Processor Architecture How does the hardware execute the instructions? We’ll see by studying an example system  Based on simple instruction.
Processor: Datapath and Control
Computer Architecture Lecture 4 Sequential Circuits Ralph Grishman September 2015 NYU.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
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.
Datapath Design I Topics Sequential instruction execution cycle Instruction mapping to hardware Instruction decoding Systems I.
Introduction to Sequential Logic Design Bistable elements.
Architecture (I) Processor Architecture. – 2 – Processor Goal Understand basic computer organization Instruction set architecture Deeply explore the CPU.
Computer Architecture and Organization Unit -1. Digital Logic Circuits – Logic Gates – Boolean Algebra – Map Simplification – Combinational Circuits –
Computer Architecture Carnegie Mellon University
1 Sequential CPU Implementation. 2 Outline Logic design Organizing Processing into Stages SEQ timing Suggested Reading 4.2,4.3.1 ~
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.
CEC 220 Digital Circuit Design Latches and Flip-Flops Monday, March 03 CEC 220 Digital Circuit Design Slide 1 of 19.
1 Processor Architecture. 2 Topics Write Y86 code Basic Logic design Hardware Control Language HCL Suggested Reading: 4.1, 4.2.
Chapter 4: Processor Architecture
Chapter 6 – Digital Electronics – Part 1 1.D (Data) Flip Flops 2.RS (Set-Reset) Flip Flops 3.T Flip Flops 4.JK Flip Flops 5.JKMS Flip Flops Information.
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
CENG 241 Digital Design 1 Lecture 7 Amirali Baniasadi
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.
Mealy and Moore Machines Lecture 8 Overview Moore Machines Mealy Machines Sequential Circuits.
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.
Computer Science 210 Computer Organization
Computer Architecture & Operations I
Computer Architecture & Operations I
Lecture 12 Logic Design Review & HCL & Bomb Lab
Seoul National University
Morgan Kaufmann Publishers
Computer Science 210 Computer Organization
Latches and Flip-flops
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Computer Science 210 Computer Organization
Introduction to Computer System
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Recap: Performance Comparison
Computer Architecture
Introduction to Computer System
Introduction to the Architecture of Computers
Presentation transcript:

CS:APP3e CS:APP Chapter 4 Computer Architecture Logic Design CS:APP Chapter 4 Computer Architecture Logic Design CENG331 - Computer Organization Murat Manguoglu Adapted from slides of the textbook:

– 2 – CS:APP3e 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 Communication Low or high voltage on wire Computation Compute Boolean functions Storage Store bits of information

– 3 – CS:APP3e Digital Signals 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 Voltage Time 0 1 0

– 4 – CS:APP3e Computing with Logic Gates Outputs are Boolean functions of inputs Respond continuously to changes in inputs With some, small delay Voltage Time a b a && b Rising Delay Falling Delay

– 5 – CS:APP3e Combinational Circuits Acyclic Network of Logic Gates Continously responds to changes on primary inputs Primary outputs become (after some delay) Boolean functions of primary inputs Acyclic Network Primary Inputs Primary Outputs

– 6 – CS:APP3e Bit Equality Generate 1 if a and b are equal Hardware Control Language (HCL) Very simple hardware description language Boolean operations have syntax similar to C logical operations We’ll use it to describe control logic for processors Bit equal a b eq bool eq = (a&&b)||(!a&&!b) HCL Expression

– 7 – CS:APP3e Word Equality 64-bit word size HCL representation Equality operation Generates Boolean value b 63 Bit equal a 63 eq 63 b 62 Bit equal a 62 eq 62 b1b1 Bit equal a1a1 eq 1 b0b0 Bit equal a0a0 eq 0 Eq = = B A Word-Level Representation bool Eq = (A == B) HCL Representation

– 8 – CS:APP3e Bit-Level Multiplexor Control signal s Data signals a and b Output a when s=1, b when s=0 Bit MUX b s a out bool out = (s&&a)||(!s&&b) HCL Expression

– 9 – CS:APP3e Word Multiplexor Select input word A or B depending on control signal s HCL representation Case expression Series of test : value pairs Output value for first successful test Word-Level Representation HCL Representation b 63 s a 63 out 63 b 62 a 62 out 62 b0b0 a0a0 out 0 int Out = [ s : A; 1 : B; ]; s B A Out MUX

– 10 – CS:APP3e HCL Word-Level Examples Find minimum of three input words HCL case expression Final case guarantees match A Min3 MIN3 B C int Min3 = [ A < B && A < C : A; B < A && B < C : B; 1 : C; ]; D0 D3 Out4 s0 s1 MUX4 D2 D1 Select one of 4 inputs based on two control bits HCL case expression Simplify tests by assuming sequential matching int Out4 = [ !s1&&!s0: D0; !s1 : D1; !s0 : D2; 1 : D3; ]; Minimum of 3 Words 4-Way Multiplexor

– 11 – CS:APP3e OF ZF CF OF ZF CF OF ZF CF OF ZF CF Arithmetic Logic Unit Combinational logic Continuously responding to inputs Control signal selects function computed Corresponding to 4 arithmetic/logical operations in Y86-64 Also computes values for condition codes ALUALU Y X X + Y 0 ALUALU Y X X - Y 1 ALUALU Y X X & Y 2 ALUALU Y X X ^ Y 3 A B A B A B A B

– 12 – CS:APP3e Storing 1 Bit Bistable Element Q+ Q– q !q q = 0 or 1 V in V1V1 V2V2

– 13 – CS:APP3e Storing 1 Bit (cont.) Bistable Element Q+ Q– q !q q = 0 or 1 V in V1V1 V2V2 V1V1 V2V2 V in = V 2 Stable 0 Stable 1 Metastable

– 14 – CS:APP3e Physical Analogy Stable 0 Stable 1 Metastable. Stable left. Stable right. Metastable

– 15 – CS:APP3e Storing and Accessing 1 Bit Q+ Q– R S R-S Latch (Flip-Flop) Resetting Setting Storing 0 0 !q q q Bistable Element Q+ Q– q !q q = 0 or 1

– 16 – CS:APP3e 1-Bit Latch (Flip-Flop) D Latch Q+ Q– R S D C Data Clock Latching 1 d!d d dd 0 Storing d!d q !q q 0 0

– 17 – CS:APP3e Transparent 1-Bit Latch When in latching mode, combinational propogation from D to Q+ and Q– Value latched depends on value of D as C falls C D Q+ Time Changing D Latching 1 d!d d dd

– 18 – CS:APP3e Edge-Triggered Latch Only in latching mode for brief period Rising clock edge Value latched depends on data as clock rises Output remains stable at all other times Q+ Q– R S D C Data Clock T Trigger C D Q+ Time T

– 19 – CS:APP3e Registers Stores word of data Different from program registers seen in assembly code Collection of edge-triggered latches Loads input on rising edge of clock IO Clock D C Q+ D C D C D C D C D C D C D C i7i7 i6i6 i5i5 i4i4 i3i3 i2i2 i1i1 i0i0 o7o7 o6o6 o5o5 o4o4 o3o3 o2o2 o1o1 o0o0 Clock Structure

– 20 – CS:APP3e Register Operation Stores data bits For most of time acts as barrier between input and output As clock rises, loads input State = x Rising clock  Output = xInput = y x  State = y Output = y y

– 21 – CS:APP3e State Machine Example Accumulator circuit Load or accumulate on each cycle Comb. Logic ALUALU 0 Out MUX 0 1 Clock In Load x0x0 x1x1 x2x2 x3x3 x4x4 x5x5 x0x0 x 0 +x 1 x 0 +x 1 +x 2 x3x3 x 3 +x 4 x 3 +x 4 +x 5 Clock Load In Out

– 22 – CS:APP3e Random-Access Memory Stores multiple words of memory Address input specifies which word to read or write Register file Holds values of program registers %rax, %rsp, 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 Register file Register file A B W dstW srcA valA srcB valB valW Read portsWrite port Clock

– 23 – CS:APP3e Register File Timing Reading Like combinational logic Output data generated based on input address After some delayWriting Like register Update only as clock rises Register file Register file A B srcA valA srcB valB y 2 Register file Register file W dstW valW Clock x 2 Rising clock   Register file Register file W dstW valW Clock y 2 x 2 x 2

– 24 – CS:APP3e ArchitectureGPRs/data+address registers FP registers z/Architecture16 Xilinx Spartan13 Xeon Phi [7] 1632 x86-64 [6][5] 16 W65C816S10 SPARC3132 SH 16-bit16 Power Architecture32 PIC microcontroller10 Motorola 68k [9] 8 data (d0-d7), 8 address (a0-a7)8 (if FP present) Motorola 6800 [8] 2 data, 1 index0 MIPS3132 Itanium128 IBM/ (if FP present) IBM POWER32 IBM CellIBM Cell SPE01 IA-32 [5] 8 stack of 8 (if FP present), 8 (if SSE/MMX present) Epiphany64 (per core) Emotion Engine CUDA18/16/32/64/128 AVR microcontroller320 ARMARM 64/32-bit [12] [12] 3132 ARMARM 32-bit14Varies (up to 32) Alpha [3] 1 accumulator, 6 others [2] 1 accumulator, 6 others [1] 1 accumulator, 16 others0 16-bit x86 [4] 8stack of 8 (if FP present) Source:

– 25 – CS:APP3e Hardware Control Language Very simple hardware description language Can only express limited aspects of hardware operation Parts we want to explore and modify Data Types bool : Boolean a, b, c, … int : words A, B, C, … Does not specify word size---bytes, 64-bit words, …Statements bool a = bool-expr ; int A = int-expr ;

– 26 – CS:APP3e HCL Operations Classify by type of value returned Boolean Expressions Logic Operations a && b, a || b, !a Word Comparisons A == B, A != B, A = B, A > B Set Membership A in { B, C, D } »Same as A == B || A == C || A == D Word Expressions Case expressions [ a : A; b : B; c : C ] Evaluate test expressions a, b, c, … in sequence Return word expression A, B, C, … for first successful test

– 27 – CS:APP3e Summary Computation Performed by combinational logic Computes Boolean functions Continuously reacts to input changesStorage Registers Hold single words Loaded as clock rises Random-access memories Hold multiple words Possible multiple read or write ports Read word when address input changes Write word as clock rises